commit e75c0be29dcb41c5451d352c959ff2f48379c704 Author: Robert Hogan robert@roberthogan.net Date: Sun Feb 27 12:48:35 2011 +0000
Move patches directory to docs and update DEBUG readme --- doc/DEBUG | 4 - doc/notes/DEBUG | 8 + doc/patches/README | 88 + doc/patches/README.TORDNS | 187 + doc/patches/compilewarnings.patch | 739 +++ doc/patches/conffile.patch | 11 + doc/patches/getaddrbyhost.patch | 696 +++ doc/patches/getpeername.patch | 350 ++ doc/patches/infiniteloop.patch | 20 + doc/patches/localaddresses.patch | 15 + doc/patches/tordns.patch |11004 +++++++++++++++++++++++++++++++++++++ patches/README | 88 - patches/README.TORDNS | 187 - patches/compilewarnings.patch | 739 --- patches/conffile.patch | 11 - patches/getaddrbyhost.patch | 696 --- patches/getpeername.patch | 350 -- patches/infiniteloop.patch | 20 - patches/localaddresses.patch | 15 - patches/tordns.patch |11004 ------------------------------------- 20 files changed, 13118 insertions(+), 13114 deletions(-)
diff --git a/doc/DEBUG b/doc/DEBUG deleted file mode 100644 index d780d82..0000000 --- a/doc/DEBUG +++ /dev/null @@ -1,4 +0,0 @@ -gdb ./gethostbyaddr -set environment LD_PRELOAD /home/robert/Development/torsocks-svn/torsocks/debug/src/.libs/libtorsocks.so -b our_gethostbyaddr -run diff --git a/doc/notes/DEBUG b/doc/notes/DEBUG new file mode 100644 index 0000000..53797b0 --- /dev/null +++ b/doc/notes/DEBUG @@ -0,0 +1,8 @@ +You can set breakpoints in libtorsocks using the following technique. Say you +want to debug torsocks when it's wrapping a program called gethostbyaddr, that +calls gethostbyaddr(): + +gdb ./gethostbyaddr +set environment LD_PRELOAD /path/to/libtorsocks.so +b our_gethostbyaddr +run diff --git a/doc/patches/README b/doc/patches/README new file mode 100644 index 0000000..2f921a9 --- /dev/null +++ b/doc/patches/README @@ -0,0 +1,88 @@ +This is a list of the patches applied to tsocks between it's last +official release and 15/06/08. All changes applied to the source after +that date are recorded in the Changelog. + +NB: These patches are stored for historical reasons only. I have not + confirmed that they all apply cleanly to the tsocks source. I do not + know in what order they should be applied. + +File: getaddrbyhost.patch (Robert Hogan) +Date: 18/06/08 +Description: +Add support for getaddrbyhost. + +File: compilewarnings.patch (Robert Hogan) +Date: 2007 +Description: + Suppresses a number of compile warnings. Also introduces reasonable defaults + for use of Tor. + + +File: getpeername.patch (Peter Palfrader weasel@debian.org) +Date: Sat, 27 Mar 2004 13:20:56 +0100 +Description: + "If we are not done setting up the connection yet, getpeername() should + return -1 and ENOTCONN. + + This is necessary since some applications, when using non-blocking connect, + (like ircII) use getpeername() to find out if they are connected already. + + This results in races sometimes, where the client sends data to the socket + before we are done with the socks connection setup. Another solution would + be to intercept send(). + + This could be extended to actually set the peername to the peer the + client application has requested, but not for now. + + this patch is almost the same, only it uses state != DONE instead of + state == CONNECTING to find out when to send ENOTCONN back. + + this patch tries to also do continue the socks setup in getpeername(), + if it isn't done yet." + + +File: infiniteloop.patch (Peter Palfrader weasel@debian.org) +Date: Sat, 20 Mar 2004 11:41:41 +0100 +Description: + "If the server just disconnects when tsocks expects a reply, tsocks + will get stuck in an infinite busy loop." + + +File: localaddresses.patch (Roger Dingledine) +Date: Sat, 01 Apr 2006 18:17:50 -0500 +Description: + "I just noticed that tsocks hard-codes the 127.0.0.0/8 subnet + as being "local", meaning it won't ever go through the socks + proxy. + + The Tor controller's mapaddress command can assign virtual addresses + in the 127/8 space: see section 3.8 of + http://tor.eff.org/cvs/tor/doc/control-spec.txt + + We think this behavior should be allowed. Here's a patch to tsocks to + make it not always hard-code its local network." + + +File: conffile.patch ( Roderick Schertler roderick@argon.org) +Date: Fri, 03 Jun 2005 08:43:59 -0400 +Description: tsocks(8) says TSOCKS_CONFFILE but should say TSOCKS_CONF_FILE +Details: + "The tsocks(8) man page says TSOCKS_CONFFILE but should say + TSOCKS_CONF_FILE. Though this is a documentation error I don't think + it qualifies as minor. For me the program didn't work at all because + I needed to run it with an alternative config file, and I needed to + download the source to figure out the problem." + + +File: tordns.patch (Total Information Security) +Date: 2005-10-XX (?) +Original Reference: http://www.totalinfosecurity.com/patches/tor.php +Description: + "Patch from Total Information Security to resolve the DNS leakage problem + and allow access to addresses with nonstandard hostnames (e.g. those ending + in .onion)." + +Notes: + 'Total Information Security' appears to be defunct so the original link for + the patch is now dead. The patch stored here was taken from : + https://bugs.gentoo.org/show_bug.cgi?id=148550 diff --git a/doc/patches/README.TORDNS b/doc/patches/README.TORDNS new file mode 100644 index 0000000..0b7dafd --- /dev/null +++ b/doc/patches/README.TORDNS @@ -0,0 +1,187 @@ + +TORDNS +====== + +What is it? +----------- + +This patch modifies the tsocks library to use SOCKS for name resolution. + + +Why should I use it? +-------------------- + +* It's easier. + +When using this patch you don't (always..) need to run 'tor-resolve' when +using 'torify' anymore. Also, 'torify' now works directly with SSH without +the need for connect scripts or other fiddling. [As long as SSH is not +installed suid root]. + +* It allows you to use programs which are not SOCKS aware to connect to +.onion sites. + +For example, you can ssh directly to a .onion site, or use telnet / netcat +without hassle. + + +QUICK: what do I need to do to make it work? +-------------------------------------------- + +Configuration instructions: + +1) Get the sources + +wget http://ftp1.sourceforge.net/tsocks/tsocks-1.8beta5.tar.gz +wget http://www.totalinfosecurity.com/patches/tor-tsocks/tordns-1.8b5.patch + +2) Unpack and apply the tsocks patch + +tar xzvf tsocks-1.8beta5.tar.gz +cd tsocks-1.8 +patch -p1 < ../tordns-1.8b5.patch + +3) Configure, compile and install + +NOTE: The default 'configure' settings for tsocks have been changed by +this patch. The --disable-hostnames option (don't try to use DNS to look +up SOCKS servers) is now enabled by default. Also, tordns is enabled +by default. + +./configure +make +make install + +All the tordns config options have sane default values which you should +not need to change. + + +Why did I need to use 'tor-resolve' with 'torify' in the first place? +--------------------------------------------------------------------- + +Because if you run "torify telnet bar.foo.com 31337", for example, then +you're leaking information about what sites you're visiting to DNS servers. + +The tor-resolve utility resolves names through tor using SOCKS, in a way +that shouldn't compromise your privacy. + + +What won't work with this? +-------------------------- + +The 'tordns' feature for tsocks only works with applications using the +standard c library name lookup mechanisms. + +Some programs roll their own name lookup functions, for example, 'curl' +uses the 'adns' library, not the standard c library name lookup calls. +In this case, you'll still be leaking DNS requests. + +However, it seems that most programs which go to the trouble of implementing +asynchronous DNS requests or doing other tricky things have native SOCKS or +HTTP proxy support. + +Requests for reverse name lookups are not intercepted. + +Finally, the tsocks library is NOT thread-safe, with or without this patch. +You should not 'torify' multithreaded applications. + + +How does it work? +----------------- + +This patch adds interceptors for common name resolution calls to tsocks. +Specifically, the 'gethostbyname', 'getaddrinfo' and 'getipnodebyname' library +functions. (gethostbyname_r is not supported). + +When a call to one of these functions is intercepted, a SOCKS4A resolve +request is used to retrieve the relevant information, and the results are +cached. + +When the application calls 'connect', the cache is consulted and instead +of making a SOCKS5 request and supplying the IP address, we connect using +the name. This prevents those messages in the tor logs which look like: + + Sep 23 10:12:20.901 [warn] fetch_from_buf_socks(): Your application (using s + ocks5 on port 80) is giving Tor only an IP address. Applications that do DNS + resolves themselves may leak information. Consider using Socks4A (e.g. via + privoxy or socat) instead. + +There are special provisions for handling .onion sites. When a program asks +to resolve a name ending in '.onion', no name lookup is performed. A bogus IP +address is returned. The range of unused IP addresses to hand out is called the +"deadpool". This IP address doesn't mean anything in particular, and could be +considered a cookie associated with the name. When the application eventually +calls 'connect' with this bogus IP, the cache is consulted and the result is a +SOCKS5 request which includes the name of the .onion site. + +The default deadpool range is '127.0.69.0/255.255.255.0'. NOTE: if a resolve +request results in an IP from the deadpool range then the response is rejected, +and it appears to the application that the lookup failed. + +The lookup cache is kept in mmap'd memory and shared across fork() calls. +This is because some programs perform name lookups in a child process and +then invoke 'connect' in the parent as a kind of "poor man's async DNS". + + +Advanced configuration options +------------------------------ + +The following options have been added to the tsocks configuration file: + +tordns_enable + + The default value is 'true'. If you set it to 'false', tsocks should work + just like it did without the tordns patch. + + +tordns_deadpool_range + + The default value is '127.0.69.0/255.255.255.0'. This specifies what range + of IP addresses will be handed to the application as "cookies" for .onion + names. Of course, you should pick a block of addresses which you aren't + going to ever need to actually connect to. + + +tordns_cache_size + + This specifies the number of IP addresses looked up through socks to cache. + The default value is 256. The default value is 256. Each entry consumes 260 + bytes of memory, so the default adds 66,560 bytes of overhead to each + 'torified' process. NOTE: if the number of IP addresses in + tordns_deadpool_range is less than the value specified for tordns_cache_size, + then the cache will be shrunk to fit the deadpool range. This is to prevent + duplicate deadpool addresses from ever appearing in the cache. + + +TODO +---- + +* Think about how local names get resolved. Is it important? For example, + if I 'telnet localhost' which using tordns, what should happen? Should + we search through /etc/hosts ourselves or what? + +* What about the isc library calls like res_init and so on? How widely are + they use? Does this present a more elegant way to implement this stuff? + +* Perhaps intercept res_query etc and try to do something appropriate. + +* It should be possible to make this thread-safe with --enable-threads. + +* validateconf needs to be updated to understand (and show information about) + the tordns configuration options. + +* Perhaps intercept reverse name lookups? + +* In fact, one could modify tsocks further to play nicely with tor. For + example, you could prevent nonlocal UDP traffic from being sent at all, + and so on. + + +****************************************************** +Questions or comments, please contact: +Blair Strang (bls@totalinfosecurity.com) +Caleb Anderson (caleb.anderson@totalinfosecurity.com) +Carl Purvis (carl.purvis@totalinfosecurity.com) + +Total Information Security Ltd. +http://www.totalinfosecurity.com/ diff --git a/doc/patches/compilewarnings.patch b/doc/patches/compilewarnings.patch new file mode 100644 index 0000000..9c93be1 --- /dev/null +++ b/doc/patches/compilewarnings.patch @@ -0,0 +1,739 @@ +Only in /home/robert/Development/tork/src/tsocks/: .#Makefile.in.1.12 +Only in /home/robert/Development/tork/src/tsocks/: .deps +Only in /home/robert/Development/tork/src/tsocks/: .libs +Common subdirectories: /backup/robert/Development/torsocks/CVS and /home/robert/Development/tork/src/tsocks/CVS +diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/ChangeLog /home/robert/Development/tork/src/tsocks/ChangeLog +--- /backup/robert/Development/torsocks/ChangeLog 2008-06-15 10:43:02.000000000 +0100 ++++ /home/robert/Development/tork/src/tsocks/ChangeLog 2007-09-30 16:13:34.000000000 +0100 +@@ -1,15 +1,5 @@ +-version 1.81 - 2006.11.17 ruben@ugr.es +- Integrated and resolved the conflicts for the following +- patches: +- -DNS from totalinfosecurity mentioned below +- -Infinite Loop from weasel +- -Getpeername from weasel +- -Documentation patch from Roderick Schertler +- -Localhost patch from Roger Dingledine +- (patches 1, 3, 4, 5 and 7 from +- http://wiki.noreply.org/noreply/TheOnionRouter/TSocksPatches) +- Patches 2 and 6 were not applied because I don't have access to +- osx or bsd and can't test them. (And the bsd patch breaks linux) ++Renamed for TorK to avoid conflicts with existing tsocks installations. ++Robert Hogan + + version 1.80tordns - 2005.10.4 bls@totalinfosecurity.com + Intercept gethostbyname() and friends, added --tordns +Only in /home/robert/Development/tork/src/tsocks/: Makefile +Only in /home/robert/Development/tork/src/tsocks/: Makefile.am~ +Only in /home/robert/Development/tork/src/tsocks/: Makefile.in~ +Only in /home/robert/Development/tork/src/tsocks/: README +Only in /home/robert/Development/tork/src/tsocks/: TODO~ +Only in /backup/robert/Development/torsocks: acconfig.h +Only in /home/robert/Development/tork/src/tsocks/: aclocal +diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/common.c /home/robert/Development/tork/src/tsocks/common.c +--- /backup/robert/Development/torsocks/common.c 2008-06-15 10:43:02.000000000 +0100 ++++ /home/robert/Development/tork/src/tsocks/common.c 2008-04-05 22:36:40.000000000 +0100 +@@ -4,7 +4,7 @@ + + */ + +-#include <config.h> ++#include <config.h> + #include <stdio.h> + #include <netdb.h> + #include <common.h> +@@ -15,6 +15,7 @@ + #include <time.h> + #include <unistd.h> + #include <arpa/inet.h> ++#include <sys/types.h> + #include <netinet/in.h> + + /* Globals */ +@@ -37,7 +38,7 @@ + #ifdef HAVE_GETHOSTBYNAME + if ((new = gethostbyname(host)) == (struct hostent *) 0) { + #endif +- return(-1); ++ return(0); + #ifdef HAVE_GETHOSTBYNAME + } else { + ip = ((struct in_addr *) * new->h_addr_list); +@@ -47,7 +48,7 @@ + } + #endif + } else +- return(-1); ++ return(0); + } + + return (hostaddr); +@@ -99,10 +100,10 @@ + return nbits; + } + +-void show_msg(int level, char *fmt, ...) { +- va_list ap; +- int saveerr; +- extern char *progname; ++void show_msg(int level, const char *fmt, ...) { ++ va_list ap; ++ int saveerr; ++/* extern char *progname; */ + char timestring[20]; + time_t timestamp; + +@@ -128,7 +129,7 @@ + fprintf(logfile, "%s ", timestring); + } + +- // fputs(progname, logfile); ++ /* fputs(progname, logfile); */ + + if (logstamp) { + fprintf(logfile, "(%d)", getpid()); +Only in /home/robert/Development/tork/src/tsocks/: common.c~ +diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/common.h /home/robert/Development/tork/src/tsocks/common.h +--- /backup/robert/Development/torsocks/common.h 2008-06-15 10:43:02.000000000 +0100 ++++ /home/robert/Development/tork/src/tsocks/common.h 2007-11-02 20:23:55.000000000 +0000 +@@ -1,7 +1,7 @@ + /* Common functions provided in common.c */ + + void set_log_options(int, char *, int); +-void show_msg(int level, char *, ...); ++void show_msg(int level, const char *, ...); + int count_netmask_bits(uint32_t mask); + unsigned int resolve_ip(char *, int, int); + +Only in /home/robert/Development/tork/src/tsocks/: common.lo +Only in /backup/robert/Development/torsocks: config.guess +Only in /backup/robert/Development/torsocks: config.h.in +Only in /backup/robert/Development/torsocks: config.status +Only in /backup/robert/Development/torsocks: config.sub +Only in /backup/robert/Development/torsocks: configure.in +diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/dead_pool.c /home/robert/Development/tork/src/tsocks/dead_pool.c +--- /backup/robert/Development/torsocks/dead_pool.c 2008-06-15 10:43:02.000000000 +0100 ++++ /home/robert/Development/tork/src/tsocks/dead_pool.c 2008-04-05 22:35:46.000000000 +0100 +@@ -1,5 +1,6 @@ + #include <stdio.h> + #include <sys/socket.h> ++#include <sys/types.h> + #include <netinet/in.h> + #include <arpa/inet.h> + #include <netdb.h> +@@ -29,10 +30,11 @@ + } + + dead_pool * +-init_pool(int pool_size, struct in_addr deadrange_base, ++init_pool(unsigned int pool_size, struct in_addr deadrange_base, + struct in_addr deadrange_mask, char *sockshost, uint16_t socksport) + { +- int i, deadrange_bits, deadrange_width, deadrange_size; ++ unsigned int i, deadrange_size, deadrange_width; ++ int deadrange_bits; + struct in_addr socks_server; + dead_pool *newpool = NULL; + +@@ -182,7 +184,7 @@ + int + search_pool_for_name(dead_pool *pool, const char *name) + { +- int i; ++ unsigned int i; + for(i=0; i < pool->n_entries; i++){ + if(strcmp(name, pool->entries[i].name) == 0){ + return i; +@@ -194,7 +196,7 @@ + char * + get_pool_entry(dead_pool *pool, struct in_addr *addr) + { +- int i; ++ unsigned int i; + uint32_t intaddr = addr->s_addr; + + if(pool == NULL) { +Only in /home/robert/Development/tork/src/tsocks/: dead_pool.c~ +diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/dead_pool.h /home/robert/Development/tork/src/tsocks/dead_pool.h +--- /backup/robert/Development/torsocks/dead_pool.h 2008-06-15 10:43:02.000000000 +0100 ++++ /home/robert/Development/tork/src/tsocks/dead_pool.h 2007-11-02 20:59:58.000000000 +0000 +@@ -1,7 +1,7 @@ + #ifndef _DEAD_POOL_H + #define _DEAD_POOL_H + +-#include <config.h> ++#include <config.h> + + extern int (*realconnect)(CONNECT_SIGNATURE); + extern int (*realclose)(CLOSE_SIGNATURE); +@@ -16,7 +16,7 @@ + + struct struct_dead_pool { + pool_ent *entries; /* Points to array of pool entries */ +- int n_entries; /* Number of entries in the deadpool */ ++ unsigned int n_entries; /* Number of entries in the deadpool */ + unsigned int deadrange_base; /* Deadrange start IP in host byte order */ + unsigned int deadrange_mask; /* Deadrange netmask in host byte order */ + unsigned int deadrange_size; /* Number of IPs in the deadrange */ +@@ -29,7 +29,7 @@ + + typedef struct struct_dead_pool dead_pool; + +-dead_pool *init_pool(int deadpool_size, struct in_addr deadrange_base, ++dead_pool *init_pool(unsigned int deadpool_size, struct in_addr deadrange_base, + struct in_addr deadrange_mask, char *sockshost, uint16_t socksport); + int is_dead_address(dead_pool *pool, uint32_t addr); + char *get_pool_entry(dead_pool *pool, struct in_addr *addr); +Only in /home/robert/Development/tork/src/tsocks/: dead_pool.lo +Only in /home/robert/Development/tork/src/tsocks/: getpeername.patch +Only in /home/robert/Development/tork/src/tsocks/: infiniteloop.patch +diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/inspectsocks.c /home/robert/Development/tork/src/tsocks/inspectsocks.c +--- /backup/robert/Development/torsocks/inspectsocks.c 2008-06-15 10:43:02.000000000 +0100 ++++ /home/robert/Development/tork/src/tsocks/inspectsocks.c 2008-04-05 22:36:40.000000000 +0100 +@@ -23,11 +23,11 @@ + */ + + /* Global configuration variables */ +-char *progname = "inspectsocks"; /* Name for error msgs */ ++const char *progname = "inspectsocks"; /* Name for error msgs */ + int defaultport = 1080; /* Default SOCKS port */ + + /* Header Files */ +-#include <config.h> ++#include <config.h> + #include <stdio.h> + #include <stdlib.h> + #include <unistd.h> +@@ -35,6 +35,7 @@ + #include <sys/socket.h> + #include <string.h> + #include <strings.h> ++#include <sys/types.h> + #include <netinet/in.h> + #include <arpa/inet.h> + #include <errno.h> +@@ -44,7 +45,7 @@ + int reqlen, void *rep, int replen); + + int main(int argc, char *argv[]) { +- char *usage = "Usage: <socks server name/ip> [portno]"; ++ const char *usage = "Usage: <socks server name/ip> [portno]"; + char req[9]; + char resp[100]; + unsigned short int portno = defaultport; +@@ -68,7 +69,7 @@ + } + case 2: + if ((server.sin_addr.s_addr = resolve_ip(argv[1], 1,HOSTNAMES)) +- == -1) { ++ == 0) { + show_msg(MSGERR, "Invalid IP/host specified (%s)\n", argv[1]); + show_msg(MSGERR, "%s\n", usage); + exit(1); +Only in /home/robert/Development/tork/src/tsocks/: inspectsocks.c~ +Only in /home/robert/Development/tork/src/tsocks/: libtorksocks.la +diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/parser.c /home/robert/Development/tork/src/tsocks/parser.c +--- /backup/robert/Development/torsocks/parser.c 2008-06-15 10:43:02.000000000 +0100 ++++ /home/robert/Development/tork/src/tsocks/parser.c 2008-04-05 22:25:54.000000000 +0100 +@@ -12,7 +12,7 @@ + #include <stdio.h> + #include <stdlib.h> + #include <errno.h> +-#include <config.h> ++#include <config.h> + #include "common.h" + #include "parser.h" + +@@ -24,15 +24,15 @@ + static int check_server(struct serverent *); + static int tokenize(char *, int, char *[]); + static int handle_path(struct parsedfile *, int, int, char *[]); +-static int handle_endpath(struct parsedfile *, int, int, char *[]); +-static int handle_reaches(struct parsedfile *, int, char *); ++static int handle_endpath(struct parsedfile *, int, int); ++static int handle_reaches(int, char *); + static int handle_server(struct parsedfile *, int, char *); + static int handle_type(struct parsedfile *config, int, char *); + static int handle_port(struct parsedfile *config, int, char *); +-static int handle_local(struct parsedfile *, int, char *); ++static int handle_local(struct parsedfile *, int, const char *); + static int handle_tordns_enabled(struct parsedfile *, int, char *); +-static int handle_tordns_deadpool_range(struct parsedfile *, int, char *); +-static int handle_tordns_cache_size(struct parsedfile *, int, char *); ++static int handle_tordns_deadpool_range(struct parsedfile *, int, const char *); ++static int handle_tordns_cache_size(struct parsedfile *, char *); + static int handle_defuser(struct parsedfile *, int, char *); + static int handle_defpass(struct parsedfile *, int, char *); + static int make_netent(char *value, struct netent **ent); +@@ -54,6 +54,7 @@ + config->tordns_cache_size = 256; + config->tordns_enabled = 1; + ++ + /* If a filename wasn't provided, use the default */ + if (filename == NULL) { + strncpy(line, CONF_FILE, sizeof(line) - 1); +@@ -62,15 +63,19 @@ + filename = line; + } + +- /* Read the configuration file */ ++ /* If there is no configuration file use reasonable defaults for Tor */ + if ((conf = fopen(filename, "r")) == NULL) { + show_msg(MSGERR, "Could not open socks configuration file " + "(%s), assuming all networks local\n", filename); +- handle_local(config, 0, "0.0.0.0/0.0.0.0"); ++ memset(&(config->defaultserver), 0x0, sizeof(config->defaultserver)); ++ check_server(&(config->defaultserver)); ++ handle_local(config, 0, "127.0.0.0/255.0.0.0"); ++/* handle_local(config, 0, "0.0.0.0/0.0.0.0");*/ + rc = 1; /* Severe errors reading configuration */ + } + else { +- memset(&(config->defaultserver), 0x0, sizeof(config->defaultserver)); ++ ++ memset(&(config->defaultserver), 0x0, sizeof(config->defaultserver)); + + while (NULL != fgets(line, MAXLINE, conf)) { + /* This line _SHOULD_ end in \n so we */ +@@ -82,11 +87,8 @@ + } + fclose(conf); + +- if (!config->localnets) { +- /* Use 127.0.0.1/255.0.0.0 by default */ +- handle_local(config, 0, "127.0.0.0/255.0.0.0"); +- } +- ++ /* Always add the 127.0.0.1/255.0.0.0 subnet to local */ ++ handle_local(config, 0, "127.0.0.0/255.0.0.0"); + + /* Check default server */ + check_server(&(config->defaultserver)); +@@ -108,9 +110,14 @@ + /* Check server entries (and establish defaults) */ + static int check_server(struct serverent *server) { + +- /* Default to the default SOCKS port */ ++ /* Default to the default Tor Socks port */ + if (server->port == 0) { +- server->port = 1080; ++ server->port = 9050; ++ } ++ ++ /* Default to a presumably local installation of Tor */ ++ if (server->address == NULL) { ++ server->address = strdup("127.0.0.1"); + } + + /* Default to SOCKS V4 */ +@@ -137,7 +144,7 @@ + /* Set the spare slots to an empty string to simplify */ + /* processing */ + for (i = nowords; i < 10; i++) +- words[i] = ""; ++ words[i] = NULL; + + if (nowords > 0) { + /* Now this can either be a "path" block starter or */ +@@ -146,7 +153,7 @@ + if (!strcmp(words[0], "path")) { + handle_path(config, lineno, nowords, words); + } else if (!strcmp(words[0], "}")) { +- handle_endpath(config, lineno, nowords, words); ++ handle_endpath(config, lineno, nowords); + } else { + /* Has to be a pair */ + if ((nowords != 3) || (strcmp(words[1], "="))) { +@@ -154,7 +161,7 @@ + "on line %d in configuration " + "file, "%s"\n", lineno, savedline); + } else if (!strcmp(words[0], "reaches")) { +- handle_reaches(config, lineno, words[2]); ++ handle_reaches(lineno, words[2]); + } else if (!strcmp(words[0], "server")) { + handle_server(config, lineno, words[2]); + } else if (!strcmp(words[0], "server_port")) { +@@ -172,7 +179,7 @@ + } else if (!strcmp(words[0], "tordns_deadpool_range")) { + handle_tordns_deadpool_range(config, lineno, words[2]); + } else if (!strcmp(words[0], "tordns_cache_size")) { +- handle_tordns_cache_size(config, lineno, words[2]); ++ handle_tordns_cache_size(config, words[2]); + } else { + show_msg(MSGERR, "Invalid pair type (%s) specified " + "on line %d in configuration file, " +@@ -244,7 +251,7 @@ + return(0); + } + +-static int handle_endpath(struct parsedfile *config, int lineno, int nowords, char *words[]) { ++static int handle_endpath(struct parsedfile *config, int lineno, int nowords) { + + if (nowords != 1) { + show_msg(MSGERR, "Badly formed path close statement on line " +@@ -261,7 +268,7 @@ + return(0); + } + +-static int handle_reaches(struct parsedfile *config, int lineno, char *value) { ++static int handle_reaches(int lineno, char *value) { + int rc; + struct netent *ent; + +@@ -465,7 +472,7 @@ + return 0; + } + +-static int handle_tordns_cache_size(struct parsedfile *config, int lineno, ++static int handle_tordns_cache_size(struct parsedfile *config, + char *value) + { + char *endptr; +@@ -489,7 +496,7 @@ + } + + static int handle_tordns_deadpool_range(struct parsedfile *config, int lineno, +- char *value) ++ const char *value) + { + int rc; + struct netent *ent; +@@ -508,7 +515,7 @@ + return(0); + } + +- rc = make_netent(value, &ent); ++ rc = make_netent((char *)value, &ent); + /* This is copied from handle_local and should probably be folded into + a generic whinge() function or something */ + switch(rc) { +@@ -559,7 +566,7 @@ + return 0; + } + +-static int handle_local(struct parsedfile *config, int lineno, char *value) { ++static int handle_local(struct parsedfile *config, int lineno, const char *value) { + int rc; + struct netent *ent; + +@@ -571,7 +578,7 @@ + return(0); + } + +- rc = make_netent(value, &ent); ++ rc = make_netent((char *)value, &ent); + switch(rc) { + case 1: + show_msg(MSGERR, "Local network specification (%s) is not validly " +@@ -777,7 +784,7 @@ + /* standard strsep and this function is that this one will */ + /* set *separator to the character separator found if it isn't null */ + char *strsplit(char *separator, char **text, const char *search) { +- int len; ++ unsigned int len; + char *ret; + + ret = *text; +Only in /home/robert/Development/tork/src/tsocks/: parser.c~ +diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/parser.h /home/robert/Development/tork/src/tsocks/parser.h +--- /backup/robert/Development/torsocks/parser.h 2008-06-15 10:43:02.000000000 +0100 ++++ /home/robert/Development/tork/src/tsocks/parser.h 2007-11-02 21:00:20.000000000 +0000 +@@ -35,7 +35,7 @@ + struct serverent *paths; + int tordns_enabled; + int tordns_failopen; +- int tordns_cache_size; ++ unsigned int tordns_cache_size; + struct netent *tordns_deadpool_range; + }; + +Only in /home/robert/Development/tork/src/tsocks/: parser.lo +Only in /home/robert/Development/tork/src/tsocks/: soname.diff +Only in /home/robert/Development/tork/src/tsocks/: stamp-h2 +Only in /home/robert/Development/tork/src/tsocks/: tork-tsocks.conf +Only in /home/robert/Development/tork/src/tsocks/: torkify +Only in /home/robert/Development/tork/src/tsocks/: torkify.1 +Only in /home/robert/Development/tork/src/tsocks/: torkify.in +Only in /backup/robert/Development/torsocks: torksock.diff +Only in /home/robert/Development/tork/src/tsocks/: torksocks +Only in /home/robert/Development/tork/src/tsocks/: torksocks.1 +Only in /home/robert/Development/tork/src/tsocks/: torksocks.8 +Only in /home/robert/Development/tork/src/tsocks/: torksocks.announce +Only in /home/robert/Development/tork/src/tsocks/: torksocks.conf.5 +Only in /backup/robert/Development/torsocks: torksocks.diff +Only in /home/robert/Development/tork/src/tsocks/: torksocks.in +Only in /home/robert/Development/tork/src/tsocks/: torksocks.in~ +Only in /backup/robert/Development/torsocks: torksocks2.diff +Only in /backup/robert/Development/torsocks: torksockscols.diff +Only in /backup/robert/Development/torsocks: tsocks +Only in /backup/robert/Development/torsocks: tsocks.1 +Only in /backup/robert/Development/torsocks: tsocks.8 +Only in /backup/robert/Development/torsocks: tsocks.announce +diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/tsocks.c /home/robert/Development/tork/src/tsocks/tsocks.c +--- /backup/robert/Development/torsocks/tsocks.c 2008-06-15 10:43:01.000000000 +0100 ++++ /home/robert/Development/tork/src/tsocks/tsocks.c 2008-06-14 20:11:26.000000000 +0100 +@@ -21,14 +21,14 @@ + */ + + /* PreProcessor Defines */ +-#include <config.h> ++#include <config.h> + + #ifdef USE_GNU_SOURCE + #define _GNU_SOURCE + #endif + + /* Global configuration variables */ +-char *progname = "libtsocks"; /* Name used in err msgs */ ++const char *progname = "libtsocks"; /* Name used in err msgs */ + + /* Header Files */ + #include <stdio.h> +@@ -39,6 +39,7 @@ + #include <sys/socket.h> + #include <string.h> + #include <strings.h> ++#include <sys/types.h> + #include <netinet/in.h> + #include <arpa/inet.h> + #include <sys/poll.h> +@@ -76,7 +77,7 @@ + static char *conffile = NULL; + + /* Exported Function Prototypes */ +-void _init(void); ++void __attribute__ ((constructor)) tsocks_init(void); + int connect(CONNECT_SIGNATURE); + int select(SELECT_SIGNATURE); + int poll(POLL_SIGNATURE); +@@ -114,11 +115,11 @@ + static int read_socksv5_connect(struct connreq *conn); + static int read_socksv5_auth(struct connreq *conn); + #ifdef USE_TOR_DNS +-static int deadpool_init(); ++static int deadpool_init(void); + static int send_socksv4a_request(struct connreq *conn, const char *onion_host); + #endif + +-void _init(void) { ++void tsocks_init(void) { + #ifdef USE_OLD_DLSYM + void *lib; + #endif +@@ -139,50 +140,49 @@ + #ifdef USE_SOCKS_DNS + realresinit = dlsym(RTLD_NEXT, "res_init"); + #endif +- #ifdef USE_TOR_DNS +- realgethostbyname = dlsym(RTLD_NEXT, "gethostbyname"); +- realgetaddrinfo = dlsym(RTLD_NEXT, "getaddrinfo"); +- realgetipnodebyname = dlsym(RTLD_NEXT, "getipnodebyname"); +- #endif ++ #ifdef USE_TOR_DNS ++ realgethostbyname = dlsym(RTLD_NEXT, "gethostbyname"); ++ realgetaddrinfo = dlsym(RTLD_NEXT, "getaddrinfo"); ++ realgetipnodebyname = dlsym(RTLD_NEXT, "getipnodebyname"); ++ #endif + #else + lib = dlopen(LIBCONNECT, RTLD_LAZY); + realconnect = dlsym(lib, "connect"); + realselect = dlsym(lib, "select"); + realpoll = dlsym(lib, "poll"); +- realgetpeername = dlsym(lib, "getpeername"); + #ifdef USE_SOCKS_DNS + realresinit = dlsym(lib, "res_init"); + #endif +- #ifdef USE_TOR_DNS +- realgethostbyname = dlsym(lib, "gethostbyname"); +- realgetaddrinfo = dlsym(lib, "getaddrinfo"); +- realgetipnodebyname = dlsym(RTLD_NEXT, "getipnodebyname"); +- #endif +- dlclose(lib); ++ #ifdef USE_TOR_DNS ++ realgethostbyname = dlsym(lib, "gethostbyname"); ++ realgetaddrinfo = dlsym(lib, "getaddrinfo"); ++ realgetipnodebyname = dlsym(RTLD_NEXT, "getipnodebyname"); ++ #endif ++ dlclose(lib); + lib = dlopen(LIBC, RTLD_LAZY); + realclose = dlsym(lib, "close"); +- dlclose(lib); ++ dlclose(lib); + #endif + #ifdef USE_TOR_DNS +- /* Unfortunately, we can't do this lazily because otherwise our mmap'd +- area won't be shared across fork()s. */ +- deadpool_init(); +-#endif +- ++ /* Unfortunately, we can't do this lazily because otherwise our mmap'd ++ area won't be shared across fork()s. */ ++ deadpool_init(); ++#endif + } + + static int get_environment() { + static int done = 0; ++#ifdef ALLOW_MSG_OUTPUT + int loglevel = MSGERR; + char *logfile = NULL; + char *env; +- ++#endif + if (done) + return(0); + + /* Determine the logging level */ + #ifndef ALLOW_MSG_OUTPUT +- set_log_options(-1, stderr, 0); ++ set_log_options(-1, (char *)stderr, 0); + #else + if ((env = getenv("TSOCKS_DEBUG"))) + loglevel = atoi(env); +@@ -212,7 +212,7 @@ + config = malloc(sizeof(*config)); + if (!config) + return(0); +- read_config(conffile, config); ++ read_config(conffile, config); + if (config->paths) + show_msg(MSGDEBUG, "First lineno for first path is %d\n", config->paths->lineno); + +@@ -222,14 +222,15 @@ + } + + int connect(CONNECT_SIGNATURE) { +- struct sockaddr_in *connaddr; +- struct sockaddr_in peer_address; +- struct sockaddr_in server_address; +- int gotvalidserver = 0, rc, namelen = sizeof(peer_address); +- int sock_type = -1; +- int sock_type_len = sizeof(sock_type); +- unsigned int res = -1; +- struct serverent *path; ++ struct sockaddr_in *connaddr; ++ struct sockaddr_in peer_address; ++ struct sockaddr_in server_address; ++ int gotvalidserver = 0, rc; ++ unsigned int namelen = sizeof(peer_address); ++ int sock_type = -1; ++ unsigned int sock_type_len = sizeof(sock_type); ++ int res = -1; ++ struct serverent *path; + struct connreq *newconn; + + get_environment(); +@@ -248,6 +249,14 @@ + getsockopt(__fd, SOL_SOCKET, SO_TYPE, + (void *) &sock_type, &sock_type_len); + ++ show_msg(MSGDEBUG, "sin_family: %i " ++ "\n", ++ connaddr->sin_family); ++ ++ show_msg(MSGDEBUG, "sockopt: %i " ++ "\n", ++ sock_type); ++ + /* If this isn't an INET socket for a TCP stream we can't */ + /* handle it, just call the real connect now */ + if ((connaddr->sin_family != AF_INET) || +@@ -564,7 +573,8 @@ + + int poll(POLL_SIGNATURE) { + int nevents = 0; +- int rc = 0, i; ++ int rc = 0; ++ unsigned int i; + int setevents = 0; + int monitoring = 0; + struct connreq *conn, *nextconn; +@@ -1354,7 +1364,7 @@ + #endif + + #ifdef USE_TOR_DNS +-static int deadpool_init() ++static int deadpool_init(void) + { + if(!pool) { + get_environment(); +Only in /home/robert/Development/tork/src/tsocks/: tsocks.c.rej +Only in /backup/robert/Development/torsocks: tsocks.conf.5 +Only in /home/robert/Development/tork/src/tsocks/: tsocks.c~ +diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/tsocks.h /home/robert/Development/tork/src/tsocks/tsocks.h +--- /backup/robert/Development/torsocks/tsocks.h 2008-06-15 10:43:01.000000000 +0100 ++++ /home/robert/Development/tork/src/tsocks/tsocks.h 2007-11-02 20:35:02.000000000 +0000 +@@ -50,8 +50,8 @@ + int selectevents; + + /* Buffer for sending and receiving on the socket */ +- int datalen; +- int datadone; ++ unsigned int datalen; ++ unsigned int datadone; + char buffer[2048]; + + struct connreq *next; +Only in /backup/robert/Development/torsocks: tsocks.kdevelop +Only in /backup/robert/Development/torsocks: tsocks.kdevelop.pcs +Only in /backup/robert/Development/torsocks: tsocks.kdevses +Only in /home/robert/Development/tork/src/tsocks/: tsocks.lo +diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/validateconf.c /home/robert/Development/tork/src/tsocks/validateconf.c +--- /backup/robert/Development/torsocks/validateconf.c 2008-06-15 10:43:01.000000000 +0100 ++++ /home/robert/Development/tork/src/tsocks/validateconf.c 2008-04-05 22:36:40.000000000 +0100 +@@ -23,16 +23,17 @@ + */ + + /* Global configuration variables */ +-char *progname = "validateconf"; /* Name for error msgs */ ++const char *progname = "validateconf"; /* Name for error msgs */ + + /* Header Files */ +-#include <config.h> ++#include <config.h> + #include <stdio.h> + #include <stdlib.h> + #include <unistd.h> + #include <sys/types.h> + #include <sys/socket.h> + #include <string.h> ++#include <sys/types.h> + #include <netinet/in.h> + #include <arpa/inet.h> + #include <errno.h> +@@ -44,7 +45,7 @@ + void test_host(struct parsedfile *config, char *); + + int main(int argc, char *argv[]) { +- char *usage = "Usage: [-f conf file] [-t hostname/ip[:port]]"; ++ const char *usage = "Usage: [-f conf file] [-t hostname/ip[:port]]"; + char *filename = NULL; + char *testhost = NULL; + struct parsedfile config; +@@ -103,7 +104,7 @@ + } + + /* First resolve the host to an ip */ +- if ((hostaddr.s_addr = resolve_ip(hostname, 0, 1)) == -1) { ++ if ((hostaddr.s_addr = resolve_ip(hostname, 0, 1)) == 0) { + fprintf(stderr, "Error: Cannot resolve %s\n", host); + return; + } else { +@@ -187,13 +188,13 @@ + if (server->address != NULL) + printf("Server: %s (%s)\n", server->address, + ((res.s_addr = resolve_ip(server->address, 0, +- HOSTNAMES)) == -1 ++ HOSTNAMES)) == 0 + ? "Invalid!" : inet_ntoa(res))); + else + printf("Server: ERROR! None specified\n"); + + /* Check the server is on a local net */ +- if ((server->address != NULL) && (res.s_addr != -1) && ++ if ((server->address != NULL) && (res.s_addr != 0) && + (is_local(config, &res))) + fprintf(stderr, "Error: Server is not on a network " + "specified as local\n"); +Only in /home/robert/Development/tork/src/tsocks/: validateconf.c~ diff --git a/doc/patches/conffile.patch b/doc/patches/conffile.patch new file mode 100644 index 0000000..1dd6491 --- /dev/null +++ b/doc/patches/conffile.patch @@ -0,0 +1,11 @@ +--- tsocks.8.~1~ 2002-03-16 05:20:51.000000000 -0500 ++++ tsocks.8 2005-06-03 08:37:39.000000000 -0400 +@@ -59,7 +59,7 @@ + variables as follows: + + .TP +-.I TSOCKS_CONFFILE ++.I TSOCKS_CONF_FILE + This environment variable overrides the default location of the tsocks + configuration file. This variable is not honored if the program tsocks + is embedded in is setuid. In addition this environment variable can diff --git a/doc/patches/getaddrbyhost.patch b/doc/patches/getaddrbyhost.patch new file mode 100644 index 0000000..29b2234 --- /dev/null +++ b/doc/patches/getaddrbyhost.patch @@ -0,0 +1,696 @@ +Index: common.c +=================================================================== +RCS file: /cvsroot/tork/torsocks/common.c,v +retrieving revision 1.2 +diff -p -U3 -r1.2 common.c +--- common.c 15 Jun 2008 10:01:03 -0000 1.2 ++++ common.c 18 Jun 2008 21:21:34 -0000 +@@ -26,6 +26,52 @@ char logfilename[256]; /* Name of fil + FILE *logfile = NULL; /* File to which messages should be logged */ + int logstamp = 0; /* Timestamp (and pid stamp) messages */ + ++ ++/** ++ * Read a 16-bit value beginning at <b>cp</b>. Equivalent to ++ * *(uint16_t*)(cp), but will not cause segfaults on platforms that forbid ++ * unaligned memory access. ++ */ ++uint16_t ++get_uint16(const char *cp) ++{ ++ uint16_t v; ++ memcpy(&v,cp,2); ++ return v; ++} ++/** ++ * Read a 32-bit value beginning at <b>cp</b>. Equivalent to ++ * *(uint32_t*)(cp), but will not cause segfaults on platforms that forbid ++ * unaligned memory access. ++ */ ++uint32_t ++get_uint32(const char *cp) ++{ ++ uint32_t v; ++ memcpy(&v,cp,4); ++ return v; ++} ++/** ++ * Set a 16-bit value beginning at <b>cp</b> to <b>v</b>. Equivalent to ++ * *(uint16_t)(cp) = v, but will not cause segfaults on platforms that forbid ++ * unaligned memory access. */ ++void ++set_uint16(char *cp, uint16_t v) ++{ ++ memcpy(cp,&v,2); ++} ++/** ++ * Set a 32-bit value beginning at <b>cp</b> to <b>v</b>. Equivalent to ++ * *(uint32_t)(cp) = v, but will not cause segfaults on platforms that forbid ++ * unaligned memory access. */ ++void ++set_uint32(char *cp, uint32_t v) ++{ ++ memcpy(cp,&v,4); ++} ++ ++ ++ + unsigned int resolve_ip(char *host, int showmsg, int allownames) { + struct hostent *new; + unsigned int hostaddr; +Index: dead_pool.c +=================================================================== +RCS file: /cvsroot/tork/torsocks/dead_pool.c,v +retrieving revision 1.2 +diff -p -U3 -r1.2 dead_pool.c +--- dead_pool.c 15 Jun 2008 10:02:41 -0000 1.2 ++++ dead_pool.c 18 Jun 2008 21:21:35 -0000 +@@ -15,7 +15,8 @@ void get_next_dead_address(dead_pool *po + + static int + do_resolve(const char *hostname, uint32_t sockshost, uint16_t socksport, +- uint32_t *result_addr); ++ uint32_t *result_addr, const void *addr, ++ int version, int reverse, char **result_hostname); + + /* Compares the last strlen(s2) characters of s1 with s2. Returns as for + strcasecmp. */ +@@ -77,6 +78,8 @@ init_pool(unsigned int pool_size, struct + return NULL; + } + ++ show_msg(MSGWARN, "init_pool: sockshost %s ", sockshost); ++ + /* Initialize the dead_pool structure */ + #ifdef HAVE_INET_ATON + inet_aton(sockshost, &socks_server); +@@ -139,6 +142,7 @@ store_pool_entry(dead_pool *pool, char * + int oldpos; + int rc; + uint32_t intaddr; ++ char *result_hostname; + + show_msg(MSGDEBUG, "store_pool_entry: storing '%s'\n", hostname); + show_msg(MSGDEBUG, "store_pool_entry: write pos is: %d\n", pool->write_pos); +@@ -156,7 +160,9 @@ store_pool_entry(dead_pool *pool, char * + if(strcasecmpend(hostname, ".onion") == 0) { + get_next_dead_address(pool, &pool->entries[position].ip); + } else { +- rc = do_resolve(hostname, pool->sockshost, pool->socksport, &intaddr); ++ rc = do_resolve(hostname, pool->sockshost, pool->socksport, &intaddr, 0, ++ 4 /*SOCKS5*/, 0 /*Reverse*/, &result_hostname); ++ + if(rc != 0) { + show_msg(MSGWARN, "failed to resolve: %s\n", hostname); + return -1; +@@ -237,7 +243,32 @@ build_socks4a_resolve_request(char **out + return len; + } + ++static int ++build_socks5_resolve_ptr_request(char **out, const void *_addr) ++{ ++ size_t len; ++ const struct in_addr *addr=_addr; ++ ++ len = 12; ++ *out = malloc(len); ++ (*out)[0] = 5; /* SOCKS version 5 */ ++ (*out)[1] = '\xF1'; /* Command: reverse resolve. ++ see doc/socks-extensions.txt*/ ++ (*out)[2] = '\x00'; /* RSV */ ++ (*out)[3] = '\x01'; /* ATYP: IP V4 address: X'01' */ ++ ++ set_uint32((*out)+4, addr->s_addr);/*IP*/ ++ set_uint16((*out)+4+4, 0); /* port */ ++ ++// memcpy((*out)+4, &addr.s_addr,4); /*IP*/ ++// memcpy((*out)+4+4, *(uint32_t)0, 2); /* port */ ++ ++ return len; ++} ++ + #define RESPONSE_LEN 8 ++#define SOCKS5_LEN 4 ++#define METHODRESPONSE_LEN 2 + + static int + parse_socks4a_resolve_response(const char *response, size_t len, +@@ -272,43 +303,188 @@ parse_socks4a_resolve_response(const cha + } + + static int ++parse_socks5_resolve_ptr_response(int s,const char *response, size_t len, ++ uint32_t *result_addr, char ***result_hostname) ++{ ++ char reply_buf[4]; ++ int r; ++ ++ len=0; ++ while (len < SOCKS5_LEN) { ++ r = recv(s, reply_buf+len, SOCKS5_LEN-len, 0); ++ if (r==0) { ++ show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS5 response\n"); ++ return -1; ++ } ++ if (r<0) { ++ show_msg(MSGWARN, "do_resolve: error reading SOCKS5 response\n"); ++ return -1; ++ } ++ len += r; ++ } ++ ++ if (reply_buf[0] != 5) { ++ show_msg(MSGWARN, "Bad SOCKS5 reply version."); ++ return -1; ++ } ++ if (reply_buf[1] != 0) { ++ show_msg(MSGWARN,"Got status response '%u': SOCKS5 request failed.", ++ (unsigned)reply_buf[1]); ++ return -1; ++ } ++ if (reply_buf[3] == 1) { ++ /* IPv4 address */ ++ len=0; ++ while (len < SOCKS5_LEN) { ++ r = recv(s, reply_buf+len, SOCKS5_LEN-len, 0); ++ if (r==0) { ++ show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS5 response\n"); ++ return -1; ++ } ++ if (r<0) { ++ show_msg(MSGWARN, "do_resolve: error reading address in SOCKS5 response\n"); ++ return -1; ++ } ++ len += r; ++ } ++ *result_addr = ntohl(get_uint32(reply_buf)); ++ } else if (reply_buf[3] == 3) { ++ size_t result_len; ++ len=0; ++ while (len < 1) { ++ r = recv(s, reply_buf+len, 1-len, 0); ++ if (r==0) { ++ show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS5 response\n"); ++ return -1; ++ } ++ if (r<0) { ++ show_msg(MSGWARN, "do_resolve: error reading address length in SOCKS5 response\n"); ++ return -1; ++ } ++ len += r; ++ } ++ result_len = *(uint8_t*)(reply_buf); ++ **result_hostname = malloc(result_len+1); ++ len=0; ++ while (len < (int) result_len) { ++ r = recv(s, **result_hostname+len, result_len-len, 0); ++ if (r==0) { ++ show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS5 response\n"); ++ return -1; ++ } ++ if (r<0) { ++ show_msg(MSGWARN, "do_resolve: error reading hostname in SOCKS5 response\n"); ++ return -1; ++ } ++ len += r; ++ } ++ ++ (**result_hostname)[result_len] = '\0'; ++ } ++ ++ return 0; ++} ++ ++static int + do_resolve(const char *hostname, uint32_t sockshost, uint16_t socksport, +- uint32_t *result_addr) ++ uint32_t *result_addr, const void *addr, ++ int version, int reverse, char **result_hostname) + { + int s; + struct sockaddr_in socksaddr; +- char *req, *cp; +- int r, len; ++ char *req, *cp=NULL; ++ int r, len, hslen; + char response_buf[RESPONSE_LEN]; ++ const char *handshake="\x05\x01\x00"; + + show_msg(MSGDEBUG, "do_resolve: resolving %s\n", hostname); + ++ /* Create SOCKS connection */ + s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); + if (s<0) { + show_msg(MSGWARN, "do_resolve: problem creating socket\n"); + return -1; + } + ++ /* Connect to SOCKS server */ + memset(&socksaddr, 0, sizeof(socksaddr)); + socksaddr.sin_family = AF_INET; + socksaddr.sin_port = htons(socksport); + socksaddr.sin_addr.s_addr = htonl(sockshost); + if (realconnect(s, (struct sockaddr*)&socksaddr, sizeof(socksaddr))) { + show_msg(MSGWARN, "do_resolve: error connecting to SOCKS server\n"); ++ realclose(s); + return -1; + } + +- if ((len = build_socks4a_resolve_request(&req, "", hostname))<0) { +- show_msg(MSGWARN, "do_resolve: error generating SOCKS request\n"); +- return -1; ++ /* If a SOCKS5 connection, perform handshake */ ++ if (version == 5) { ++ char method_buf[2]; ++ hslen=3; ++ while (hslen) { ++ r = send(s, handshake, hslen, 0); ++ if (r<0) { ++ show_msg(MSGWARN, "do_resolve: error sending SOCKS5 method list.\n"); ++ realclose(s); ++ return -1; ++ } ++ hslen -= r; ++ handshake += r; ++ } ++ ++ len = 0; ++ while (len < METHODRESPONSE_LEN) { ++ r = recv(s, method_buf+len, METHODRESPONSE_LEN-len, 0); ++ if (r==0) { ++ show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS response\n"); ++ realclose(s); ++ return -1; ++ } ++ if (r<0) { ++ show_msg(MSGWARN, "do_resolve: error reading SOCKS response\n"); ++ realclose(s); ++ return -1; ++ } ++ len += r; ++ } ++ ++ if (method_buf[0] != '\x05') { ++ show_msg(MSGWARN, "Unrecognized socks version: %u", ++ (unsigned)method_buf[0]); ++ realclose(s); ++ return -1; ++ } ++ if (method_buf[1] != '\x00') { ++ show_msg(MSGWARN, "Unrecognized socks authentication method: %u", ++ (unsigned)method_buf[1]); ++ realclose(s); ++ return -1; ++ } ++ } ++ ++ /* Create SOCKS request */ ++ if (reverse) { ++ if ((len = build_socks5_resolve_ptr_request(&req, addr))<0) { ++ show_msg(MSGWARN, "do_resolve: error generating reverse SOCKS request\n"); ++ realclose(s); ++ return -1; ++ } ++ }else{ ++ if ((len = build_socks4a_resolve_request(&req, "", hostname))<0) { ++ show_msg(MSGWARN, "do_resolve: error generating SOCKS request\n"); ++ realclose(s); ++ return -1; ++ } + } + ++ /* Send SOCKS request */ + cp = req; + while (len) { + r = send(s, cp, len, 0); + if (r<0) { + show_msg(MSGWARN, "do_resolve: error sending SOCKS request\n"); + free(req); ++ realclose(s); + return -1; + } + len -= r; +@@ -316,26 +492,40 @@ do_resolve(const char *hostname, uint32_ + } + free(req); + +- len = 0; +- while (len < RESPONSE_LEN) { +- r = recv(s, response_buf+len, RESPONSE_LEN-len, 0); +- if (r==0) { +- show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS response\n"); ++ /* Handle SOCKS Response */ ++ if (reverse) { ++ if (parse_socks5_resolve_ptr_response(s, response_buf, RESPONSE_LEN, ++ result_addr, &result_hostname) < 0){ ++ show_msg(MSGWARN, "do_resolve: error parsing SOCKS response\n"); ++ realclose(s); + return -1; + } +- if (r<0) { +- show_msg(MSGWARN, "do_resolve: error reading SOCKS response\n"); ++ }else{ ++ /* Process SOCKS response */ ++ len = 0; ++ while (len < RESPONSE_LEN) { ++ r = recv(s, response_buf+len, RESPONSE_LEN-len, 0); ++ if (r==0) { ++ show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS response\n"); ++ realclose(s); ++ return -1; ++ } ++ if (r<0) { ++ show_msg(MSGWARN, "do_resolve: error reading SOCKS response\n"); ++ realclose(s); ++ return -1; ++ } ++ len += r; ++ } ++ realclose(s); ++ ++ /* Parse SOCKS response */ ++ if (parse_socks4a_resolve_response(response_buf, RESPONSE_LEN, result_addr) < 0){ ++ show_msg(MSGWARN, "do_resolve: error parsing SOCKS response\n"); + return -1; + } +- len += r; + } + +- realclose(s); +- +- if (parse_socks4a_resolve_response(response_buf, RESPONSE_LEN, result_addr) < 0){ +- show_msg(MSGWARN, "do_resolve: error parsing SOCKS response\n"); +- return -1; +- } + + show_msg(MSGDEBUG, "do_resolve: success\n"); + +@@ -343,6 +533,53 @@ do_resolve(const char *hostname, uint32_ + } + + struct hostent * ++our_gethostbyaddr(dead_pool *pool, const void *_addr, socklen_t len, int type) ++{ ++ const struct in_addr *addr=_addr; ++ static struct hostent he; ++ uint32_t intaddr=0; ++ char *result_hostname=NULL; ++ int rc=0; ++ static char *addrs[2]; ++ static char *aliases[2]; ++ ++ rc = do_resolve("", pool->sockshost, pool->socksport, &intaddr, addr, ++ 5 /*SOCKS5*/, 1 /*Reverse*/, &result_hostname); ++ ++ ++ if(rc != 0) { ++ show_msg(MSGWARN, "failed to reverse resolve: %s\n", ++ inet_ntoa(*((struct in_addr *)addr))); ++ result_hostname=NULL; ++ addrs[0] = NULL; ++ addrs[1] = NULL; ++ }else{ ++ addrs[0] = (char *)addr; ++ addrs[1] = NULL; ++ } ++ ++ if (result_hostname) ++ he.h_name = result_hostname; ++ else ++ he.h_name = inet_ntoa(*((struct in_addr *)addr)); ++ ++// aliases = malloc(sizeof(char *)); ++ aliases[0] = NULL; ++ aliases[1] = NULL; ++ ++ he.h_aliases = aliases; ++ he.h_length = len; ++ he.h_addrtype = type; ++ he.h_addr_list = addrs; ++ ++ show_msg(MSGDEBUG, "our_gethostbyaddr: resolved '%s' to: '%s'\n", ++ inet_ntoa(*((struct in_addr *)he.h_addr)), result_hostname); ++ ++ return &he; ++ ++} ++ ++struct hostent * + our_gethostbyname(dead_pool *pool, const char *name) + { + int pos; +Index: inspectsocks.c +=================================================================== +RCS file: /cvsroot/tork/torsocks/inspectsocks.c,v +retrieving revision 1.1.1.1 +diff -p -U3 -r1.1.1.1 inspectsocks.c +--- inspectsocks.c 15 Jun 2008 09:43:02 -0000 1.1.1.1 ++++ inspectsocks.c 18 Jun 2008 21:21:35 -0000 +@@ -23,7 +23,7 @@ + */ + + /* Global configuration variables */ +-char *progname = "inspectsocks"; /* Name for error msgs */ ++const char *progname = "inspectsocks"; /* Name for error msgs */ + int defaultport = 1080; /* Default SOCKS port */ + + /* Header Files */ +@@ -35,6 +35,7 @@ int defaultport = 1080; /* Default + #include <sys/socket.h> + #include <string.h> + #include <strings.h> ++#include <sys/types.h> + #include <netinet/in.h> + #include <arpa/inet.h> + #include <errno.h> +@@ -44,7 +45,7 @@ int send_request(struct sockaddr_in *ser + int reqlen, void *rep, int replen); + + int main(int argc, char *argv[]) { +- char *usage = "Usage: <socks server name/ip> [portno]"; ++ const char *usage = "Usage: <socks server name/ip> [portno]"; + char req[9]; + char resp[100]; + unsigned short int portno = defaultport; +@@ -68,7 +69,7 @@ int main(int argc, char *argv[]) { + } + case 2: + if ((server.sin_addr.s_addr = resolve_ip(argv[1], 1,HOSTNAMES)) +- == -1) { ++ == 0) { + show_msg(MSGERR, "Invalid IP/host specified (%s)\n", argv[1]); + show_msg(MSGERR, "%s\n", usage); + exit(1); +Index: tsocks.c +=================================================================== +RCS file: /cvsroot/tork/torsocks/tsocks.c,v +retrieving revision 1.2 +diff -p -U3 -r1.2 tsocks.c +--- tsocks.c 15 Jun 2008 10:06:03 -0000 1.2 ++++ tsocks.c 18 Jun 2008 21:21:37 -0000 +@@ -63,6 +63,7 @@ static int (*realresinit)(void); + #ifdef USE_TOR_DNS + static dead_pool *pool = NULL; + static struct hostent *(*realgethostbyname)(GETHOSTBYNAME_SIGNATURE); ++static struct hostent *(*realgethostbyaddr)(GETHOSTBYADDR_SIGNATURE); + int (*realgetaddrinfo)(GETADDRINFO_SIGNATURE); + static struct hostent *(*realgetipnodebyname)(GETIPNODEBYNAME_SIGNATURE); + #endif +@@ -77,7 +78,7 @@ static int suid = 0; + static char *conffile = NULL; + + /* Exported Function Prototypes */ +-void __attribute__ ((constructor)) tsocks_init(void); ++void __attribute__ ((constructor)) _init(void); + int connect(CONNECT_SIGNATURE); + int select(SELECT_SIGNATURE); + int poll(POLL_SIGNATURE); +@@ -88,6 +89,7 @@ int res_init(void); + #endif + #ifdef USE_TOR_DNS + struct hostent *gethostbyname(GETHOSTBYNAME_SIGNATURE); ++struct hostent *gethostbyaddr(GETHOSTBYADDR_SIGNATURE); + int getaddrinfo(GETADDRINFO_SIGNATURE); + struct hostent *getipnodebyname(GETIPNODEBYNAME_SIGNATURE); + #endif +@@ -119,11 +121,12 @@ static int deadpool_init(void); + static int send_socksv4a_request(struct connreq *conn, const char *onion_host); + #endif + +-void tsocks_init(void) { ++void _init(void) { + #ifdef USE_OLD_DLSYM + void *lib; + #endif + ++ show_msg(MSGWARN, "In tsocks_init \n"); + /* We could do all our initialization here, but to be honest */ + /* most programs that are run won't use our services, so */ + /* we do our general initialization on first call */ +@@ -142,6 +145,7 @@ void tsocks_init(void) { + #endif + #ifdef USE_TOR_DNS + realgethostbyname = dlsym(RTLD_NEXT, "gethostbyname"); ++ //realgethostbyaddr = dlsym(RTLD_NEXT, "gethostbyaddr"); + realgetaddrinfo = dlsym(RTLD_NEXT, "getaddrinfo"); + realgetipnodebyname = dlsym(RTLD_NEXT, "getipnodebyname"); + #endif +@@ -155,6 +159,7 @@ void tsocks_init(void) { + #endif + #ifdef USE_TOR_DNS + realgethostbyname = dlsym(lib, "gethostbyname"); ++ realgethostbyaddr = dlsym(lib, "gethostbyaddr"); + realgetaddrinfo = dlsym(lib, "getaddrinfo"); + realgetipnodebyname = dlsym(RTLD_NEXT, "getipnodebyname"); + #endif +@@ -1100,6 +1105,7 @@ static int send_socksv5_connect(struct c + conn->datalen = sizeof(constring); + + #ifdef USE_TOR_DNS ++ + show_msg(MSGDEBUG, "send_socksv5_connect: looking for: %s\n", + inet_ntoa(conn->connaddr.sin_addr)); + +@@ -1394,6 +1400,15 @@ struct hostent *gethostbyname(GETHOSTBYN + } + } + ++struct hostent *gethostbyaddr(GETHOSTBYADDR_SIGNATURE) ++{ ++ if(pool) { ++ return our_gethostbyaddr(pool, addr, len, type); ++ } else { ++ return realgethostbyaddr(addr, len, type); ++ } ++} ++ + int getaddrinfo(GETADDRINFO_SIGNATURE) + { + if(pool) { +Index: common.h +=================================================================== +RCS file: /cvsroot/tork/torsocks/common.h,v +retrieving revision 1.2 +diff -p -U3 -r1.2 common.h +--- common.h 15 Jun 2008 10:01:41 -0000 1.2 ++++ common.h 18 Jun 2008 21:21:37 -0000 +@@ -1,4 +1,33 @@ + /* Common functions provided in common.c */ ++/* GCC has several useful attributes. */ ++#if defined(__GNUC__) && __GNUC__ >= 3 ++#define ATTR_NORETURN __attribute__((noreturn)) ++#define ATTR_PURE __attribute__((pure)) ++#define ATTR_CONST __attribute__((const)) ++#define ATTR_MALLOC __attribute__((malloc)) ++#define ATTR_NORETURN __attribute__((noreturn)) ++#define ATTR_NONNULL(x) __attribute__((nonnull x)) ++/** Macro: Evaluates to <b>exp</b> and hints the compiler that the value ++ * of <b>exp</b> will probably be true. */ ++#define PREDICT_LIKELY(exp) __builtin_expect((exp), 1) ++/** Macro: Evaluates to <b>exp</b> and hints the compiler that the value ++ * of <b>exp</b> will probably be false. */ ++#define PREDICT_UNLIKELY(exp) __builtin_expect((exp), 0) ++#else ++#define ATTR_NORETURN ++#define ATTR_PURE ++#define ATTR_CONST ++#define ATTR_MALLOC ++#define ATTR_NORETURN ++#define ATTR_NONNULL(x) ++#define PREDICT_LIKELY(exp) (exp) ++#define PREDICT_UNLIKELY(exp) (exp) ++#endif ++ ++uint16_t get_uint16(const char *cp) ATTR_PURE ATTR_NONNULL((1)); ++uint32_t get_uint32(const char *cp) ATTR_PURE ATTR_NONNULL((1)); ++void set_uint16(char *cp, uint16_t v) ATTR_NONNULL((1)); ++void set_uint32(char *cp, uint32_t v) ATTR_NONNULL((1)); + + void set_log_options(int, char *, int); + void show_msg(int level, const char *, ...); +Index: dead_pool.h +=================================================================== +RCS file: /cvsroot/tork/torsocks/dead_pool.h,v +retrieving revision 1.2 +diff -p -U3 -r1.2 dead_pool.h +--- dead_pool.h 15 Jun 2008 10:02:53 -0000 1.2 ++++ dead_pool.h 18 Jun 2008 21:21:38 -0000 +@@ -35,6 +35,8 @@ int is_dead_address(dead_pool *pool, uin + char *get_pool_entry(dead_pool *pool, struct in_addr *addr); + int search_pool_for_name(dead_pool *pool, const char *name); + struct hostent *our_gethostbyname(dead_pool *pool, const char *name); ++struct hostent *our_gethostbyaddr(dead_pool *pool, const void *addr, ++ socklen_t len, int type); + int our_getaddrinfo(dead_pool *pool, const char *node, const char *service, + void *hints, void *res); + struct hostent *our_getipnodebyname(dead_pool *pool, const char *name, +Index: parser.h +=================================================================== +RCS file: /cvsroot/tork/torsocks/parser.h,v +retrieving revision 1.1.1.1 +diff -p -U3 -r1.1.1.1 parser.h +--- parser.h 15 Jun 2008 09:43:02 -0000 1.1.1.1 ++++ parser.h 18 Jun 2008 21:21:38 -0000 +@@ -35,7 +35,7 @@ struct parsedfile { + struct serverent *paths; + int tordns_enabled; + int tordns_failopen; +- int tordns_cache_size; ++ unsigned int tordns_cache_size; + struct netent *tordns_deadpool_range; + }; + +Index: tsocks.h +=================================================================== +RCS file: /cvsroot/tork/torsocks/tsocks.h,v +retrieving revision 1.1.1.1 +diff -p -U3 -r1.1.1.1 tsocks.h +--- tsocks.h 15 Jun 2008 09:43:01 -0000 1.1.1.1 ++++ tsocks.h 18 Jun 2008 21:21:38 -0000 +@@ -50,8 +50,8 @@ struct connreq { + int selectevents; + + /* Buffer for sending and receiving on the socket */ +- int datalen; +- int datadone; ++ unsigned int datalen; ++ unsigned int datadone; + char buffer[2048]; + + struct connreq *next; +Index: config.h.in +=================================================================== +RCS file: /cvsroot/tork/torsocks/config.h.in,v +retrieving revision 1.1.1.1 +diff -p -U3 -r1.1.1.1 config.h.in +--- config.h.in 15 Jun 2008 09:43:02 -0000 1.1.1.1 ++++ config.h.in 18 Jun 2008 21:21:38 -0000 +@@ -83,6 +83,9 @@ in inspectsocks */ + #undef GETIPNODEBYNAME_SIGNATURE + + ++/* Description */ ++#undef GETHOSTBYADDR_SIGNATURE ++ + /* Define to 1 if you have the <inttypes.h> header file. */ + #undef HAVE_INTTYPES_H + +Index: configure.in +=================================================================== +RCS file: /cvsroot/tork/torsocks/configure.in,v +retrieving revision 1.1.1.1 +diff -p -U3 -r1.1.1.1 configure.in +--- configure.in 15 Jun 2008 09:43:00 -0000 1.1.1.1 ++++ configure.in 18 Jun 2008 21:21:38 -0000 +@@ -384,6 +384,10 @@ dnl Emit signature for gethostbyname + PROTO="const char *name" + AC_DEFINE_UNQUOTED(GETHOSTBYNAME_SIGNATURE, [${PROTO}]) + ++dnl Emit signature for gethostbyaddr ++PROTO="const void *addr, socklen_t len, int type" ++AC_DEFINE_UNQUOTED(GETHOSTBYADDR_SIGNATURE, [${PROTO}], [Description]) ++ + dnl Emit signature for getaddrinfo + PROTO="const char *node, const char *service, void *hints, void *res" + AC_DEFINE_UNQUOTED(GETADDRINFO_SIGNATURE, [${PROTO}]) diff --git a/doc/patches/getpeername.patch b/doc/patches/getpeername.patch new file mode 100644 index 0000000..f66d133 --- /dev/null +++ b/doc/patches/getpeername.patch @@ -0,0 +1,350 @@ +diff -ur tsocks-1.8beta5.orig/acconfig.h tsocks-1.8beta5.clean/acconfig.h +--- tsocks-1.8beta5.orig/acconfig.h Sat May 18 06:59:38 2002 ++++ tsocks-1.8beta5.clean/acconfig.h Sat Mar 27 11:12:03 2004 +@@ -43,6 +43,9 @@ + /* Prototype and function header for close function */ + #undef CLOSE_SIGNATURE + ++/* Prototype and function header for getpeername function */ ++#undef GETPEERNAME_SIGNATURE ++ + /* Work out which function we have for conversion from string IPs to + numerical ones */ + #undef HAVE_INET_ADDR +diff -ur tsocks-1.8beta5.orig/config.h.in tsocks-1.8beta5.clean/config.h.in +--- tsocks-1.8beta5.orig/config.h.in Sat May 18 06:59:42 2002 ++++ tsocks-1.8beta5.clean/config.h.in Sat Mar 27 11:21:58 2004 +@@ -46,6 +46,9 @@ + /* Prototype and function header for close function */ + #undef CLOSE_SIGNATURE + ++/* Prototype and function header for close function */ ++#undef GETPEERNAME_SIGNATURE ++ + /* Work out which function we have for conversion from string IPs to + numerical ones */ + #undef HAVE_INET_ADDR +diff -ur tsocks-1.8beta5.orig/config.status tsocks-1.8beta5.clean/config.status +--- tsocks-1.8beta5.orig/config.status Sat Mar 27 11:25:17 2004 ++++ tsocks-1.8beta5.clean/config.status Sat Mar 27 11:22:01 2004 +@@ -2,9 +2,9 @@ + # Generated automatically by configure. + # Run this file to recreate the current configuration. + # This directory was configured as follows, +-# on host inky: ++# on host seppia: + # +-# ./configure --prefix=/usr --libdir=/usr/lib --mandir=/usr/share/man --with-conf=/etc/tsocks.conf --enable-socksdns --enable-hostnames ++# ./configure + # + # Compiler output produced by configure, useful for debugging + # configure, is in ./config.log if it exists. +@@ -14,8 +14,8 @@ + do + case "$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) +- echo "running ${CONFIG_SHELL-/bin/sh} ./configure --prefix=/usr --libdir=/usr/lib --mandir=/usr/share/man --with-conf=/etc/tsocks.conf --enable-socksdns --enable-hostnames --no-create --no-recursion" +- exec ${CONFIG_SHELL-/bin/sh} ./configure --prefix=/usr --libdir=/usr/lib --mandir=/usr/share/man --with-conf=/etc/tsocks.conf --enable-socksdns --enable-hostnames --no-create --no-recursion ;; ++ echo "running ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion" ++ exec ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "./config.status generated by autoconf version 2.13" + exit 0 ;; +@@ -53,11 +53,11 @@ + s%@sysconfdir@%${prefix}/etc%g + s%@sharedstatedir@%${prefix}/com%g + s%@localstatedir@%${prefix}/var%g +-s%@libdir@%/usr/lib%g ++s%@libdir@%/lib%g + s%@includedir@%${prefix}/include%g + s%@oldincludedir@%/usr/include%g + s%@infodir@%${prefix}/info%g +-s%@mandir@%/usr/share/man%g ++s%@mandir@%${prefix}/man%g + s%@host@%i686-pc-linux-gnu%g + s%@host_alias@%i686-pc-linux-gnu%g + s%@host_cpu@%i686%g +@@ -255,15 +255,15 @@ + mv conftest.out conftest.in + + cat > conftest.frag <<CEOF +-${ac_dA}USE_SOCKS_DNS${ac_dB}USE_SOCKS_DNS${ac_dC}1${ac_dD} +-${ac_uA}USE_SOCKS_DNS${ac_uB}USE_SOCKS_DNS${ac_uC}1${ac_uD} +-${ac_eA}USE_SOCKS_DNS${ac_eB}USE_SOCKS_DNS${ac_eC}1${ac_eD} + ${ac_dA}ALLOW_ENV_CONFIG${ac_dB}ALLOW_ENV_CONFIG${ac_dC}1${ac_dD} + ${ac_uA}ALLOW_ENV_CONFIG${ac_uB}ALLOW_ENV_CONFIG${ac_uC}1${ac_uD} + ${ac_eA}ALLOW_ENV_CONFIG${ac_eB}ALLOW_ENV_CONFIG${ac_eC}1${ac_eD} + ${ac_dA}ALLOW_MSG_OUTPUT${ac_dB}ALLOW_MSG_OUTPUT${ac_dC}1${ac_dD} + ${ac_uA}ALLOW_MSG_OUTPUT${ac_uB}ALLOW_MSG_OUTPUT${ac_uC}1${ac_uD} + ${ac_eA}ALLOW_MSG_OUTPUT${ac_eB}ALLOW_MSG_OUTPUT${ac_eC}1${ac_eD} ++${ac_dA}HOSTNAMES${ac_dB}HOSTNAMES${ac_dC}1${ac_dD} ++${ac_uA}HOSTNAMES${ac_uB}HOSTNAMES${ac_uC}1${ac_uD} ++${ac_eA}HOSTNAMES${ac_eB}HOSTNAMES${ac_eC}1${ac_eD} + ${ac_dA}SELECT_SIGNATURE${ac_dB}SELECT_SIGNATURE${ac_dC}int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout${ac_dD} + ${ac_uA}SELECT_SIGNATURE${ac_uB}SELECT_SIGNATURE${ac_uC}int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout${ac_uD} + ${ac_eA}SELECT_SIGNATURE${ac_eB}SELECT_SIGNATURE${ac_eC}int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout${ac_eD} +@@ -282,15 +282,18 @@ + ${ac_dA}CLOSE_SIGNATURE${ac_dB}CLOSE_SIGNATURE${ac_dC}int fd${ac_dD} + ${ac_uA}CLOSE_SIGNATURE${ac_uB}CLOSE_SIGNATURE${ac_uC}int fd${ac_uD} + ${ac_eA}CLOSE_SIGNATURE${ac_eB}CLOSE_SIGNATURE${ac_eC}int fd${ac_eD} +-${ac_dA}POLL_SIGNATURE${ac_dB}POLL_SIGNATURE${ac_dC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_dD} +-${ac_uA}POLL_SIGNATURE${ac_uB}POLL_SIGNATURE${ac_uC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_uD} +-${ac_eA}POLL_SIGNATURE${ac_eB}POLL_SIGNATURE${ac_eC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_eD} ++${ac_dA}GETPEERNAME_SIGNATURE${ac_dB}GETPEERNAME_SIGNATURE${ac_dC}int __fd, struct sockaddr * __name, socklen_t *__namelen${ac_dD} ++${ac_uA}GETPEERNAME_SIGNATURE${ac_uB}GETPEERNAME_SIGNATURE${ac_uC}int __fd, struct sockaddr * __name, socklen_t *__namelen${ac_uD} ++${ac_eA}GETPEERNAME_SIGNATURE${ac_eB}GETPEERNAME_SIGNATURE${ac_eC}int __fd, struct sockaddr * __name, socklen_t *__namelen${ac_eD} + CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in + + cat > conftest.frag <<CEOF ++${ac_dA}POLL_SIGNATURE${ac_dB}POLL_SIGNATURE${ac_dC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_dD} ++${ac_uA}POLL_SIGNATURE${ac_uB}POLL_SIGNATURE${ac_uC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_uD} ++${ac_eA}POLL_SIGNATURE${ac_eB}POLL_SIGNATURE${ac_eC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_eD} + s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% + CEOF + sed -f conftest.frag conftest.in > conftest.out +diff -ur tsocks-1.8beta5.orig/configure tsocks-1.8beta5.clean/configure +--- tsocks-1.8beta5.orig/configure Tue Jul 16 00:51:08 2002 ++++ tsocks-1.8beta5.clean/configure Sat Mar 27 11:12:05 2004 +@@ -2225,14 +2225,60 @@ + EOF + + ++ ++echo $ac_n "checking for correct getpeername prototype""... $ac_c" 1>&6 ++echo "configure:2231: checking for correct getpeername prototype" >&5 ++PROTO= ++PROTO1='int __fd, const struct sockaddr * __name, int *__namelen' ++PROTO2='int __fd, const struct sockaddr_in * __name, socklen_t *__namelen' ++PROTO3='int __fd, struct sockaddr * __name, socklen_t *__namelen' ++PROTO4='int __fd, const struct sockaddr * __name, socklen_t *__namelen' ++for testproto in "${PROTO1}" \ ++ "${PROTO2}" \ ++ "${PROTO3}" \ ++ "${PROTO4}" ++do ++ if test "${PROTO}" = ""; then ++ cat > conftest.$ac_ext <<EOF ++#line 2244 "configure" ++#include "confdefs.h" ++ ++ #include <sys/socket.h> ++ int getpeername($testproto); ++ ++int main() { ++ ++; return 0; } ++EOF ++if { (eval echo configure:2254: "$ac_compile") 1>&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ PROTO="$testproto"; ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++fi ++rm -f conftest* ++ fi ++done ++if test "${PROTO}" = ""; then ++ { echo "configure: error: "no match found!"" 1>&2; exit 1; } ++fi ++echo "$ac_t""getpeername(${PROTO})" 1>&6 ++cat >> confdefs.h <<EOF ++#define GETPEERNAME_SIGNATURE ${PROTO} ++EOF ++ ++ ++ ++ + echo $ac_n "checking for correct poll prototype""... $ac_c" 1>&6 +-echo "configure:2230: checking for correct poll prototype" >&5 ++echo "configure:2276: checking for correct poll prototype" >&5 + PROTO= + for testproto in 'struct pollfd *ufds, unsigned long nfds, int timeout' + do + if test "${PROTO}" = ""; then + cat > conftest.$ac_ext <<EOF +-#line 2236 "configure" ++#line 2282 "configure" + #include "confdefs.h" + + #include <sys/poll.h> +@@ -2242,7 +2288,7 @@ + + ; return 0; } + EOF +-if { (eval echo configure:2246: "$ac_compile") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:2292: "$ac_compile") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + PROTO="$testproto"; + else +diff -ur tsocks-1.8beta5.orig/configure.in tsocks-1.8beta5.clean/configure.in +--- tsocks-1.8beta5.orig/configure.in Tue Jul 16 00:51:03 2002 ++++ tsocks-1.8beta5.clean/configure.in Sat Mar 27 11:11:02 2004 +@@ -309,6 +309,34 @@ + AC_MSG_RESULT([close(${PROTO})]) + AC_DEFINE_UNQUOTED(CLOSE_SIGNATURE, [${PROTO}]) + ++ ++dnl Find the correct getpeername prototype on this machine ++AC_MSG_CHECKING(for correct getpeername prototype) ++PROTO= ++PROTO1='int __fd, const struct sockaddr * __name, int *__namelen' ++PROTO2='int __fd, const struct sockaddr_in * __name, socklen_t *__namelen' ++PROTO3='int __fd, struct sockaddr * __name, socklen_t *__namelen' ++PROTO4='int __fd, const struct sockaddr * __name, socklen_t *__namelen' ++for testproto in "${PROTO1}" \ ++ "${PROTO2}" \ ++ "${PROTO3}" \ ++ "${PROTO4}" ++do ++ if test "${PROTO}" = ""; then ++ AC_TRY_COMPILE([ ++ #include <sys/socket.h> ++ int getpeername($testproto); ++ ],,[PROTO="$testproto";],) ++ fi ++done ++if test "${PROTO}" = ""; then ++ AC_MSG_ERROR("no match found!") ++fi ++AC_MSG_RESULT([getpeername(${PROTO})]) ++AC_DEFINE_UNQUOTED(GETPEERNAME_SIGNATURE, [${PROTO}]) ++ ++ ++ + dnl Find the correct poll prototype on this machine + AC_MSG_CHECKING(for correct poll prototype) + PROTO= +Only in tsocks-1.8beta5.clean: ld-pre +Only in tsocks-1.8beta5.clean: sel +diff -ur tsocks-1.8beta5.orig/tsocks.c tsocks-1.8beta5.clean/tsocks.c +--- tsocks-1.8beta5.orig/tsocks.c Tue Jul 16 00:50:52 2002 ++++ tsocks-1.8beta5.clean/tsocks.c Sat Mar 27 13:17:58 2004 +@@ -62,6 +62,7 @@ + static int (*realselect)(SELECT_SIGNATURE); + static int (*realpoll)(POLL_SIGNATURE); + static int (*realclose)(CLOSE_SIGNATURE); ++static int (*realgetpeername)(GETPEERNAME_SIGNATURE); + static struct parsedfile *config; + static struct connreq *requests = NULL; + static int suid = 0; +@@ -73,6 +74,7 @@ + int select(SELECT_SIGNATURE); + int poll(POLL_SIGNATURE); + int close(CLOSE_SIGNATURE); ++int getpeername(GETPEERNAME_SIGNATURE); + #ifdef USE_SOCKS_DNS + int res_init(void); + #endif +@@ -109,14 +111,15 @@ + /* most programs that are run won't use our services, so */ + /* we do our general initialization on first call */ + +- /* Determine the logging level */ +- suid = (getuid() != geteuid()); ++ /* Determine the logging level */ ++ suid = (getuid() != geteuid()); + + #ifndef USE_OLD_DLSYM + realconnect = dlsym(RTLD_NEXT, "connect"); + realselect = dlsym(RTLD_NEXT, "select"); + realpoll = dlsym(RTLD_NEXT, "poll"); + realclose = dlsym(RTLD_NEXT, "close"); ++ realgetpeername = dlsym(RTLD_NEXT, "getpeername"); + #ifdef USE_SOCKS_DNS + realresinit = dlsym(RTLD_NEXT, "res_init"); + #endif +@@ -125,14 +128,15 @@ + realconnect = dlsym(lib, "connect"); + realselect = dlsym(lib, "select"); + realpoll = dlsym(lib, "poll"); ++ realgetpeername = dlsym(lib, "getpeername"); + #ifdef USE_SOCKS_DNS + realresinit = dlsym(lib, "res_init"); + #endif +- dlclose(lib); ++ dlclose(lib); + + lib = dlopen(LIBC, RTLD_LAZY); +- realclose = dlsym(lib, "close"); +- dlclose(lib); ++ realclose = dlsym(lib, "close"); ++ dlclose(lib); + #endif + } + +@@ -348,8 +352,10 @@ + + /* If we're not currently managing any requests we can just + * leave here */ +- if (!requests) ++ if (!requests) { ++ show_msg(MSGDEBUG, "No requests waiting, calling real select\n"); + return(realselect(n, readfds, writefds, exceptfds, timeout)); ++ } + + get_environment(); + +@@ -703,6 +709,50 @@ + return(rc); + } + ++/* If we are not done setting up the connection yet, return ++ * -1 and ENOTCONN, otherwise call getpeername ++ * ++ * This is necessary since some applications, when using non-blocking connect, ++ * (like ircII) use getpeername() to find out if they are connected already. ++ * ++ * This results in races sometimes, where the client sends data to the socket ++ * before we are done with the socks connection setup. Another solution would ++ * be to intercept send(). ++ * ++ * This could be extended to actually set the peername to the peer the ++ * client application has requested, but not for now. ++ * ++ * PP, Sat, 27 Mar 2004 11:30:23 +0100 ++ */ ++int getpeername(GETPEERNAME_SIGNATURE) { ++ struct connreq *conn; ++ int rc; ++ ++ if (realgetpeername == NULL) { ++ show_msg(MSGERR, "Unresolved symbol: getpeername\n"); ++ return(-1); ++ } ++ ++ show_msg(MSGDEBUG, "Call to getpeername for fd %d\n", __fd); ++ ++ ++ rc = realgetpeername(__fd, __name, __namelen); ++ if (rc == -1) ++ return rc; ++ ++ /* Are we handling this connect? */ ++ if ((conn = find_socks_request(__fd, 1))) { ++ /* While we are at it, we might was well try to do something useful */ ++ handle_request(conn); ++ ++ if (conn->state != DONE) { ++ errno = ENOTCONN; ++ return(-1); ++ } ++ } ++ return rc; ++} ++ + static struct connreq *new_socks_request(int sockid, struct sockaddr_in *connaddr, + struct sockaddr_in *serveraddr, + struct serverent *path) { +@@ -852,7 +902,7 @@ + sizeof(conn->serveraddr)); + + show_msg(MSGDEBUG, "Connect returned %d, errno is %d\n", rc, errno); +- if (rc) { ++ if (rc) { + if (errno != EINPROGRESS) { + show_msg(MSGERR, "Error %d attempting to connect to SOCKS " + "server (%s)\n", errno, strerror(errno)); diff --git a/doc/patches/infiniteloop.patch b/doc/patches/infiniteloop.patch new file mode 100644 index 0000000..4b0deb9 --- /dev/null +++ b/doc/patches/infiniteloop.patch @@ -0,0 +1,20 @@ +--- tsocks-1.8.orig/tsocks.c 2002-03-13 14:02:04.000000000 +0100 ++++ tsocks-1.8/tsocks.c 2004-03-20 11:30:57.000000000 +0100 +@@ -951,14 +951,18 @@ + show_msg(MSGDEBUG, "Reading from server (expecting %d bytes)\n", conn->datalen); + while ((rc == 0) && (conn->datadone != conn->datalen)) { + rc = recv(conn->sockid, conn->buffer + conn->datadone, + conn->datalen - conn->datadone, 0); + if (rc > 0) { + conn->datadone += rc; + rc = 0; ++ } else if (rc == 0) { ++ show_msg(MSGDEBUG, "Peer has shutdown but we only read %d of %d bytes.\n", ++ conn->datadone, conn->datalen); ++ rc = ENOTCONN; /* ENOTCONN seems like the most fitting error message */ + } else { + if (errno != EWOULDBLOCK) + show_msg(MSGDEBUG, "Read failed, %s\n", strerror(errno)); + rc = errno; + } + } diff --git a/doc/patches/localaddresses.patch b/doc/patches/localaddresses.patch new file mode 100644 index 0000000..d69c7e8 --- /dev/null +++ b/doc/patches/localaddresses.patch @@ -0,0 +1,15 @@ +--- parser.c.old 2006-04-01 17:54:46.687832056 -0500 ++++ parser.c 2006-04-01 17:55:47.552579208 -0500 +@@ -74,8 +74,10 @@ + } + fclose(conf); + +- /* Always add the 127.0.0.1/255.0.0.0 subnet to local */ +- handle_local(config, 0, "127.0.0.0/255.0.0.0"); ++ if (!config->localnets) { ++ /* Use 127.0.0.1/255.0.0.0 by default */ ++ handle_local(config, 0, "127.0.0.0/255.0.0.0"); ++ } + + /* Check default server */ + check_server(&(config->defaultserver)); diff --git a/doc/patches/tordns.patch b/doc/patches/tordns.patch new file mode 100644 index 0000000..bf8d79b --- /dev/null +++ b/doc/patches/tordns.patch @@ -0,0 +1,11004 @@ +diff -rN -U 5 tsocks-1.8/acconfig.h tsocks/acconfig.h +--- tsocks-1.8/acconfig.h 2002-05-18 16:59:38.000000000 +1200 ++++ tsocks/acconfig.h 2005-10-01 17:22:09.000000000 +1200 +@@ -51,10 +51,13 @@ + /* We use strsep which isn't on all machines, but we provide our own + definition of it for those which don't have it, this causes us to define + our version */ + #undef DEFINE_STRSEP + ++/* Should we resolve DNS entries in a way which works well with tor? */ ++#undef USE_TOR_DNS ++ + /* Allow the use of DNS names in the socks configuration file for socks + servers. This doesn't work if socksified DNS is enabled for obvious + reasons, it also introduces overhead, but people seem to want it */ + #define HOSTNAMES 0 + +@@ -62,5 +65,16 @@ + in inspectsocks */ + #undef HAVE_GETHOSTBYNAME + + /* Location of configuration file (typically /etc/tsocks.conf) */ + #undef CONF_FILE ++ ++/* Define to indicate the correct signature for gethostbyname_r */ ++#undef HAVE_FUNC_GETHOSTBYNAME_R_6 ++#undef HAVE_FUNC_GETHOSTBYNAME_R_5 ++#undef HAVE_FUNC_GETHOSTBYNAME_R_3 ++ ++/* Signatures for name resolution stuff */ ++#undef GETHOSTBYNAME_SIGNATURE ++#undef GETADDRINFO_SIGNATURE ++#undef GETIPNODEBYNAME_SIGNATURE ++ +diff -rN -U 5 tsocks-1.8/aclocal/ac_c_gethostbyname_r.m4 tsocks/aclocal/ac_c_gethostbyname_r.m4 +--- tsocks-1.8/aclocal/ac_c_gethostbyname_r.m4 1970-01-01 12:00:00.000000000 +1200 ++++ tsocks/aclocal/ac_c_gethostbyname_r.m4 2005-09-27 05:55:58.000000000 +1200 +@@ -0,0 +1,132 @@ ++dnl http://autoconf-archive.cryp.to/ax_func_which_gethostbyname_r.html ++ ++AC_DEFUN([AX_FUNC_WHICH_GETHOSTBYNAME_R], [ ++ ++ AC_LANG_PUSH(C) ++ AC_MSG_CHECKING([how many arguments gethostbyname_r() takes]) ++ ++ AC_CACHE_VAL(ac_cv_func_which_gethostbyname_r, [ ++ ++################################################################ ++ ++ac_cv_func_which_gethostbyname_r=unknown ++ ++# ++# ONE ARGUMENT (sanity check) ++# ++ ++# This should fail, as there is no variant of gethostbyname_r() that takes ++# a single argument. If it actually compiles, then we can assume that ++# netdb.h is not declaring the function, and the compiler is thereby ++# assuming an implicit prototype. In which case, we're out of luck. ++# ++AC_COMPILE_IFELSE( ++ AC_LANG_PROGRAM( ++ [[#include <netdb.h>]], ++ [[ ++ char *name = "www.gnu.org"; ++ (void)gethostbyname_r(name) /* ; */ ++ ]]), ++ ac_cv_func_which_gethostbyname_r=no) ++ ++# ++# SIX ARGUMENTS ++# (e.g. Linux) ++# ++ ++if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then ++ ++AC_COMPILE_IFELSE( ++ AC_LANG_PROGRAM( ++ [[#include <netdb.h>]], ++ [[ ++ char *name = "www.gnu.org"; ++ struct hostent ret, *retp; ++ char buf@<:@1024@:>@; ++ int buflen = 1024; ++ int my_h_errno; ++ (void)gethostbyname_r(name, &ret, buf, buflen, &retp, &my_h_errno) /* ; */ ++ ]]), ++ ac_cv_func_which_gethostbyname_r=six) ++ ++fi ++ ++# ++# FIVE ARGUMENTS ++# (e.g. Solaris) ++# ++ ++if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then ++ ++AC_COMPILE_IFELSE( ++ AC_LANG_PROGRAM( ++ [[#include <netdb.h>]], ++ [[ ++ char *name = "www.gnu.org"; ++ struct hostent ret; ++ char buf@<:@1024@:>@; ++ int buflen = 1024; ++ int my_h_errno; ++ (void)gethostbyname_r(name, &ret, buf, buflen, &my_h_errno) /* ; */ ++ ]]), ++ ac_cv_func_which_gethostbyname_r=five) ++ ++fi ++ ++# ++# THREE ARGUMENTS ++# (e.g. AIX, HP-UX, Tru64) ++# ++ ++if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then ++ ++AC_COMPILE_IFELSE( ++ AC_LANG_PROGRAM( ++ [[#include <netdb.h>]], ++ [[ ++ char *name = "www.gnu.org"; ++ struct hostent ret; ++ struct hostent_data data; ++ (void)gethostbyname_r(name, &ret, &data) /* ; */ ++ ]]), ++ ac_cv_func_which_gethostbyname_r=three) ++ ++fi ++ ++################################################################ ++ ++]) dnl end AC_CACHE_VAL ++ ++case "$ac_cv_func_which_gethostbyname_r" in ++ three) ++ AC_MSG_RESULT([three]) ++ AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_3) ++ ;; ++ ++ five) ++ AC_MSG_RESULT([five]) ++ AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_5) ++ ;; ++ ++ six) ++ AC_MSG_RESULT([six]) ++ AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_6) ++ ;; ++ ++ no) ++ AC_MSG_RESULT([cannot find function declaration in netdb.h]) ++ ;; ++ ++ unknown) ++ AC_MSG_RESULT([can't tell]) ++ ;; ++ ++ *) ++ AC_MSG_ERROR([internal error]) ++ ;; ++esac ++ ++AC_LANG_POP(C) ++ ++]) dnl end AC_DEFUN ++ +diff -rN -U 5 tsocks-1.8/autogen.sh tsocks/autogen.sh +--- tsocks-1.8/autogen.sh 1970-01-01 12:00:00.000000000 +1200 ++++ tsocks/autogen.sh 2005-10-01 17:54:45.000000000 +1200 +@@ -0,0 +1,6 @@ ++#!/bin/sh ++ ++aclocal -I aclocal ++autoconf ++autoheader ++ +diff -rN -U 5 tsocks-1.8/ChangeLog tsocks/ChangeLog +--- tsocks-1.8/ChangeLog 2002-05-18 17:22:26.000000000 +1200 ++++ tsocks/ChangeLog 2005-10-02 16:03:18.000000000 +1300 +@@ -1,5 +1,9 @@ ++version 1.80tordns - 2005.10.4 bls@totalinfosecurity.com ++ Intercept gethostbyname() and friends, added --tordns ++ option for better name resolution with Tor. ++ + version 1.80Beta5 - 2002.?.?? delius@progsoc.uts.edu.au + Intercept close() to fix problems with tsocks and + kmail + Add FAQ to distribution + +diff -rN -U 5 tsocks-1.8/common.c tsocks/common.c +--- tsocks-1.8/common.c 2002-07-16 10:35:06.000000000 +1200 ++++ tsocks/common.c 2005-10-01 21:37:00.000000000 +1200 +@@ -76,10 +76,31 @@ + } + + logstamp = timestamp; + } + ++/* Count the bits in a netmask. This is a little bit buggy; it assumes ++ all the zeroes are on the right... */ ++ ++int count_netmask_bits(uint32_t mask) ++{ ++ int i; ++ int nbits = 0; ++ ++ for(i=0; i<32; i++) { ++ if((mask >> i) & 1) { ++ nbits++; ++ } ++ } ++ mask = ~mask; ++ mask = ntohl(mask); ++ if(mask & (mask+1)) { ++ return -1; /* Noncontiguous */ ++ } ++ return nbits; ++} ++ + void show_msg(int level, char *fmt, ...) { + va_list ap; + int saveerr; + extern char *progname; + char timestring[20]; +@@ -105,11 +126,11 @@ + strftime(timestring, sizeof(timestring), "%H:%M:%S", + localtime(×tamp)); + fprintf(logfile, "%s ", timestring); + } + +- fputs(progname, logfile); ++ // fputs(progname, logfile); + + if (logstamp) { + fprintf(logfile, "(%d)", getpid()); + } + +diff -rN -U 5 tsocks-1.8/common.h tsocks/common.h +--- tsocks-1.8/common.h 2002-07-16 10:27:00.000000000 +1200 ++++ tsocks/common.h 2005-09-27 10:48:20.000000000 +1200 +@@ -1,9 +1,10 @@ + /* Common functions provided in common.c */ + + void set_log_options(int, char *, int); + void show_msg(int level, char *, ...); ++int count_netmask_bits(uint32_t mask); + unsigned int resolve_ip(char *, int, int); + + #define MSGNONE -1 + #define MSGERR 0 + #define MSGWARN 1 +diff -rN -U 5 tsocks-1.8/config.h.in tsocks/config.h.in +--- tsocks-1.8/config.h.in 2002-05-18 16:59:42.000000000 +1200 ++++ tsocks/config.h.in 2005-10-01 17:23:20.000000000 +1200 +@@ -1,9 +1,7 @@ +-/* config.h.in. Generated automatically from configure.in by autoheader. */ +- +-/* Define if you have the ANSI C header files. */ +-#undef STDC_HEADERS ++/* config.h.in. Generated from configure.in by autoheader. */ ++/* accconfig.h -- `autoheader' will generate config.h.in for tsocks . */ + + /* Allow tsocks to generate messages to stderr when errors are + encountered, this is really important and should only be disabled if + you're REALLY sure. It can also be turned off at run time, see the man + page for details */ +@@ -49,10 +47,18 @@ + /* Work out which function we have for conversion from string IPs to + numerical ones */ + #undef HAVE_INET_ADDR + #undef HAVE_INET_ATON + ++/* We use strsep which isn't on all machines, but we provide our own ++definition of it for those which don't have it, this causes us to define ++our version */ ++#undef DEFINE_STRSEP ++ ++/* Should we resolve DNS entries in a way which works well with tor? */ ++#undef USE_TOR_DNS ++ + /* Allow the use of DNS names in the socks configuration file for socks + servers. This doesn't work if socksified DNS is enabled for obvious + reasons, it also introduces overhead, but people seem to want it */ + #define HOSTNAMES 0 + +@@ -61,28 +67,90 @@ + #undef HAVE_GETHOSTBYNAME + + /* Location of configuration file (typically /etc/tsocks.conf) */ + #undef CONF_FILE + +-/* Define if you have the strcspn function. */ ++/* Define to indicate the correct signature for gethostbyname_r */ ++#undef HAVE_FUNC_GETHOSTBYNAME_R_6 ++#undef HAVE_FUNC_GETHOSTBYNAME_R_5 ++#undef HAVE_FUNC_GETHOSTBYNAME_R_3 ++ ++/* Signatures for name resolution stuff */ ++#undef GETHOSTBYNAME_SIGNATURE ++#undef GETADDRINFO_SIGNATURE ++#undef GETIPNODEBYNAME_SIGNATURE ++ ++ ++/* Define to 1 if you have the <inttypes.h> header file. */ ++#undef HAVE_INTTYPES_H ++ ++/* Define to 1 if you have the `dl' library (-ldl). */ ++#undef HAVE_LIBDL ++ ++/* Define to 1 if you have the `socket' library (-lsocket). */ ++#undef HAVE_LIBSOCKET ++ ++/* Define to 1 if you have the <memory.h> header file. */ ++#undef HAVE_MEMORY_H ++ ++/* Define to 1 if you have the `mmap' function. */ ++#undef HAVE_MMAP ++ ++/* 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 `strcspn' function. */ + #undef HAVE_STRCSPN + +-/* Define if you have the strdup function. */ ++/* 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 strspn 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 `strncasecmp' function. */ ++#undef HAVE_STRNCASECMP ++ ++/* Define to 1 if you have the `strspn' function. */ + #undef HAVE_STRSPN + +-/* Define if you have the strtol function. */ ++/* Define to 1 if you have the `strtol' function. */ + #undef HAVE_STRTOL + +-/* Define if you have the <unistd.h> header file. */ ++/* 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/types.h> header file. */ ++#undef HAVE_SYS_TYPES_H ++ ++/* Define to 1 if you have the <unistd.h> header file. */ + #undef HAVE_UNISTD_H + +-/* Define if you have the dl library (-ldl). */ +-#undef HAVE_LIBDL ++/* Define to the address where bug reports for this package should be sent. */ ++#undef PACKAGE_BUGREPORT + +-/* Define if you have the socket library (-lsocket). */ +-#undef HAVE_LIBSOCKET ++/* Define to the full name of this package. */ ++#undef PACKAGE_NAME ++ ++/* Define to the full name and version of this package. */ ++#undef PACKAGE_STRING ++ ++/* Define to the one symbol short name of this package. */ ++#undef PACKAGE_TARNAME ++ ++/* Define to the version of this package. */ ++#undef PACKAGE_VERSION ++ ++/* Define to 1 if you have the ANSI C header files. */ ++#undef STDC_HEADERS +diff -rN -U 5 tsocks-1.8/config.status tsocks/config.status +--- tsocks-1.8/config.status 2002-07-16 10:51:14.000000000 +1200 ++++ tsocks/config.status 1970-01-01 12:00:00.000000000 +1200 +@@ -1,312 +0,0 @@ +-#! /bin/sh +-# Generated automatically by configure. +-# Run this file to recreate the current configuration. +-# This directory was configured as follows, +-# on host cardini.homenet: +-# +-# ./configure +-# +-# Compiler output produced by configure, useful for debugging +-# configure, is in ./config.log if it exists. +- +-ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]" +-for ac_option +-do +- case "$ac_option" in +- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) +- echo "running ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion" +- exec ${CONFIG_SHELL-/bin/sh} ./configure --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 +-done +- +-ac_given_srcdir=. +-ac_given_INSTALL="/usr/bin/install -c" +- +-trap 'rm -fr Makefile config.h conftest*; exit 1' 1 2 15 +- +-# 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 +-/^[ ]*VPATH[ ]*=[^:]*$/d +- +-s%@SHELL@%/bin/sh%g +-s%@CFLAGS@%-g -O2 -Wall%g +-s%@CPPFLAGS@%%g +-s%@CXXFLAGS@%%g +-s%@FFLAGS@%%g +-s%@DEFS@%-DHAVE_CONFIG_H%g +-s%@LDFLAGS@%%g +-s%@LIBS@% -lc%g +-s%@exec_prefix@%${prefix}%g +-s%@prefix@%/usr%g +-s%@program_transform_name@%s,x,x,%g +-s%@bindir@%${exec_prefix}/bin%g +-s%@sbindir@%${exec_prefix}/sbin%g +-s%@libexecdir@%${exec_prefix}/libexec%g +-s%@datadir@%${prefix}/share%g +-s%@sysconfdir@%${prefix}/etc%g +-s%@sharedstatedir@%${prefix}/com%g +-s%@localstatedir@%${prefix}/var%g +-s%@libdir@%/lib%g +-s%@includedir@%${prefix}/include%g +-s%@oldincludedir@%/usr/include%g +-s%@infodir@%${prefix}/info%g +-s%@mandir@%${prefix}/man%g +-s%@host@%i586-pc-linux-gnu%g +-s%@host_alias@%i586-pc-linux-gnu%g +-s%@host_cpu@%i586%g +-s%@host_vendor@%pc%g +-s%@host_os@%linux-gnu%g +-s%@CC@%gcc%g +-s%@INSTALL_PROGRAM@%${INSTALL}%g +-s%@INSTALL_SCRIPT@%${INSTALL_PROGRAM}%g +-s%@INSTALL_DATA@%${INSTALL} -m 644%g +-s%@LN_S@%ln -s%g +-s%@CPP@%gcc -E%g +-s%@FIND@%%g +-s%@TAIL@%%g +-s%@SPECIALLIBS@%-ldl %g +- +-CEOF +- +-# 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 +- else +- sed "${ac_end}q" conftest.subs > conftest.s$ac_file +- fi +- if test ! -s conftest.s$ac_file; then +- ac_more_lines=false +- rm -f conftest.s$ac_file +- 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` +- fi +-done +-if test -z "$ac_sed_cmds"; then +- ac_sed_cmds=cat +-fi +- +-CONFIG_FILES=${CONFIG_FILES-"Makefile"} +-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" ;; +- esac +- +- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. +- +- # 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'` +- else +- ac_dir_suffix= ac_dots= +- fi +- +- 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 +- +- case "$ac_given_INSTALL" in +- [/$]*) INSTALL="$ac_given_INSTALL" ;; +- *) INSTALL="$ac_dots$ac_given_INSTALL" ;; +- esac +- +- 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= ;; +- 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 +- CONFIG_HEADERS="config.h" +-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" ;; +- esac +- +- 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 +- +- cat > conftest.frag <<CEOF +-${ac_dA}CONF_FILE${ac_dB}CONF_FILE${ac_dC}"/etc/tsocks.conf"${ac_dD} +-${ac_uA}CONF_FILE${ac_uB}CONF_FILE${ac_uC}"/etc/tsocks.conf"${ac_uD} +-${ac_eA}CONF_FILE${ac_eB}CONF_FILE${ac_eC}"/etc/tsocks.conf"${ac_eD} +-${ac_dA}STDC_HEADERS${ac_dB}STDC_HEADERS${ac_dC}1${ac_dD} +-${ac_uA}STDC_HEADERS${ac_uB}STDC_HEADERS${ac_uC}1${ac_uD} +-${ac_eA}STDC_HEADERS${ac_eB}STDC_HEADERS${ac_eC}1${ac_eD} +-${ac_dA}HAVE_UNISTD_H${ac_dB}HAVE_UNISTD_H${ac_dC}1${ac_dD} +-${ac_uA}HAVE_UNISTD_H${ac_uB}HAVE_UNISTD_H${ac_uC}1${ac_uD} +-${ac_eA}HAVE_UNISTD_H${ac_eB}HAVE_UNISTD_H${ac_eC}1${ac_eD} +-${ac_dA}HAVE_STRCSPN${ac_dB}HAVE_STRCSPN${ac_dC}1${ac_dD} +-${ac_uA}HAVE_STRCSPN${ac_uB}HAVE_STRCSPN${ac_uC}1${ac_uD} +-${ac_eA}HAVE_STRCSPN${ac_eB}HAVE_STRCSPN${ac_eC}1${ac_eD} +-CEOF +- sed -f conftest.frag conftest.in > conftest.out +- rm -f conftest.in +- mv conftest.out conftest.in +- +- cat > conftest.frag <<CEOF +-${ac_dA}HAVE_STRDUP${ac_dB}HAVE_STRDUP${ac_dC}1${ac_dD} +-${ac_uA}HAVE_STRDUP${ac_uB}HAVE_STRDUP${ac_uC}1${ac_uD} +-${ac_eA}HAVE_STRDUP${ac_eB}HAVE_STRDUP${ac_eC}1${ac_eD} +-${ac_dA}HAVE_STRERROR${ac_dB}HAVE_STRERROR${ac_dC}1${ac_dD} +-${ac_uA}HAVE_STRERROR${ac_uB}HAVE_STRERROR${ac_uC}1${ac_uD} +-${ac_eA}HAVE_STRERROR${ac_eB}HAVE_STRERROR${ac_eC}1${ac_eD} +-${ac_dA}HAVE_STRSPN${ac_dB}HAVE_STRSPN${ac_dC}1${ac_dD} +-${ac_uA}HAVE_STRSPN${ac_uB}HAVE_STRSPN${ac_uC}1${ac_uD} +-${ac_eA}HAVE_STRSPN${ac_eB}HAVE_STRSPN${ac_eC}1${ac_eD} +-${ac_dA}HAVE_STRTOL${ac_dB}HAVE_STRTOL${ac_dC}1${ac_dD} +-${ac_uA}HAVE_STRTOL${ac_uB}HAVE_STRTOL${ac_uC}1${ac_uD} +-${ac_eA}HAVE_STRTOL${ac_eB}HAVE_STRTOL${ac_eC}1${ac_eD} +-CEOF +- sed -f conftest.frag conftest.in > conftest.out +- rm -f conftest.in +- mv conftest.out conftest.in +- +- cat > conftest.frag <<CEOF +-${ac_dA}HAVE_INET_ATON${ac_dB}HAVE_INET_ATON${ac_dC}1${ac_dD} +-${ac_uA}HAVE_INET_ATON${ac_uB}HAVE_INET_ATON${ac_uC}1${ac_uD} +-${ac_eA}HAVE_INET_ATON${ac_eB}HAVE_INET_ATON${ac_eC}1${ac_eD} +-${ac_dA}HAVE_GETHOSTBYNAME${ac_dB}HAVE_GETHOSTBYNAME${ac_dC}1${ac_dD} +-${ac_uA}HAVE_GETHOSTBYNAME${ac_uB}HAVE_GETHOSTBYNAME${ac_uC}1${ac_uD} +-${ac_eA}HAVE_GETHOSTBYNAME${ac_eB}HAVE_GETHOSTBYNAME${ac_eC}1${ac_eD} +-${ac_dA}HAVE_LIBDL${ac_dB}HAVE_LIBDL${ac_dC}1${ac_dD} +-${ac_uA}HAVE_LIBDL${ac_uB}HAVE_LIBDL${ac_uC}1${ac_uD} +-${ac_eA}HAVE_LIBDL${ac_eB}HAVE_LIBDL${ac_eC}1${ac_eD} +-${ac_dA}ALLOW_ENV_CONFIG${ac_dB}ALLOW_ENV_CONFIG${ac_dC}1${ac_dD} +-${ac_uA}ALLOW_ENV_CONFIG${ac_uB}ALLOW_ENV_CONFIG${ac_uC}1${ac_uD} +-${ac_eA}ALLOW_ENV_CONFIG${ac_eB}ALLOW_ENV_CONFIG${ac_eC}1${ac_eD} +-CEOF +- sed -f conftest.frag conftest.in > conftest.out +- rm -f conftest.in +- mv conftest.out conftest.in +- +- cat > conftest.frag <<CEOF +-${ac_dA}ALLOW_MSG_OUTPUT${ac_dB}ALLOW_MSG_OUTPUT${ac_dC}1${ac_dD} +-${ac_uA}ALLOW_MSG_OUTPUT${ac_uB}ALLOW_MSG_OUTPUT${ac_uC}1${ac_uD} +-${ac_eA}ALLOW_MSG_OUTPUT${ac_eB}ALLOW_MSG_OUTPUT${ac_eC}1${ac_eD} +-${ac_dA}HOSTNAMES${ac_dB}HOSTNAMES${ac_dC}1${ac_dD} +-${ac_uA}HOSTNAMES${ac_uB}HOSTNAMES${ac_uC}1${ac_uD} +-${ac_eA}HOSTNAMES${ac_eB}HOSTNAMES${ac_eC}1${ac_eD} +-${ac_dA}SELECT_SIGNATURE${ac_dB}SELECT_SIGNATURE${ac_dC}int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout${ac_dD} +-${ac_uA}SELECT_SIGNATURE${ac_uB}SELECT_SIGNATURE${ac_uC}int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout${ac_uD} +-${ac_eA}SELECT_SIGNATURE${ac_eB}SELECT_SIGNATURE${ac_eC}int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout${ac_eD} +-${ac_dA}CONNECT_SIGNATURE${ac_dB}CONNECT_SIGNATURE${ac_dC}int __fd, const struct sockaddr_in * __addr, socklen_t __len${ac_dD} +-${ac_uA}CONNECT_SIGNATURE${ac_uB}CONNECT_SIGNATURE${ac_uC}int __fd, const struct sockaddr_in * __addr, socklen_t __len${ac_uD} +-${ac_eA}CONNECT_SIGNATURE${ac_eB}CONNECT_SIGNATURE${ac_eC}int __fd, const struct sockaddr_in * __addr, socklen_t __len${ac_eD} +-CEOF +- sed -f conftest.frag conftest.in > conftest.out +- rm -f conftest.in +- mv conftest.out conftest.in +- +- cat > conftest.frag <<CEOF +-${ac_dA}CONNECT_SOCKARG${ac_dB}CONNECT_SOCKARG${ac_dC}struct sockaddr_in *${ac_dD} +-${ac_uA}CONNECT_SOCKARG${ac_uB}CONNECT_SOCKARG${ac_uC}struct sockaddr_in *${ac_uD} +-${ac_eA}CONNECT_SOCKARG${ac_eB}CONNECT_SOCKARG${ac_eC}struct sockaddr_in *${ac_eD} +-${ac_dA}CLOSE_SIGNATURE${ac_dB}CLOSE_SIGNATURE${ac_dC}int fd${ac_dD} +-${ac_uA}CLOSE_SIGNATURE${ac_uB}CLOSE_SIGNATURE${ac_uC}int fd${ac_uD} +-${ac_eA}CLOSE_SIGNATURE${ac_eB}CLOSE_SIGNATURE${ac_eC}int fd${ac_eD} +-${ac_dA}POLL_SIGNATURE${ac_dB}POLL_SIGNATURE${ac_dC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_dD} +-${ac_uA}POLL_SIGNATURE${ac_uB}POLL_SIGNATURE${ac_uC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_uD} +-${ac_eA}POLL_SIGNATURE${ac_eB}POLL_SIGNATURE${ac_eC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_eD} +-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +-CEOF +- sed -f conftest.frag conftest.in > conftest.out +- rm -f conftest.in +- mv conftest.out conftest.in +- +- 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" +- fi +- rm -f $ac_file +- mv conftest.h $ac_file +- fi +-fi; done +- +- +- +-exit 0 +diff -rN -U 5 tsocks-1.8/configure tsocks/configure +--- tsocks-1.8/configure 2002-07-16 10:51:08.000000000 +1200 ++++ tsocks/configure 2005-10-02 21:57:17.000000000 +1300 +@@ -1,53 +1,345 @@ + #! /bin/sh +- + # 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. ++# Generated by GNU Autoconf 2.59. + # ++# Copyright (C) 2003 Free Software Foundation, Inc. + # This configure script is free software; the Free Software Foundation + # gives unlimited permission to copy, distribute and modify it. ++## --------------------- ## ++## M4sh Initialization. ## ++## --------------------- ## ++ ++# Be Bourne compatible ++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then ++ emulate sh ++ NULLCMD=: ++ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which ++ # is contrary to our usage. Disable this feature. ++ alias -g '${1+"$@"}'='"$@"' ++elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then ++ set -o posix ++fi ++DUALCASE=1; export DUALCASE # for MKS sh ++ ++# Support unset when possible. ++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then ++ as_unset=unset ++else ++ as_unset=false ++fi ++ ++ ++# Work around bugs in pre-3.0 UWIN ksh. ++$as_unset ENV MAIL MAILPATH ++PS1='$ ' ++PS2='> ' ++PS4='+ ' ++ ++# NLS nuisances. ++for as_var in \ ++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ ++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ ++ LC_TELEPHONE LC_TIME ++do ++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then ++ eval $as_var=C; export $as_var ++ else ++ $as_unset $as_var ++ fi ++done ++ ++# Required to use basename. ++if expr a : '(a)' >/dev/null 2>&1; then ++ as_expr=expr ++else ++ as_expr=false ++fi ++ ++if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then ++ as_basename=basename ++else ++ as_basename=false ++fi ++ ++ ++# Name of the executable. ++as_me=`$as_basename "$0" || ++$as_expr X/"$0" : '.*/([^/][^/]*)/*$' | \ ++ X"$0" : 'X(//)$' | \ ++ X"$0" : 'X(/)$' | \ ++ . : '(.)' 2>/dev/null || ++echo X/"$0" | ++ sed '/^.*/([^/][^/]*)/*$/{ s//\1/; q; } ++ /^X/(//)$/{ s//\1/; q; } ++ /^X/(/).*/{ s//\1/; q; } ++ s/.*/./; q'` ++ ++ ++# PATH needs CR, and LINENO needs CR and PATH. ++# Avoid depending upon Character Ranges. ++as_cr_letters='abcdefghijklmnopqrstuvwxyz' ++as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' ++as_cr_Letters=$as_cr_letters$as_cr_LETTERS ++as_cr_digits='0123456789' ++as_cr_alnum=$as_cr_Letters$as_cr_digits ++ ++# The user is always right. ++if test "${PATH_SEPARATOR+set}" != set; then ++ echo "#! /bin/sh" >conf$$.sh ++ echo "exit 0" >>conf$$.sh ++ chmod +x conf$$.sh ++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then ++ PATH_SEPARATOR=';' ++ else ++ PATH_SEPARATOR=: ++ fi ++ rm -f conf$$.sh ++fi ++ ++ ++ as_lineno_1=$LINENO ++ as_lineno_2=$LINENO ++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` ++ test "x$as_lineno_1" != "x$as_lineno_2" && ++ test "x$as_lineno_3" = "x$as_lineno_2" || { ++ # Find who we are. Look in the path if we contain no path at all ++ # relative or not. ++ case $0 in ++ *[\/]* ) as_myself=$0 ;; ++ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break ++done ++ ++ ;; ++ esac ++ # We did not find ourselves, most probably we were run as `sh COMMAND' ++ # in which case we are not to be found in the path. ++ if test "x$as_myself" = x; then ++ as_myself=$0 ++ fi ++ if test ! -f "$as_myself"; then ++ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 ++ { (exit 1); exit 1; }; } ++ fi ++ case $CONFIG_SHELL in ++ '') ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for as_base in sh bash ksh sh5; do ++ case $as_dir in ++ /*) ++ if ("$as_dir/$as_base" -c ' ++ as_lineno_1=$LINENO ++ as_lineno_2=$LINENO ++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` ++ test "x$as_lineno_1" != "x$as_lineno_2" && ++ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then ++ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } ++ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } ++ CONFIG_SHELL=$as_dir/$as_base ++ export CONFIG_SHELL ++ exec "$CONFIG_SHELL" "$0" ${1+"$@"} ++ fi;; ++ esac ++ done ++done ++;; ++ esac ++ ++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO ++ # uniformly replaced by the line number. The first 'sed' inserts a ++ # line-number line before each line; the second 'sed' does the real ++ # work. The second script uses 'N' to pair each line-number line ++ # with the numbered line, and appends trailing '-' during ++ # substitution so that $LINENO is not a special case at line end. ++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the ++ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) ++ sed '=' <$as_myself | ++ sed ' ++ N ++ s,$,-, ++ : loop ++ s,^(['$as_cr_digits']*)(.*)[$]LINENO([^'$as_cr_alnum'_]),\1\2\1\3, ++ t loop ++ s,-$,, ++ s,^['$as_cr_digits']*\n,, ++ ' >$as_me.lineno && ++ chmod +x $as_me.lineno || ++ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 ++ { (exit 1); exit 1; }; } ++ ++ # Don't try to exec as it changes $[0], causing all sort of problems ++ # (the dirname of $[0] is not the place where we might find the ++ # original and so on. Autoconf is especially sensible to this). ++ . ./$as_me.lineno ++ # Exit status is that of the last command. ++ exit ++} ++ ++ ++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in ++ *c*,-n*) ECHO_N= ECHO_C=' ++' ECHO_T=' ' ;; ++ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; ++ *) ECHO_N= ECHO_C='\c' ECHO_T= ;; ++esac ++ ++if expr a : '(a)' >/dev/null 2>&1; then ++ as_expr=expr ++else ++ as_expr=false ++fi ++ ++rm -f conf$$ conf$$.exe conf$$.file ++echo >conf$$.file ++if ln -s conf$$.file conf$$ 2>/dev/null; then ++ # We could just check for DJGPP; but this test a) works b) is more generic ++ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). ++ if test -f conf$$.exe; then ++ # Don't use ln at all; we don't have any links ++ as_ln_s='cp -p' ++ else ++ as_ln_s='ln -s' ++ fi ++elif ln conf$$.file conf$$ 2>/dev/null; then ++ as_ln_s=ln ++else ++ as_ln_s='cp -p' ++fi ++rm -f conf$$ conf$$.exe conf$$.file ++ ++if mkdir -p . 2>/dev/null; then ++ as_mkdir_p=: ++else ++ test -d ./-p && rmdir ./-p ++ as_mkdir_p=false ++fi ++ ++as_executable_p="test -f" ++ ++# Sed expression to map a string onto a valid CPP name. ++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" ++ ++# Sed expression to map a string onto a valid variable name. ++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" ++ ++ ++# IFS ++# We need space, tab and new line, in precisely that order. ++as_nl=' ++' ++IFS=" $as_nl" ++ ++# CDPATH. ++$as_unset CDPATH ++ + +-# Defaults: +-ac_help= ++# Name of the host. ++# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, ++# so uname gets run too. ++ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` ++ ++exec 6>&1 ++ ++# ++# Initializations. ++# + ac_default_prefix=/usr/local +-# Any additions from configure.in: ++ac_config_libobj_dir=. ++cross_compiling=no ++subdirs= ++MFLAGS= ++MAKEFLAGS= ++SHELL=${CONFIG_SHELL-/bin/sh} ++ ++# Maximum number of lines to put in a shell here document. ++# This variable seems obsolete. It should probably be removed, and ++# only ac_max_sed_lines should be used. ++: ${ac_max_here_lines=38} ++ ++# Identity of this package. ++PACKAGE_NAME= ++PACKAGE_TARNAME= ++PACKAGE_VERSION= ++PACKAGE_STRING= ++PACKAGE_BUGREPORT= ++ ++ac_unique_file="saveme.c" + ac_default_prefix=/usr +-ac_help="$ac_help +- --enable-socksdns force dns lookups to use tcp " +-ac_help="$ac_help +- --disable-debug disable ALL error messages from tsocks " +-ac_help="$ac_help +- --enable-oldmethod use the old method to override connect " +-ac_help="$ac_help +- --disable-hostnames disable hostname lookups for socks servers " +-ac_help="$ac_help +- --disable-envconf do not allow TSOCKS_CONF_FILE to specify configuration file " +-ac_help="$ac_help +- --with-conf=<file> location of configuration file (/etc/tsocks.conf default)" ++# Factoring default headers for most tests. ++ac_includes_default="\ ++#include <stdio.h> ++#if HAVE_SYS_TYPES_H ++# include <sys/types.h> ++#endif ++#if HAVE_SYS_STAT_H ++# include <sys/stat.h> ++#endif ++#if STDC_HEADERS ++# include <stdlib.h> ++# include <stddef.h> ++#else ++# if HAVE_STDLIB_H ++# include <stdlib.h> ++# endif ++#endif ++#if HAVE_STRING_H ++# if !STDC_HEADERS && HAVE_MEMORY_H ++# include <memory.h> ++# endif ++# include <string.h> ++#endif ++#if HAVE_STRINGS_H ++# include <strings.h> ++#endif ++#if HAVE_INTTYPES_H ++# include <inttypes.h> ++#else ++# if HAVE_STDINT_H ++# include <stdint.h> ++# endif ++#endif ++#if 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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CPP EGREP DEADPOOL_O FIND TAIL SPECIALLIBS LIBOBJS LTLIBOBJS' ++ac_subst_files='' + + # Initialize some variables set by options. ++ac_init_help= ++ac_init_version=false + # The variables have the same names as the options, with + # dashes changed to underlines. +-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 + program_suffix=NONE + 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. + bindir='${exec_prefix}/bin' + sbindir='${exec_prefix}/sbin' + libexecdir='${exec_prefix}/libexec' + datadir='${prefix}/share' + sysconfdir='${prefix}/etc' +@@ -57,199 +349,143 @@ + 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 +- + ac_prev= + for ac_option + do +- + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=$ac_option" + ac_prev= + continue + fi + +- case "$ac_option" in +- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; +- *) ac_optarg= ;; +- esac ++ ac_optarg=`expr "x$ac_option" : 'x[^=]*=(.*)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + +- case "$ac_option" in ++ case $ac_option in + + -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 ;; ++ ++ --config-cache | -C) ++ cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) +- datadir="$ac_optarg" ;; ++ datadir=$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" ;; + + -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 +- *=*) ;; ++ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && ++ { echo "$as_me: error: invalid feature name: $ac_feature" >&2 ++ { (exit 1); exit 1; }; } ++ ac_feature=`echo $ac_feature | sed 's/-/_/g'` ++ case $ac_option in ++ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\''/g"`;; + *) ac_optarg=yes ;; + esac +- eval "enable_${ac_feature}='$ac_optarg'" ;; ++ eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) +- exec_prefix="$ac_optarg" ;; ++ 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 ;; + + -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 ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) +- localstatedir="$ac_optarg" ;; ++ 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 \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; +@@ -259,30 +495,30 @@ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) +- oldincludedir="$ac_optarg" ;; ++ 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 \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ +@@ -295,305 +531,842 @@ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) +- program_transform_name="$ac_optarg" ;; ++ program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) +- sbindir="$ac_optarg" ;; ++ sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) +- sharedstatedir="$ac_optarg" ;; ++ 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 ++ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && ++ { echo "$as_me: error: invalid package name: $ac_package" >&2 ++ { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` +- case "$ac_option" in +- *=*) ;; ++ case $ac_option in ++ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\''/g"`;; + *) ac_optarg=yes ;; + esac +- eval "with_${ac_package}='$ac_optarg'" ;; ++ 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. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) +- x_includes="$ac_optarg" ;; ++ x_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; }; } ++ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\''/g"` ++ 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; } +-fi +- +-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 +- +-# 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 ++ ac_option=--`echo $ac_prev | sed 's/_/-/g'` ++ { echo "$as_me: error: missing argument to $ac_option" >&2 ++ { (exit 1); exit 1; }; } + 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 ++# Be sure to have absolute paths. ++for ac_var in exec_prefix prefix ++do ++ eval ac_val=$`echo $ac_var` ++ case $ac_val in ++ [\/$]* | ?:[\/]* | NONE | '' ) ;; ++ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 ++ { (exit 1); exit 1; }; };; ++ esac ++done + +-# 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 ++# Be sure to have absolute paths. ++for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ ++ localstatedir libdir includedir oldincludedir infodir mandir + 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" ;; ++ eval ac_val=$`echo $ac_var` ++ case $ac_val in ++ [\/$]* | ?:[\/]* ) ;; ++ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 ++ { (exit 1); exit 1; }; };; + esac + done + +-# 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 ++# 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 + +-# 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_tool_prefix= ++test -n "$host_alias" && ac_tool_prefix=$host_alias- ++ ++test "$silent" = yes && exec 6>/dev/null + +-# 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=saveme.c + + # 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=. ++ ac_confdir=`(dirname "$0") 2>/dev/null || ++$as_expr X"$0" : 'X(.*[^/])//*[^/][^/]*/*$' | \ ++ X"$0" : 'X(//)[^/]' | \ ++ X"$0" : 'X(//)$' | \ ++ X"$0" : 'X(/)' | \ ++ . : '(.)' 2>/dev/null || ++echo X"$0" | ++ sed '/^X(.*[^/])//*[^/][^/]*/*$/{ s//\1/; q; } ++ /^X(//)[^/].*/{ s//\1/; q; } ++ /^X(//)$/{ s//\1/; q; } ++ /^X(/).*/{ s//\1/; q; } ++ s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi + else + ac_srcdir_defaulted=no + fi + if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then +- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } ++ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 ++ { (exit 1); exit 1; }; } + else +- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } ++ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 ++ { (exit 1); exit 1; }; } + fi + fi +-srcdir=`echo "${srcdir}" | sed 's%([^/])/*$%\1%'` ++(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || ++ { echo "$as_me: error: sources are in $srcdir, but `cd $srcdir' does not work" >&2 ++ { (exit 1); exit 1; }; } ++srcdir=`echo "$srcdir" | sed 's%([^\/])[\/]*$%\1%'` ++ac_env_build_alias_set=${build_alias+set} ++ac_env_build_alias_value=$build_alias ++ac_cv_env_build_alias_set=${build_alias+set} ++ac_cv_env_build_alias_value=$build_alias ++ac_env_host_alias_set=${host_alias+set} ++ac_env_host_alias_value=$host_alias ++ac_cv_env_host_alias_set=${host_alias+set} ++ac_cv_env_host_alias_value=$host_alias ++ac_env_target_alias_set=${target_alias+set} ++ac_env_target_alias_value=$target_alias ++ac_cv_env_target_alias_set=${target_alias+set} ++ac_cv_env_target_alias_value=$target_alias ++ac_env_CC_set=${CC+set} ++ac_env_CC_value=$CC ++ac_cv_env_CC_set=${CC+set} ++ac_cv_env_CC_value=$CC ++ac_env_CFLAGS_set=${CFLAGS+set} ++ac_env_CFLAGS_value=$CFLAGS ++ac_cv_env_CFLAGS_set=${CFLAGS+set} ++ac_cv_env_CFLAGS_value=$CFLAGS ++ac_env_LDFLAGS_set=${LDFLAGS+set} ++ac_env_LDFLAGS_value=$LDFLAGS ++ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ++ac_cv_env_LDFLAGS_value=$LDFLAGS ++ac_env_CPPFLAGS_set=${CPPFLAGS+set} ++ac_env_CPPFLAGS_value=$CPPFLAGS ++ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ++ac_cv_env_CPPFLAGS_value=$CPPFLAGS ++ac_env_CPP_set=${CPP+set} ++ac_env_CPP_value=$CPP ++ac_cv_env_CPP_set=${CPP+set} ++ac_cv_env_CPP_value=$CPP ++ ++# ++# Report the --help message. ++# ++if test "$ac_init_help" = "long"; then ++ # Omit some internal or obsolete options to make the list less imposing. ++ # This message is too long to be a string in the A/UX 3.1 sh. ++ cat <<_ACEOF ++`configure' configures this package to adapt to many kinds of systems. ++ ++Usage: $0 [OPTION]... [VAR=VALUE]... ++ ++To assign environment variables (e.g., CC, CFLAGS...), specify them as ++VAR=VALUE. See below for descriptions of some of the useful variables. ++ ++Defaults for the options are specified in brackets. ++ ++Configuration: ++ -h, --help display this help and exit ++ --help=short display options specific to this package ++ --help=recursive display the short help of all the included packages ++ -V, --version display version information and exit ++ -q, --quiet, --silent do not print `checking...' messages ++ --cache-file=FILE cache test results in FILE [disabled] ++ -C, --config-cache alias for `--cache-file=config.cache' ++ -n, --no-create do not create output files ++ --srcdir=DIR find the sources in DIR [configure dir or `..'] ++ ++_ACEOF ++ ++ cat <<_ACEOF ++Installation directories: ++ --prefix=PREFIX install architecture-independent files in PREFIX ++ [$ac_default_prefix] ++ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX ++ [PREFIX] ++ ++By default, `make install' will install all the files in ++`$ac_default_prefix/bin', `$ac_default_prefix/lib' etc. You can specify ++an installation prefix other than `$ac_default_prefix' using `--prefix', ++for instance `--prefix=$HOME'. ++ ++For better control, use the options below. ++ ++Fine tuning of the installation directories: ++ --bindir=DIR user executables [EPREFIX/bin] ++ --sbindir=DIR system admin executables [EPREFIX/sbin] ++ --libexecdir=DIR program executables [EPREFIX/libexec] ++ --datadir=DIR read-only architecture-independent data [PREFIX/share] ++ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] ++ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] ++ --localstatedir=DIR modifiable single-machine data [PREFIX/var] ++ --libdir=DIR object code libraries [EPREFIX/lib] ++ --includedir=DIR C header files [PREFIX/include] ++ --oldincludedir=DIR C header files for non-gcc [/usr/include] ++ --infodir=DIR info documentation [PREFIX/info] ++ --mandir=DIR man documentation [PREFIX/man] ++_ACEOF ++ ++ cat <<_ACEOF ++ ++System types: ++ --build=BUILD configure for building on BUILD [guessed] ++ --host=HOST cross-compile to build programs to run on HOST [BUILD] ++_ACEOF ++fi ++ ++if test -n "$ac_init_help"; then ++ ++ cat <<_ACEOF ++ ++Optional Features: ++ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) ++ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ++ --enable-socksdns force dns lookups to use tcp ++ --disable-tordns don't override name lookup calls to use SOCKS ++ --disable-debug disable ALL error messages from tsocks ++ --enable-oldmethod use the old method to override connect ++ --enable-hostnames enable hostname lookups for socks servers ++ --disable-envconf do not allow TSOCKS_CONF_FILE to specify configuration file ++ ++Optional Packages: ++ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] ++ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) ++ --with-conf=<file> location of configuration file (/etc/tsocks.conf default) ++ ++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> ++ CPPFLAGS C/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. ++ ++_ACEOF ++fi ++ ++if test "$ac_init_help" = "recursive"; then ++ # If there are subdirs, report their specific --help. ++ ac_popdir=`pwd` ++ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue ++ test -d $ac_dir || continue ++ ac_builddir=. ++ ++if test "$ac_dir" != .; then ++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^.[\/],,'` ++ # A "../" for each directory in $ac_dir_suffix. ++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\/]*,../,g'` ++else ++ ac_dir_suffix= ac_top_builddir= ++fi ++ ++case $srcdir in ++ .) # No --srcdir option. We are building in place. ++ ac_srcdir=. ++ if test -z "$ac_top_builddir"; then ++ ac_top_srcdir=. ++ else ++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` ++ fi ;; ++ [\/]* | ?:[\/]* ) # Absolute path. ++ ac_srcdir=$srcdir$ac_dir_suffix; ++ ac_top_srcdir=$srcdir ;; ++ *) # Relative path. ++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ++ ac_top_srcdir=$ac_top_builddir$srcdir ;; ++esac ++ ++# Do not use `cd foo && pwd` to compute absolute paths, because ++# the directories may not exist. ++case `pwd` in ++.) ac_abs_builddir="$ac_dir";; ++*) ++ case "$ac_dir" in ++ .) ac_abs_builddir=`pwd`;; ++ [\/]* | ?:[\/]* ) ac_abs_builddir="$ac_dir";; ++ *) ac_abs_builddir=`pwd`/"$ac_dir";; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_builddir=${ac_top_builddir}.;; ++*) ++ case ${ac_top_builddir}. in ++ .) ac_abs_top_builddir=$ac_abs_builddir;; ++ [\/]* | ?:[\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; ++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_srcdir=$ac_srcdir;; ++*) ++ case $ac_srcdir in ++ .) ac_abs_srcdir=$ac_abs_builddir;; ++ [\/]* | ?:[\/]* ) ac_abs_srcdir=$ac_srcdir;; ++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_srcdir=$ac_top_srcdir;; ++*) ++ case $ac_top_srcdir in ++ .) ac_abs_top_srcdir=$ac_abs_builddir;; ++ [\/]* | ?:[\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; ++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; ++ esac;; ++esac ++ ++ cd $ac_dir ++ # Check for guested configure; otherwise get Cygnus style configure. ++ if test -f $ac_srcdir/configure.gnu; then ++ echo ++ $SHELL $ac_srcdir/configure.gnu --help=recursive ++ elif test -f $ac_srcdir/configure; then ++ echo ++ $SHELL $ac_srcdir/configure --help=recursive ++ elif test -f $ac_srcdir/configure.ac || ++ test -f $ac_srcdir/configure.in; then ++ echo ++ $ac_configure --help ++ else ++ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 ++ fi ++ cd "$ac_popdir" ++ done ++fi ++ ++test -n "$ac_init_help" && exit 0 ++if $ac_init_version; then ++ cat <<_ACEOF ++ ++Copyright (C) 2003 Free Software Foundation, Inc. ++This configure script is free software; the Free Software Foundation ++gives unlimited permission to copy, distribute and modify it. ++_ACEOF ++ exit 0 ++fi ++exec 5>config.log ++cat >&5 <<_ACEOF ++This file contains any messages produced by compilers while ++running configure, to aid debugging if configure makes a mistake. ++ ++It was created by $as_me, which was ++generated by GNU Autoconf 2.59. Invocation command line was ++ ++ $ $0 $@ ++ ++_ACEOF ++{ ++cat <<_ASUNAME ++## --------- ## ++## Platform. ## ++## --------- ## ++ ++hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` ++uname -m = `(uname -m) 2>/dev/null || echo unknown` ++uname -r = `(uname -r) 2>/dev/null || echo unknown` ++uname -s = `(uname -s) 2>/dev/null || echo unknown` ++uname -v = `(uname -v) 2>/dev/null || echo unknown` ++ ++/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` ++/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` ++ ++/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` ++/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` ++/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` ++hostinfo = `(hostinfo) 2>/dev/null || echo unknown` ++/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` ++/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` ++/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` ++ ++_ASUNAME ++ ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ echo "PATH: $as_dir" ++done ++ ++} >&5 ++ ++cat >&5 <<_ACEOF ++ ++ ++## ----------- ## ++## Core tests. ## ++## ----------- ## ++ ++_ACEOF ++ ++ ++# Keep a trace of the command line. ++# Strip out --no-create and --no-recursion so they do not pile up. ++# Strip out --silent because we don't want to record it for future runs. ++# Also quote any args containing shell meta-characters. ++# Make two passes to allow for proper duplicate-argument suppression. ++ac_configure_args= ++ac_configure_args0= ++ac_configure_args1= ++ac_sep= ++ac_must_keep_next=false ++for ac_pass in 1 2 ++do ++ for ac_arg ++ do ++ case $ac_arg in ++ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; ++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ ++ | -silent | --silent | --silen | --sile | --sil) ++ continue ;; ++ *" "*|*" "*|*[[]~#$^&*(){}\|;<>?"']*) ++ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\''/g"` ;; ++ esac ++ case $ac_pass in ++ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; ++ 2) ++ ac_configure_args1="$ac_configure_args1 '$ac_arg'" ++ if test $ac_must_keep_next = true; then ++ ac_must_keep_next=false # Got value, back to normal. ++ else ++ case $ac_arg in ++ *=* | --config-cache | -C | -disable-* | --disable-* \ ++ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ ++ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ ++ | -with-* | --with-* | -without-* | --without-* | --x) ++ case "$ac_configure_args0 " in ++ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; ++ esac ++ ;; ++ -* ) ac_must_keep_next=true ;; ++ esac ++ fi ++ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ++ # Get rid of the leading space. ++ ac_sep=" " ++ ;; ++ esac ++ done ++done ++$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } ++$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } ++ ++# When interrupted or exit'd, cleanup temporary files, and complete ++# config.log. We remove comments because anyway the quotes in there ++# would cause problems or look ugly. ++# WARNING: Be sure not to use single quotes in there, as some shells, ++# such as our DU 5.0 friend, will then `close' the trap. ++trap 'exit_status=$? ++ # Save into config.log some information that might help in debugging. ++ { ++ echo ++ ++ cat <<_ASBOX ++## ---------------- ## ++## Cache variables. ## ++## ---------------- ## ++_ASBOX ++ echo ++ # The following way of writing the cache mishandles newlines in values, ++{ ++ (set) 2>&1 | ++ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in ++ *ac_space=\ *) ++ sed -n \ ++ "s/'"'"'/'"'"'\\'"'"''"'"'/g; ++ s/^\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\)=\(.*\)/\1='"'"'\2'"'"'/p" ++ ;; ++ *) ++ sed -n \ ++ "s/^\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\)=\(.*\)/\1=\2/p" ++ ;; ++ esac; ++} ++ echo ++ ++ cat <<_ASBOX ++## ----------------- ## ++## Output variables. ## ++## ----------------- ## ++_ASBOX ++ echo ++ for ac_var in $ac_subst_vars ++ do ++ eval ac_val=$`echo $ac_var` ++ echo "$ac_var='"'"'$ac_val'"'"'" ++ done | sort ++ echo ++ ++ if test -n "$ac_subst_files"; then ++ cat <<_ASBOX ++## ------------- ## ++## Output files. ## ++## ------------- ## ++_ASBOX ++ echo ++ for ac_var in $ac_subst_files ++ do ++ eval ac_val=$`echo $ac_var` ++ echo "$ac_var='"'"'$ac_val'"'"'" ++ done | sort ++ echo ++ fi ++ ++ if test -s confdefs.h; then ++ cat <<_ASBOX ++## ----------- ## ++## confdefs.h. ## ++## ----------- ## ++_ASBOX ++ echo ++ sed "/^$/d" confdefs.h | sort ++ echo ++ fi ++ test "$ac_signal" != 0 && ++ echo "$as_me: caught signal $ac_signal" ++ echo "$as_me: exit $exit_status" ++ } >&5 ++ rm -f core *.core && ++ rm -rf conftest* confdefs* conf$$* $ac_clean_files && ++ exit $exit_status ++ ' 0 ++for ac_signal in 1 2 13 15; do ++ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal ++done ++ac_signal=0 ++ ++# confdefs.h avoids OS command line length limits that DEFS can exceed. ++rm -rf conftest* confdefs.h ++# AIX cpp loses on an empty file, so make sure it contains at least a newline. ++echo >confdefs.h ++ ++# Predefined preprocessor variables. ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_NAME "$PACKAGE_NAME" ++_ACEOF ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_TARNAME "$PACKAGE_TARNAME" ++_ACEOF + ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_VERSION "$PACKAGE_VERSION" ++_ACEOF ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_STRING "$PACKAGE_STRING" ++_ACEOF ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" ++_ACEOF ++ ++ ++# Let the site file select an alternate cache file if it wants to. + # Prefer explicitly selected file to automatically selected ones. + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi + for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then +- echo "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 `(set) 2>&1 | ++ sed -n 's/^ac_env_([a-zA-Z_0-9]*)_set=.*/\1/p'`; do ++ eval ac_old_set=$ac_cv_env_${ac_var}_set ++ eval ac_new_set=$ac_env_${ac_var}_set ++ eval ac_old_val="$ac_cv_env_${ac_var}_value" ++ eval ac_new_val="$ac_env_${ac_var}_value" ++ case $ac_old_set,$ac_new_set in ++ set,) ++ { echo "$as_me:$LINENO: error: `$ac_var' was set to `$ac_old_val' in the previous run" >&5 ++echo "$as_me: error: `$ac_var' was set to `$ac_old_val' in the previous run" >&2;} ++ ac_cache_corrupted=: ;; ++ ,set) ++ { echo "$as_me:$LINENO: error: `$ac_var' was not set in the previous run" >&5 ++echo "$as_me: error: `$ac_var' was not set in the previous run" >&2;} ++ ac_cache_corrupted=: ;; ++ ,);; ++ *) ++ if test "x$ac_old_val" != "x$ac_new_val"; then ++ { echo "$as_me:$LINENO: error: `$ac_var' has changed since the previous run:" >&5 ++echo "$as_me: error: `$ac_var' has changed since the previous run:" >&2;} ++ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 ++echo "$as_me: former value: $ac_old_val" >&2;} ++ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 ++echo "$as_me: current value: $ac_new_val" >&2;} ++ ac_cache_corrupted=: ++ fi;; ++ esac ++ # Pass precious variables to config.status. ++ if test "$ac_new_set" = set; then ++ case $ac_new_val in ++ *" "*|*" "*|*[[]~#$^&*(){}\|;<>?"']*) ++ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\''/g"` ;; ++ *) ac_arg=$ac_var=$ac_new_val ;; ++ esac ++ case " $ac_configure_args " in ++ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. ++ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; ++ esac ++ fi ++done ++if $ac_cache_corrupted; then ++ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 ++echo "$as_me: error: changes in the environment can compromise the build" >&2;} ++ { { echo "$as_me:$LINENO: error: run `make distclean' and/or `rm $cache_file' and start over" >&5 ++echo "$as_me: error: run `make distclean' and/or `rm $cache_file' and start over" >&2;} ++ { (exit 1); exit 1; }; } + fi + + ac_ext=c +-# 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=' ' +- else +- ac_n=-n ac_c= ac_t= +- fi +-else +- ac_n= ac_c='\c' ac_t= +-fi ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + + + + ++ ac_config_headers="$ac_config_headers config.h" ++ ++ ++ ++ + test "$libdir" = "${exec_prefix}/lib" && libdir="/lib" + + # Check whether --enable-socksdns or --disable-socksdns was given. + if test "${enable_socksdns+set}" = set; then + enableval="$enable_socksdns" +- : +-fi + ++fi; ++# Check whether --enable-tordns or --disable-tordns was given. ++if test "${enable_tordns+set}" = set; then ++ enableval="$enable_tordns" ++ ++fi; + # Check whether --enable-debug or --disable-debug was given. + if test "${enable_debug+set}" = set; then + enableval="$enable_debug" +- : +-fi + ++fi; + # Check whether --enable-oldmethod or --disable-oldmethod was given. + if test "${enable_oldmethod+set}" = set; then + enableval="$enable_oldmethod" +- : +-fi + ++fi; + # Check whether --enable-hostnames or --disable-hostnames was given. + if test "${enable_hostnames+set}" = set; then + enableval="$enable_hostnames" +- : +-fi + ++fi; + # Check whether --enable-envconf or --disable-envconf was given. + if test "${enable_envconf+set}" = set; then + enableval="$enable_envconf" +- : +-fi ++ ++fi; + + # Check whether --with-conf or --without-conf was given. + if test "${with_conf+set}" = set; then + withval="$with_conf" +- ++ + if test "${withval}" = "yes" ; then +- { echo "configure: error: "--with-conf requires the location of the configuration file as an argument"" 1>&2; exit 1; } ++ { { echo "$as_me:$LINENO: error: "--with-conf requires the location of the configuration file as an argument"" >&5 ++echo "$as_me: error: "--with-conf requires the location of the configuration file as an argument"" >&2;} ++ { (exit 1); exit 1; }; } + else +- cat >> confdefs.h <<EOF ++ cat >>confdefs.h <<_ACEOF + #define CONF_FILE "${withval}" +-EOF ++_ACEOF + + fi + + else +- +- cat >> confdefs.h <<EOF +-#define CONF_FILE "/etc/tsocks.conf" +-EOF + ++ cat >>confdefs.h <<_ACEOF ++#define CONF_FILE "/etc/tsocks.conf" ++_ACEOF + +-fi + ++fi; + + + ac_aux_dir= + for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then +@@ -602,255 +1375,731 @@ + 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 "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. +- ++ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 ++echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ac_config_guess="$SHELL $ac_aux_dir/config.guess" ++ac_config_sub="$SHELL $ac_aux_dir/config.sub" ++ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + + # Make sure we can run config.sub. +-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +-fi +- +-echo $ac_n "checking host system type""... $ac_c" 1>&6 +-echo "configure:624: checking host system type" >&5 +- +-host_alias=$host +-case "$host_alias" in +-NONE) +- case $nonopt in +- NONE) +- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : +- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } +- fi ;; +- *) host_alias=$nonopt ;; +- esac ;; +-esac ++$ac_config_sub sun4 >/dev/null 2>&1 || ++ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 ++echo "$as_me: error: cannot run $ac_config_sub" >&2;} ++ { (exit 1); exit 1; }; } ++ ++echo "$as_me:$LINENO: checking build system type" >&5 ++echo $ECHO_N "checking build system type... $ECHO_C" >&6 ++if test "${ac_cv_build+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_build_alias=$build_alias ++test -z "$ac_cv_build_alias" && ++ ac_cv_build_alias=`$ac_config_guess` ++test -z "$ac_cv_build_alias" && ++ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 ++echo "$as_me: error: cannot guess build type; you must specify one" >&2;} ++ { (exit 1); exit 1; }; } ++ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || ++ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 ++echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} ++ { (exit 1); exit 1; }; } ++ ++fi ++echo "$as_me:$LINENO: result: $ac_cv_build" >&5 ++echo "${ECHO_T}$ac_cv_build" >&6 ++build=$ac_cv_build ++build_cpu=`echo $ac_cv_build | sed 's/^([^-]*)-([^-]*)-(.*)$/\1/'` ++build_vendor=`echo $ac_cv_build | sed 's/^([^-]*)-([^-]*)-(.*)$/\2/'` ++build_os=`echo $ac_cv_build | sed 's/^([^-]*)-([^-]*)-(.*)$/\3/'` ++ ++ ++echo "$as_me:$LINENO: checking host system type" >&5 ++echo $ECHO_N "checking host system type... $ECHO_C" >&6 ++if test "${ac_cv_host+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_host_alias=$host_alias ++test -z "$ac_cv_host_alias" && ++ ac_cv_host_alias=$ac_cv_build_alias ++ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || ++ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 ++echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} ++ { (exit 1); exit 1; }; } ++ ++fi ++echo "$as_me:$LINENO: result: $ac_cv_host" >&5 ++echo "${ECHO_T}$ac_cv_host" >&6 ++host=$ac_cv_host ++host_cpu=`echo $ac_cv_host | sed 's/^([^-]*)-([^-]*)-(.*)$/\1/'` ++host_vendor=`echo $ac_cv_host | sed 's/^([^-]*)-([^-]*)-(.*)$/\2/'` ++host_os=`echo $ac_cv_host | sed 's/^([^-]*)-([^-]*)-(.*)$/\3/'` + +-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +-host_cpu=`echo $host | sed 's/^([^-]*)-([^-]*)-(.*)$/\1/'` +-host_vendor=`echo $host | sed 's/^([^-]*)-([^-]*)-(.*)$/\2/'` +-host_os=`echo $host | sed 's/^([^-]*)-([^-]*)-(.*)$/\3/'` +-echo "$ac_t""$host" 1>&6 + + +-# 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:648: checking for $ac_word" >&5 +-if eval "test "`echo '$''{'ac_cv_prog_CC'+set}'`" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++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 +- 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_CC="${ac_tool_prefix}gcc" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ ++fi ++fi ++CC=$ac_cv_prog_CC ++if test -n "$CC"; then ++ echo "$as_me:$LINENO: result: $CC" >&5 ++echo "${ECHO_T}$CC" >&6 ++else ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++fi ++ ++fi ++if test -z "$ac_cv_prog_CC"; then ++ ac_ct_CC=$CC ++ # Extract the first word of "gcc", so it can be a program name with args. ++set dummy gcc; ac_word=$2 ++echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 ++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if test -n "$ac_ct_CC"; then ++ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_CC="gcc" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ ++fi ++fi ++ac_ct_CC=$ac_cv_prog_ac_ct_CC ++if test -n "$ac_ct_CC"; then ++ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 ++echo "${ECHO_T}$ac_ct_CC" >&6 ++else ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++fi ++ ++ CC=$ac_ct_CC ++else ++ CC="$ac_cv_prog_CC" ++fi ++ ++if test -z "$CC"; then ++ if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. ++set dummy ${ac_tool_prefix}cc; ac_word=$2 ++echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 ++if test "${ac_cv_prog_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if test -n "$CC"; then ++ ac_cv_prog_CC="$CC" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_CC="${ac_tool_prefix}cc" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ + fi + fi +-CC="$ac_cv_prog_CC" ++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 "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++fi ++ ++fi ++if test -z "$ac_cv_prog_CC"; then ++ ac_ct_CC=$CC ++ # Extract the first word of "cc", so it can be a program name with args. ++set dummy cc; ac_word=$2 ++echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 ++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if test -n "$ac_ct_CC"; then ++ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_CC="cc" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ ++fi ++fi ++ac_ct_CC=$ac_cv_prog_ac_ct_CC ++if test -n "$ac_ct_CC"; then ++ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 ++echo "${ECHO_T}$ac_ct_CC" >&6 ++else ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++fi ++ ++ CC=$ac_ct_CC + else +- echo "$ac_t""no" 1>&6 ++ CC="$ac_cv_prog_CC" + fi + ++fi + if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. + set dummy cc; ac_word=$2 +-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:678: 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ++ ac_prog_rejected=yes ++ continue ++ fi ++ ac_cv_prog_CC="cc" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ + if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift +- if test $# -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:729: 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 ++ 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_CC="$ac_tool_prefix$ac_prog" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ + fi + fi +-CC="$ac_cv_prog_CC" ++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 ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 ++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if test -n "$ac_ct_CC"; then ++ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_CC="$ac_prog" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 + fi +- test -z "$CC" && { echo "configure: error: no acceptable cc found in $PATH" 1>&2; exit 1; } ++done ++done ++ ++fi ++fi ++ac_ct_CC=$ac_cv_prog_ac_ct_CC ++if test -n "$ac_ct_CC"; then ++ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 ++echo "${ECHO_T}$ac_ct_CC" >&6 ++else ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 + fi + +-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +-echo "configure:761: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ++ test -n "$ac_ct_CC" && break ++done + +-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 ++ CC=$ac_ct_CC ++fi + +-cat > conftest.$ac_ext << EOF ++fi + +-#line 772 "configure" +-#include "confdefs.h" + +-main(){return(0);} +-EOF +-if { (eval echo configure:777: "$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 +- else +- ac_cv_prog_cc_cross=yes +- fi ++test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in $PATH ++See `config.log' for more details." >&5 ++echo "$as_me: error: no acceptable C compiler found in $PATH ++See `config.log' for more details." >&2;} ++ { (exit 1); exit 1; }; } ++ ++# Provide some information about the compiler. ++echo "$as_me:$LINENO:" \ ++ "checking for C compiler version" >&5 ++ac_compiler=`set X $ac_compile; echo $2` ++{ (eval echo "$as_me:$LINENO: "$ac_compiler --version </dev/null >&5"") >&5 ++ (eval $ac_compiler --version </dev/null >&5) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } ++{ (eval echo "$as_me:$LINENO: "$ac_compiler -v </dev/null >&5"") >&5 ++ (eval $ac_compiler -v </dev/null >&5) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } ++{ (eval echo "$as_me:$LINENO: "$ac_compiler -V </dev/null >&5"") >&5 ++ (eval $ac_compiler -V </dev/null >&5) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } ++ ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++ac_clean_files_save=$ac_clean_files ++ac_clean_files="$ac_clean_files a.out a.exe b.out" ++# Try to create an executable without -o first, disregard a.out. ++# It will help us diagnose broken compilers, and finding out an intuition ++# of exeext. ++echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 ++echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ++ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` ++if { (eval echo "$as_me:$LINENO: "$ac_link_default"") >&5 ++ (eval $ac_link_default) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; then ++ # Find the output, starting from the most likely. This scheme is ++# not robust to junk in `.', hence go to wildcards (a.*) only as a last ++# resort. ++ ++# Be careful to initialize this variable, since it used to be cached. ++# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ++ac_cv_exeext= ++# b.out is created by i960 compilers. ++for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out ++do ++ test -f "$ac_file" || continue ++ case $ac_file in ++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ++ ;; ++ conftest.$ac_ext ) ++ # This is the source file. ++ ;; ++ [ab].out ) ++ # We found the default executable, but exeext='' is most ++ # certainly right. ++ break;; ++ *.* ) ++ ac_cv_exeext=`expr "$ac_file" : '[^.]*(..*)'` ++ # FIXME: I believe we export ac_cv_exeext for Libtool, ++ # but it would be cool to find out if it's true. Does anybody ++ # maintain Libtool? --akim. ++ export ac_cv_exeext ++ break;; ++ * ) ++ break;; ++ esac ++done + else +- echo "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 "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 + +-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; } ++{ { echo "$as_me:$LINENO: error: C compiler cannot create executables ++See `config.log' for more details." >&5 ++echo "$as_me: error: C compiler cannot create executables ++See `config.log' for more details." >&2;} ++ { (exit 77); exit 77; }; } ++fi ++ ++ac_exeext=$ac_cv_exeext ++echo "$as_me:$LINENO: result: $ac_file" >&5 ++echo "${ECHO_T}$ac_file" >&6 ++ ++# Check the compiler produces executables we can run. If not, either ++# the compiler is broken, or we cross compile. ++echo "$as_me:$LINENO: checking whether the C compiler works" >&5 ++echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 ++# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 ++# If not cross compiling, check that we can run a simple program. ++if test "$cross_compiling" != yes; then ++ if { ac_try='./$ac_file' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ cross_compiling=no ++ else ++ if test "$cross_compiling" = maybe; then ++ cross_compiling=yes ++ else ++ { { echo "$as_me:$LINENO: error: cannot run C compiled programs. ++If you meant to cross compile, use `--host'. ++See `config.log' for more details." >&5 ++echo "$as_me: error: cannot run C compiled programs. ++If you meant to cross compile, use `--host'. ++See `config.log' for more details." >&2;} ++ { (exit 1); exit 1; }; } ++ fi ++ fi + fi +-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +-echo "configure:803: 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 "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6 + +-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +-echo "configure:808: 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 ++rm -f a.out a.exe conftest$ac_cv_exeext b.out ++ac_clean_files=$ac_clean_files_save ++# Check the compiler produces executables we can run. If not, either ++# the compiler is broken, or we cross compile. ++echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 ++echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 ++echo "$as_me:$LINENO: result: $cross_compiling" >&5 ++echo "${ECHO_T}$cross_compiling" >&6 ++ ++echo "$as_me:$LINENO: checking for suffix of executables" >&5 ++echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 ++if { (eval echo "$as_me:$LINENO: "$ac_link"") >&5 ++ (eval $ac_link) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; then ++ # If both `conftest.exe' and `conftest' are `present' (well, observable) ++# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will ++# work properly (i.e., refer to `conftest.exe'), while it won't with ++# `rm'. ++for ac_file in conftest.exe conftest conftest.*; do ++ test -f "$ac_file" || continue ++ case $ac_file in ++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; ++ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*(..*)'` ++ export ac_cv_exeext ++ break;; ++ * ) break;; ++ esac ++done + else +- cat > conftest.c <<EOF +-#ifdef __GNUC__ +- yes; +-#endif +-EOF +-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:817: "$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 { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; then ++ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do ++ case $ac_file in ++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; ++ *) ac_cv_objext=`expr "$ac_file" : '.*.(.*)'` ++ break;; ++ esac ++done + else +- ac_cv_prog_gcc=no +-fi +-fi ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 + +-echo "$ac_t""$ac_cv_prog_gcc" 1>&6 +- +-if test $ac_cv_prog_gcc = yes; then +- GCC=yes +-else +- GCC= +-fi ++{ { 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 + +-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:836: 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 +-else +- echo 'void f(){}' > conftest.c +-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_compiler_gnu=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_compiler_gnu=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ac_cv_c_compiler_gnu=$ac_compiler_gnu ++ ++fi ++echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 ++echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 ++GCC=`test $ac_compiler_gnu = yes && echo yes` ++ac_test_CFLAGS=${CFLAGS+set} ++ac_save_CFLAGS=$CFLAGS ++CFLAGS="-g" ++echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 ++echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 ++if test "${ac_cv_prog_cc_g+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes + else +- ac_cv_prog_cc_g=no +-fi +-rm -f conftest* ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 + ++ac_cv_prog_cc_g=no + fi +- +-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 ++echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 + if test "$ac_test_CFLAGS" = set; then +- CFLAGS="$ac_save_CFLAGS" ++ CFLAGS=$ac_save_CFLAGS + elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" +@@ -860,1774 +2109,4838 @@ + CFLAGS="-O2" + else + CFLAGS= + fi + fi ++echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 ++echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 ++if test "${ac_cv_prog_cc_stdc+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_prog_cc_stdc=no ++ac_save_CC=$CC ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <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; ++} ++ ++/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has ++ function prototypes and stuff, but not '\xHH' hex character constants. ++ These don't provoke an error unfortunately, instead are silently treated ++ as 'x'. The following induces an error, until -std1 is added to get ++ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an ++ array size at least. It's necessary to write '\x00'==0 to get something ++ that's true only with -std1. */ ++int osf4_cc_array ['\x00' == 0 ? 1 : -1]; ++ ++int test (int i, double x); ++struct s1 {int (*f) (int a);}; ++struct s2 {int (*f) (double a);}; ++int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); ++int argc; ++char **argv; ++int ++main () ++{ ++return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ++ ; ++ return 0; ++} ++_ACEOF ++# Don't try gcc -ansi; that turns off useful extensions and ++# breaks some systems' header files. ++# AIX -qlanglvl=ansi ++# Ultrix and OSF/1 -std1 ++# HP-UX 10.20 and later -Ae ++# HP-UX older versions -Aa -D_HPUX_SOURCE ++# SVR4 -Xc -D__EXTENSIONS__ ++for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" ++do ++ CC="$ac_save_CC $ac_arg" ++ rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_prog_cc_stdc=$ac_arg ++break ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext ++done ++rm -f conftest.$ac_ext conftest.$ac_objext ++CC=$ac_save_CC ++ ++fi ++ ++case "x$ac_cv_prog_cc_stdc" in ++ x|xno) ++ echo "$as_me:$LINENO: result: none needed" >&5 ++echo "${ECHO_T}none needed" >&6 ;; ++ *) ++ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 ++echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 ++ CC="$CC $ac_cv_prog_cc_stdc" ;; ++esac ++ ++# Some people use a C++ compiler to compile C. Since we use `exit', ++# in C++ we need to declare it. In case someone uses the same compiler ++# for both compiling C and C++ we need to have the C++ compiler decide ++# the declaration of exit, since it's the most demanding environment. ++cat >conftest.$ac_ext <<_ACEOF ++#ifndef __cplusplus ++ choke me ++#endif ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ for ac_declaration in \ ++ '' \ ++ 'extern "C" void std::exit (int) throw (); using std::exit;' \ ++ 'extern "C" void std::exit (int); using std::exit;' \ ++ 'extern "C" void exit (int) throw ();' \ ++ 'extern "C" void exit (int);' \ ++ 'void exit (int);' ++do ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_declaration ++#include <stdlib.h> ++int ++main () ++{ ++exit (42); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ : ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++continue ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_declaration ++int ++main () ++{ ++exit (42); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ break ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++done ++rm -f conftest* ++if test -n "$ac_declaration"; then ++ echo '#ifdef __cplusplus' >>confdefs.h ++ echo $ac_declaration >>confdefs.h ++ echo '#endif' >>confdefs.h ++fi ++ ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu + + # Find a good install program. We prefer a C program (faster), + # so one script is as good as another. But avoid the broken or + # incompatible versions: + # SysV /etc/install, /usr/sbin/install + # SunOS /usr/etc/install + # IRIX /sbin/install + # AIX /bin/install ++# AmigaOS /C/install, which installs bootblocks on floppy discs + # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag + # AFS /usr/afsws/bin/install, which mishandles nonexistent args + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" ++# OS/2's system install, which has a completely different semantic + # ./install, which can be erroneously created by make from ./install.sh. +-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +-echo "configure:879: 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 ++if test "${ac_cv_path_install+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ # Account for people who put trailing slashes in PATH elements. ++case $as_dir/ in ++ ./ | .// | /cC/* | \ ++ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ++ ?:\/os2\/install\/* | ?:\/OS2\/INSTALL\/* | \ ++ /usr/ucb/* ) ;; ++ *) ++ # OSF1 and SCO ODT 3.0 have their own names for install. ++ # Don't use installbsd from OSF since it installs stuff as root ++ # by default. ++ for ac_prog in ginstall scoinst install; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && +- grep dspmsg $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 ++ + + 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 + # break other packages using the cache if that directory is + # removed, or if the path is relative. +- INSTALL="$ac_install_sh" ++ 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' + +-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +-echo "configure:932: checking whether ln -s works" >&5 +-if eval "test "`echo '$''{'ac_cv_prog_LN_S'+set}'`" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- rm -f conftestdata +-if ln -s X conftestdata 2>/dev/null +-then +- rm -f conftestdata +- ac_cv_prog_LN_S="ln -s" ++echo "$as_me:$LINENO: checking whether ln -s works" >&5 ++echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 ++LN_S=$as_ln_s ++if test "$LN_S" = "ln -s"; then ++ echo "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6 + else +- ac_cv_prog_LN_S=ln +-fi +-fi +-LN_S="$ac_cv_prog_LN_S" +-if test "$ac_cv_prog_LN_S" = "ln -s"; then +- echo "$ac_t""yes" 1>&6 +-else +- echo "$ac_t""no" 1>&6 ++ echo "$as_me:$LINENO: result: no, using $LN_S" >&5 ++echo "${ECHO_T}no, using $LN_S" >&6 + fi + + +-echo $ac_n "checking "if the C compiler accepts -Wall"""... $ac_c" 1>&6 +-echo "configure:954: checking "if the C compiler accepts -Wall"" >&5 ++echo "$as_me:$LINENO: checking if the C compiler accepts -Wall" >&5 ++echo $ECHO_N "checking if the C compiler accepts -Wall... $ECHO_C" >&6 + OLDCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wall" +-cat > conftest.$ac_ext <<EOF +-#line 958 "configure" +-#include "confdefs.h" +- +-int main() { +- +-; return 0; } +-EOF +-if { (eval echo configure:965: "$ac_compile") 1>&5; (eval $ac_compile) 2>&5; }; then +- rm -rf conftest* +- echo "$ac_t""yes" 1>&6 +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- ++ ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ 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 ++ ++ + CFLAGS="$OLDCFLAGS" +- echo "$ac_t""no" 1>&6 ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 + fi +-rm -f conftest* ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +-echo "configure:979: checking how to run the C preprocessor" >&5 ++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 eval "test "`echo '$''{'ac_cv_prog_CPP'+set}'`" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++ if test "${ac_cv_prog_CPP+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + 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" ++ # 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. +- cat > conftest.$ac_ext <<EOF +-#line 994 "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:1000: "$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 +- : ++ # not just through cpp. "Syntax error" is here to catch this case. ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#ifdef __STDC__ ++# include <limits.h> ++#else ++# include <assert.h> ++#endif ++ Syntax error ++_ACEOF ++if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 ++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null; then ++ if test -s conftest.err; then ++ ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag ++ else ++ ac_cpp_err= ++ fi + else +- 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 1011 "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:1017: "$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 ++ ac_cpp_err=yes ++fi ++if test -z "$ac_cpp_err"; then + : + 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 1028 "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:1034: "$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 +- : ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ # Broken: fails on valid input. ++continue ++fi ++rm -f conftest.err conftest.$ac_ext ++ ++ # OK, works on sane cases. Now check whether non-existent headers ++ # can be detected and how. ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <ac_nonexistent.h> ++_ACEOF ++if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 ++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null; then ++ if test -s conftest.err; then ++ ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag ++ else ++ ac_cpp_err= ++ fi + else +- echo "$ac_err" >&5 +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- CPP=/lib/cpp ++ ac_cpp_err=yes + fi +-rm -f conftest* ++if test -z "$ac_cpp_err"; then ++ # Broken: success on invalid input. ++continue ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ # Passes both tests. ++ac_preproc_ok=: ++break + fi +-rm -f conftest* ++rm -f conftest.err conftest.$ac_ext ++ ++done ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. ++rm -f conftest.err conftest.$ac_ext ++if $ac_preproc_ok; then ++ break + fi +-rm -f conftest* +- ac_cv_prog_CPP="$CPP" ++ ++ done ++ ac_cv_prog_CPP=$CPP ++ ++fi ++ CPP=$ac_cv_prog_CPP ++else ++ ac_cv_prog_CPP=$CPP ++fi ++echo "$as_me:$LINENO: result: $CPP" >&5 ++echo "${ECHO_T}$CPP" >&6 ++ac_preproc_ok=false ++for ac_c_preproc_warn_flag in '' yes ++do ++ # Use a header file that comes with gcc, so configuring glibc ++ # with a fresh cross-compiler works. ++ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since ++ # <limits.h> exists even on freestanding compilers. ++ # On the NeXT, cc -E runs the code through the compiler's parser, ++ # not just through cpp. "Syntax error" is here to catch this case. ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#ifdef __STDC__ ++# include <limits.h> ++#else ++# include <assert.h> ++#endif ++ Syntax error ++_ACEOF ++if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 ++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null; then ++ if test -s conftest.err; then ++ ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag ++ else ++ ac_cpp_err= ++ fi ++else ++ ac_cpp_err=yes ++fi ++if test -z "$ac_cpp_err"; then ++ : ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ # Broken: fails on valid input. ++continue ++fi ++rm -f conftest.err conftest.$ac_ext ++ ++ # OK, works on sane cases. Now check whether non-existent headers ++ # can be detected and how. ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <ac_nonexistent.h> ++_ACEOF ++if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 ++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null; then ++ if test -s conftest.err; then ++ ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag ++ else ++ ac_cpp_err= ++ fi ++else ++ ac_cpp_err=yes + fi +- CPP="$ac_cv_prog_CPP" ++if test -z "$ac_cpp_err"; then ++ # Broken: success on invalid input. ++continue + else +- ac_cv_prog_CPP="$CPP" ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ # Passes both tests. ++ac_preproc_ok=: ++break + fi +-echo "$ac_t""$CPP" 1>&6 ++rm -f conftest.err conftest.$ac_ext + +-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +-echo "configure:1059: 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 ++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 +- cat > conftest.$ac_ext <<EOF +-#line 1064 "configure" +-#include "confdefs.h" ++ { { echo "$as_me:$LINENO: error: C preprocessor "$CPP" fails sanity check ++See `config.log' for more details." >&5 ++echo "$as_me: error: C preprocessor "$CPP" fails sanity check ++See `config.log' for more details." >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++ ++ ++echo "$as_me:$LINENO: checking for egrep" >&5 ++echo $ECHO_N "checking for egrep... $ECHO_C" >&6 ++if test "${ac_cv_prog_egrep+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if echo a | (grep -E '(a|b)') >/dev/null 2>&1 ++ then ac_cv_prog_egrep='grep -E' ++ else ac_cv_prog_egrep='egrep' ++ fi ++fi ++echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 ++echo "${ECHO_T}$ac_cv_prog_egrep" >&6 ++ EGREP=$ac_cv_prog_egrep ++ ++ ++echo "$as_me:$LINENO: checking for ANSI C header files" >&5 ++echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 ++if test "${ac_cv_header_stdc+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ + #include <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:1072: "$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 { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then + ac_cv_header_stdc=yes + else +- echo "$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 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 1089 "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* + + 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 1107 "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* + + 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 1128 "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)) ++#if ((' ' & 0x0FF) == 0x020) ++# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') ++# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) ++#else ++# define ISLOWER(c) \ ++ (('a' <= (c) && (c) <= 'i') \ ++ || ('j' <= (c) && (c) <= 'r') \ ++ || ('s' <= (c) && (c) <= 'z')) ++# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) ++#endif ++ + #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +-int main () { int i; for (i = 0; i < 256; i++) +-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +-exit (0); } +- +-EOF +-if { (eval echo configure:1139: "$ac_link") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then ++int ++main () ++{ ++ int i; ++ for (i = 0; i < 256; i++) ++ if (XOR (islower (i), ISLOWER (i)) ++ || toupper (i) != TOUPPER (i)) ++ exit(2); ++ exit (0); ++} ++_ACEOF ++rm -f conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: "$ac_link"") >&5 ++ (eval $ac_link) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && { ac_try='./conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then + : + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- ac_cv_header_stdc=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_header_stdc=no + fi +-rm -fr conftest* ++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi +- + fi + fi +- +-echo "$ac_t""$ac_cv_header_stdc" 1>&6 ++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 <<\EOF ++ ++cat >>confdefs.h <<_ACEOF + #define STDC_HEADERS 1 +-EOF ++_ACEOF + + fi + + +-ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 +-echo "configure:1165: checking for dlfcn.h" >&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 1170 "configure" +-#include "confdefs.h" +-#include <dlfcn.h> +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1175: "$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 +- : +-else +- echo "$ac_t""no" 1>&6 +-{ echo "configure: error: "dlfcn.h not found"" 1>&2; exit 1; } +-fi ++# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + +-ac_safe=`echo "sys/socket.h" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for sys/socket.h""... $ac_c" 1>&6 +-echo "configure:1200: checking for sys/socket.h" >&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 1205 "configure" +-#include "confdefs.h" +-#include <sys/socket.h> +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1210: "$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* ++ ++ ++ ++ ++ ++ ++ ++for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ ++ inttypes.h stdint.h unistd.h ++do ++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` ++echo "$as_me:$LINENO: checking for $ac_header" >&5 ++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 ++if eval "test "${$as_ac_Header+set}" = set"; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++ ++#include <$ac_header> ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ eval "$as_ac_Header=yes" ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++eval "$as_ac_Header=no" ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 ++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 ++if test `eval echo '${'$as_ac_Header'}'` = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++ ++done ++ ++ ++if test "${ac_cv_header_dlfcn_h+set}" = set; then ++ echo "$as_me:$LINENO: checking for dlfcn.h" >&5 ++echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 ++if test "${ac_cv_header_dlfcn_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 ++echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 ++else ++ # Is the header compilable? ++echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 ++echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include <dlfcn.h> ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_header_compiler=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6 ++ ++# Is the header present? ++echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 ++echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <dlfcn.h> ++_ACEOF ++if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 ++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null; then ++ if test -s conftest.err; then ++ ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag ++ else ++ ac_cpp_err= ++ fi ++else ++ ac_cpp_err=yes ++fi ++if test -z "$ac_cpp_err"; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++rm -f conftest.err conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6 ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: dlfcn.h: section "Present But Cannot Be Compiled"" >&5 ++echo "$as_me: WARNING: dlfcn.h: section "Present But Cannot Be Compiled"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ++ ( ++ cat <<_ASBOX ++## ------------------------------------------ ## ++## Report this to the AC_PACKAGE_NAME lists. ## ++## ------------------------------------------ ## ++_ASBOX ++ ) | ++ sed "s/^/$as_me: WARNING: /" >&2 ++ ;; ++esac ++echo "$as_me:$LINENO: checking for dlfcn.h" >&5 ++echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 ++if test "${ac_cv_header_dlfcn_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_header_dlfcn_h=$ac_header_preproc ++fi ++echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 ++echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 ++ + fi +-if eval "test "`echo '$ac_cv_header_'$ac_safe`" = yes"; then +- echo "$ac_t""yes" 1>&6 ++if test $ac_cv_header_dlfcn_h = yes; then + : + else +- echo "$ac_t""no" 1>&6 +-{ echo "configure: error: "sys/socket.h not found"" 1>&2; exit 1; } ++ { { echo "$as_me:$LINENO: error: "dlfcn.h not found"" >&5 ++echo "$as_me: error: "dlfcn.h not found"" >&2;} ++ { (exit 1); exit 1; }; } + fi + + +-ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6 +-echo "configure:1235: checking for arpa/inet.h" >&5 +-if eval "test "`echo '$''{'ac_cv_header_$ac_safe'+set}'`" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++ ++if test "${ac_cv_header_sys_socket_h+set}" = set; then ++ echo "$as_me:$LINENO: checking for sys/socket.h" >&5 ++echo $ECHO_N "checking for sys/socket.h... $ECHO_C" >&6 ++if test "${ac_cv_header_sys_socket_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++echo "$as_me:$LINENO: result: $ac_cv_header_sys_socket_h" >&5 ++echo "${ECHO_T}$ac_cv_header_sys_socket_h" >&6 ++else ++ # Is the header compilable? ++echo "$as_me:$LINENO: checking sys/socket.h usability" >&5 ++echo $ECHO_N "checking sys/socket.h usability... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include <sys/socket.h> ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_header_compiler=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6 ++ ++# Is the header present? ++echo "$as_me:$LINENO: checking sys/socket.h presence" >&5 ++echo $ECHO_N "checking sys/socket.h presence... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <sys/socket.h> ++_ACEOF ++if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 ++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null; then ++ if test -s conftest.err; then ++ ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag ++ else ++ ac_cpp_err= ++ fi + else +- cat > conftest.$ac_ext <<EOF +-#line 1240 "configure" +-#include "confdefs.h" +-#include <arpa/inet.h> +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1245: "$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" ++ ac_cpp_err=yes + fi +-rm -f conftest* ++if test -z "$ac_cpp_err"; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++rm -f conftest.err conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6 ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: sys/socket.h: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: sys/socket.h: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/socket.h: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: sys/socket.h: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: sys/socket.h: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: sys/socket.h: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/socket.h: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: sys/socket.h: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/socket.h: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: sys/socket.h: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/socket.h: section "Present But Cannot Be Compiled"" >&5 ++echo "$as_me: WARNING: sys/socket.h: section "Present But Cannot Be Compiled"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/socket.h: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: sys/socket.h: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/socket.h: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: sys/socket.h: in the future, the compiler will take precedence" >&2;} ++ ( ++ cat <<_ASBOX ++## ------------------------------------------ ## ++## Report this to the AC_PACKAGE_NAME lists. ## ++## ------------------------------------------ ## ++_ASBOX ++ ) | ++ sed "s/^/$as_me: WARNING: /" >&2 ++ ;; ++esac ++echo "$as_me:$LINENO: checking for sys/socket.h" >&5 ++echo $ECHO_N "checking for sys/socket.h... $ECHO_C" >&6 ++if test "${ac_cv_header_sys_socket_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_header_sys_socket_h=$ac_header_preproc + fi +-if eval "test "`echo '$ac_cv_header_'$ac_safe`" = yes"; then +- echo "$ac_t""yes" 1>&6 ++echo "$as_me:$LINENO: result: $ac_cv_header_sys_socket_h" >&5 ++echo "${ECHO_T}$ac_cv_header_sys_socket_h" >&6 ++ ++fi ++if test $ac_cv_header_sys_socket_h = yes; then + : + else +- echo "$ac_t""no" 1>&6 +-{ echo "configure: error: "arpa/inet.h not found"" 1>&2; exit 1; } ++ { { echo "$as_me:$LINENO: error: "sys/socket.h not found"" >&5 ++echo "$as_me: error: "sys/socket.h not found"" >&2;} ++ { (exit 1); exit 1; }; } + fi + + +-ac_safe=`echo "fcntl.h" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for fcntl.h""... $ac_c" 1>&6 +-echo "configure:1270: checking for fcntl.h" >&5 +-if eval "test "`echo '$''{'ac_cv_header_$ac_safe'+set}'`" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++ ++if test "${ac_cv_header_arpa_inet_h+set}" = set; then ++ echo "$as_me:$LINENO: checking for arpa/inet.h" >&5 ++echo $ECHO_N "checking for arpa/inet.h... $ECHO_C" >&6 ++if test "${ac_cv_header_arpa_inet_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5 ++echo "${ECHO_T}$ac_cv_header_arpa_inet_h" >&6 ++else ++ # Is the header compilable? ++echo "$as_me:$LINENO: checking arpa/inet.h usability" >&5 ++echo $ECHO_N "checking arpa/inet.h usability... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include <arpa/inet.h> ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_header_compiler=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6 ++ ++# Is the header present? ++echo "$as_me:$LINENO: checking arpa/inet.h presence" >&5 ++echo $ECHO_N "checking arpa/inet.h presence... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <arpa/inet.h> ++_ACEOF ++if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 ++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null; then ++ if test -s conftest.err; then ++ ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag ++ else ++ ac_cpp_err= ++ fi + else +- cat > conftest.$ac_ext <<EOF +-#line 1275 "configure" +-#include "confdefs.h" +-#include <fcntl.h> +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1280: "$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" ++ ac_cpp_err=yes + fi +-rm -f conftest* ++if test -z "$ac_cpp_err"; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++rm -f conftest.err conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6 ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: arpa/inet.h: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: arpa/inet.h: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: arpa/inet.h: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: arpa/inet.h: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: arpa/inet.h: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: section "Present But Cannot Be Compiled"" >&5 ++echo "$as_me: WARNING: arpa/inet.h: section "Present But Cannot Be Compiled"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: arpa/inet.h: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: arpa/inet.h: in the future, the compiler will take precedence" >&2;} ++ ( ++ cat <<_ASBOX ++## ------------------------------------------ ## ++## Report this to the AC_PACKAGE_NAME lists. ## ++## ------------------------------------------ ## ++_ASBOX ++ ) | ++ sed "s/^/$as_me: WARNING: /" >&2 ++ ;; ++esac ++echo "$as_me:$LINENO: checking for arpa/inet.h" >&5 ++echo $ECHO_N "checking for arpa/inet.h... $ECHO_C" >&6 ++if test "${ac_cv_header_arpa_inet_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_header_arpa_inet_h=$ac_header_preproc + fi +-if eval "test "`echo '$ac_cv_header_'$ac_safe`" = yes"; then +- echo "$ac_t""yes" 1>&6 ++echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5 ++echo "${ECHO_T}$ac_cv_header_arpa_inet_h" >&6 ++ ++fi ++if test $ac_cv_header_arpa_inet_h = yes; then + : + else +- echo "$ac_t""no" 1>&6 +-{ echo "configure: error: "fcntl.h not found"" 1>&2; exit 1; } ++ { { echo "$as_me:$LINENO: error: "arpa/inet.h not found"" >&5 ++echo "$as_me: error: "arpa/inet.h not found"" >&2;} ++ { (exit 1); exit 1; }; } + fi + + +-ac_safe=`echo "sys/poll.h" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for sys/poll.h""... $ac_c" 1>&6 +-echo "configure:1305: checking for sys/poll.h" >&5 +-if eval "test "`echo '$''{'ac_cv_header_$ac_safe'+set}'`" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++ ++if test "${ac_cv_header_fcntl_h+set}" = set; then ++ echo "$as_me:$LINENO: checking for fcntl.h" >&5 ++echo $ECHO_N "checking for fcntl.h... $ECHO_C" >&6 ++if test "${ac_cv_header_fcntl_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++echo "$as_me:$LINENO: result: $ac_cv_header_fcntl_h" >&5 ++echo "${ECHO_T}$ac_cv_header_fcntl_h" >&6 ++else ++ # Is the header compilable? ++echo "$as_me:$LINENO: checking fcntl.h usability" >&5 ++echo $ECHO_N "checking fcntl.h usability... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include <fcntl.h> ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_header_compiler=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6 ++ ++# Is the header present? ++echo "$as_me:$LINENO: checking fcntl.h presence" >&5 ++echo $ECHO_N "checking fcntl.h presence... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <fcntl.h> ++_ACEOF ++if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 ++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null; then ++ if test -s conftest.err; then ++ ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag ++ else ++ ac_cpp_err= ++ fi + else +- cat > conftest.$ac_ext <<EOF +-#line 1310 "configure" +-#include "confdefs.h" ++ ac_cpp_err=yes ++fi ++if test -z "$ac_cpp_err"; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++rm -f conftest.err conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6 ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: fcntl.h: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: fcntl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: fcntl.h: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: fcntl.h: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: fcntl.h: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: fcntl.h: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: fcntl.h: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: fcntl.h: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: fcntl.h: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: fcntl.h: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: fcntl.h: section "Present But Cannot Be Compiled"" >&5 ++echo "$as_me: WARNING: fcntl.h: section "Present But Cannot Be Compiled"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: fcntl.h: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: fcntl.h: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: fcntl.h: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: fcntl.h: in the future, the compiler will take precedence" >&2;} ++ ( ++ cat <<_ASBOX ++## ------------------------------------------ ## ++## Report this to the AC_PACKAGE_NAME lists. ## ++## ------------------------------------------ ## ++_ASBOX ++ ) | ++ sed "s/^/$as_me: WARNING: /" >&2 ++ ;; ++esac ++echo "$as_me:$LINENO: checking for fcntl.h" >&5 ++echo $ECHO_N "checking for fcntl.h... $ECHO_C" >&6 ++if test "${ac_cv_header_fcntl_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_header_fcntl_h=$ac_header_preproc ++fi ++echo "$as_me:$LINENO: result: $ac_cv_header_fcntl_h" >&5 ++echo "${ECHO_T}$ac_cv_header_fcntl_h" >&6 ++ ++fi ++if test $ac_cv_header_fcntl_h = yes; then ++ : ++else ++ { { echo "$as_me:$LINENO: error: "fcntl.h not found"" >&5 ++echo "$as_me: error: "fcntl.h not found"" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++ ++ ++if test "${ac_cv_header_sys_poll_h+set}" = set; then ++ echo "$as_me:$LINENO: checking for sys/poll.h" >&5 ++echo $ECHO_N "checking for sys/poll.h... $ECHO_C" >&6 ++if test "${ac_cv_header_sys_poll_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++echo "$as_me:$LINENO: result: $ac_cv_header_sys_poll_h" >&5 ++echo "${ECHO_T}$ac_cv_header_sys_poll_h" >&6 ++else ++ # Is the header compilable? ++echo "$as_me:$LINENO: checking sys/poll.h usability" >&5 ++echo $ECHO_N "checking sys/poll.h usability... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include <sys/poll.h> ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_header_compiler=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6 ++ ++# Is the header present? ++echo "$as_me:$LINENO: checking sys/poll.h presence" >&5 ++echo $ECHO_N "checking sys/poll.h presence... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ + #include <sys/poll.h> +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1315: "$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" ++_ACEOF ++if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 ++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null; then ++ if test -s conftest.err; then ++ ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag ++ else ++ ac_cpp_err= ++ fi ++else ++ ac_cpp_err=yes + fi +-rm -f conftest* ++if test -z "$ac_cpp_err"; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++rm -f conftest.err conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6 ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: sys/poll.h: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: sys/poll.h: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/poll.h: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: sys/poll.h: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: sys/poll.h: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: sys/poll.h: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/poll.h: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: sys/poll.h: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/poll.h: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: sys/poll.h: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/poll.h: section "Present But Cannot Be Compiled"" >&5 ++echo "$as_me: WARNING: sys/poll.h: section "Present But Cannot Be Compiled"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/poll.h: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: sys/poll.h: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/poll.h: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: sys/poll.h: in the future, the compiler will take precedence" >&2;} ++ ( ++ cat <<_ASBOX ++## ------------------------------------------ ## ++## Report this to the AC_PACKAGE_NAME lists. ## ++## ------------------------------------------ ## ++_ASBOX ++ ) | ++ sed "s/^/$as_me: WARNING: /" >&2 ++ ;; ++esac ++echo "$as_me:$LINENO: checking for sys/poll.h" >&5 ++echo $ECHO_N "checking for sys/poll.h... $ECHO_C" >&6 ++if test "${ac_cv_header_sys_poll_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_header_sys_poll_h=$ac_header_preproc ++fi ++echo "$as_me:$LINENO: result: $ac_cv_header_sys_poll_h" >&5 ++echo "${ECHO_T}$ac_cv_header_sys_poll_h" >&6 ++ + fi +-if eval "test "`echo '$ac_cv_header_'$ac_safe`" = yes"; then +- echo "$ac_t""yes" 1>&6 ++if test $ac_cv_header_sys_poll_h = yes; then + : + else +- echo "$ac_t""no" 1>&6 +-{ echo "configure: error: "sys/poll.h not found"" 1>&2; exit 1; } ++ { { echo "$as_me:$LINENO: error: "sys/poll.h not found"" >&5 ++echo "$as_me: error: "sys/poll.h not found"" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++ ++ ++if test "${ac_cv_header_sys_mman_h+set}" = set; then ++ echo "$as_me:$LINENO: checking for sys/mman.h" >&5 ++echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6 ++if test "${ac_cv_header_sys_mman_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5 ++echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6 ++else ++ # Is the header compilable? ++echo "$as_me:$LINENO: checking sys/mman.h usability" >&5 ++echo $ECHO_N "checking sys/mman.h usability... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include <sys/mman.h> ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_header_compiler=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6 ++ ++# Is the header present? ++echo "$as_me:$LINENO: checking sys/mman.h presence" >&5 ++echo $ECHO_N "checking sys/mman.h presence... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <sys/mman.h> ++_ACEOF ++if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 ++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null; then ++ if test -s conftest.err; then ++ ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag ++ else ++ ac_cpp_err= ++ fi ++else ++ ac_cpp_err=yes + fi ++if test -z "$ac_cpp_err"; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 + ++ ac_header_preproc=no ++fi ++rm -f conftest.err conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6 ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: sys/mman.h: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: sys/mman.h: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/mman.h: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: sys/mman.h: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: sys/mman.h: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: sys/mman.h: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/mman.h: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: sys/mman.h: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/mman.h: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: sys/mman.h: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/mman.h: section "Present But Cannot Be Compiled"" >&5 ++echo "$as_me: WARNING: sys/mman.h: section "Present But Cannot Be Compiled"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/mman.h: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: sys/mman.h: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: sys/mman.h: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: sys/mman.h: in the future, the compiler will take precedence" >&2;} ++ ( ++ cat <<_ASBOX ++## ------------------------------------------ ## ++## Report this to the AC_PACKAGE_NAME lists. ## ++## ------------------------------------------ ## ++_ASBOX ++ ) | ++ sed "s/^/$as_me: WARNING: /" >&2 ++ ;; ++esac ++echo "$as_me:$LINENO: checking for sys/mman.h" >&5 ++echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6 ++if test "${ac_cv_header_sys_mman_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_header_sys_mman_h=$ac_header_preproc ++fi ++echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5 ++echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6 + +-for ac_hdr in unistd.h +-do +-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:1342: 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 1347 "configure" +-#include "confdefs.h" +-#include <$ac_hdr> +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1352: "$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* ++if test $ac_cv_header_sys_mman_h = yes; then ++ : ++else ++ { { echo "$as_me:$LINENO: error: "sys/mman.h not found"" >&5 ++echo "$as_me: error: "sys/mman.h not found"" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++ ++ ++ ++for ac_header in unistd.h ++do ++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` ++if eval "test "${$as_ac_Header+set}" = set"; then ++ echo "$as_me:$LINENO: checking for $ac_header" >&5 ++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 ++if eval "test "${$as_ac_Header+set}" = set"; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 ++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 ++else ++ # Is the header compilable? ++echo "$as_me:$LINENO: checking $ac_header usability" >&5 ++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include <$ac_header> ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_header_compiler=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6 ++ ++# Is the header present? ++echo "$as_me:$LINENO: checking $ac_header presence" >&5 ++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <$ac_header> ++_ACEOF ++if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 ++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null; then ++ if test -s conftest.err; then ++ ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag ++ else ++ ac_cpp_err= ++ fi ++else ++ ac_cpp_err=yes + fi +-if 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 +- ++if test -z "$ac_cpp_err"; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++rm -f conftest.err conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6 ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: section "Present But Cannot Be Compiled"" >&5 ++echo "$as_me: WARNING: $ac_header: section "Present But Cannot Be Compiled"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ++ ( ++ cat <<_ASBOX ++## ------------------------------------------ ## ++## Report this to the AC_PACKAGE_NAME lists. ## ++## ------------------------------------------ ## ++_ASBOX ++ ) | ++ sed "s/^/$as_me: WARNING: /" >&2 ++ ;; ++esac ++echo "$as_me:$LINENO: checking for $ac_header" >&5 ++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 ++if eval "test "${$as_ac_Header+set}" = set"; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- echo "$ac_t""no" 1>&6 ++ eval "$as_ac_Header=$ac_header_preproc" + fi ++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 ++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 ++ ++fi ++if test `eval echo '${'$as_ac_Header'}'` = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++ + done + + +-for ac_func in strcspn strdup strerror strspn strtol ++ ++ ++ ++ ++ ++ ++ ++ ++ ++for ac_func in strcspn strdup strerror strspn strtol mmap strcasecmp \ ++ strncasecmp strtol + do +-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:1382: 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 1387 "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 eval "test "${$as_ac_var+set}" = set"; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. ++ For example, HP-UX 11i <limits.h> declares gettimeofday. */ ++#define $ac_func innocuous_$ac_func ++ + /* System header to define __stub macros and hopefully few prototypes, +- which can conflict with char $ac_func(); below. */ +-#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 gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func (); + /* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ + #if defined (__stub_$ac_func) || defined (__stub___$ac_func) + choke me + #else +-$ac_func(); ++char (*f) () = $ac_func; ++#endif ++#ifdef __cplusplus ++} + #endif + +-; return 0; } +-EOF +-if { (eval echo configure:1410: "$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" ++int ++main () ++{ ++return f != $ac_func; ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: "$ac_link"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ eval "$as_ac_var=yes" ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++eval "$as_ac_var=no" ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 ++echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 ++if test `eval echo '${'$as_ac_var'}'` = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 ++_ACEOF ++ ++else ++ { { echo "$as_me:$LINENO: error: "Required function not found"" >&5 ++echo "$as_me: error: "Required function not found"" >&2;} ++ { (exit 1); exit 1; }; } + fi +-rm -f conftest* ++done ++ ++ ++ ++ ++ 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 many arguments gethostbyname_r() takes" >&5 ++echo $ECHO_N "checking how many arguments gethostbyname_r() takes... $ECHO_C" >&6 ++ ++ if test "${ac_cv_func_which_gethostbyname_r+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ++ ++ ++ac_cv_func_which_gethostbyname_r=unknown ++ ++# ++# ONE ARGUMENT (sanity check) ++# ++ ++# This should fail, as there is no variant of gethostbyname_r() that takes ++# a single argument. If it actually compiles, then we can assume that ++# netdb.h is not declaring the function, and the compiler is thereby ++# assuming an implicit prototype. In which case, we're out of luck. ++# ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <netdb.h> ++int ++main () ++{ ++ ++ char *name = "www.gnu.org"; ++ (void)gethostbyname_r(name) /* ; */ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_func_which_gethostbyname_r=no ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ + fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++# ++# SIX ARGUMENTS ++# (e.g. Linux) ++# ++ ++if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then + +-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 +- ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <netdb.h> ++int ++main () ++{ ++ ++ char *name = "www.gnu.org"; ++ struct hostent ret, *retp; ++ char buf[1024]; ++ int buflen = 1024; ++ int my_h_errno; ++ (void)gethostbyname_r(name, &ret, buf, buflen, &retp, &my_h_errno) /* ; */ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_func_which_gethostbyname_r=six + else +- echo "$ac_t""no" 1>&6 +-{ echo "configure: error: "Required function not found"" 1>&2; exit 1; } ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ + fi +-done ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++ ++# ++# FIVE ARGUMENTS ++# (e.g. Solaris) ++# ++ ++if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then ++ ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <netdb.h> ++int ++main () ++{ ++ ++ char *name = "www.gnu.org"; ++ struct hostent ret; ++ char buf[1024]; ++ int buflen = 1024; ++ int my_h_errno; ++ (void)gethostbyname_r(name, &ret, buf, buflen, &my_h_errno) /* ; */ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_func_which_gethostbyname_r=five ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++ ++# ++# THREE ARGUMENTS ++# (e.g. AIX, HP-UX, Tru64) ++# ++ ++if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then ++ ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <netdb.h> ++int ++main () ++{ ++ ++ char *name = "www.gnu.org"; ++ struct hostent ret; ++ struct hostent_data data; ++ (void)gethostbyname_r(name, &ret, &data) /* ; */ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_func_which_gethostbyname_r=three ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++ ++ ++ ++fi ++ ++case "$ac_cv_func_which_gethostbyname_r" in ++ three) ++ echo "$as_me:$LINENO: result: three" >&5 ++echo "${ECHO_T}three" >&6 ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_FUNC_GETHOSTBYNAME_R_3 1 ++_ACEOF ++ ++ ;; ++ ++ five) ++ echo "$as_me:$LINENO: result: five" >&5 ++echo "${ECHO_T}five" >&6 ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_FUNC_GETHOSTBYNAME_R_5 1 ++_ACEOF ++ ++ ;; ++ ++ six) ++ echo "$as_me:$LINENO: result: six" >&5 ++echo "${ECHO_T}six" >&6 ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_FUNC_GETHOSTBYNAME_R_6 1 ++_ACEOF ++ ++ ;; ++ ++ no) ++ echo "$as_me:$LINENO: result: cannot find function declaration in netdb.h" >&5 ++echo "${ECHO_T}cannot find function declaration in netdb.h" >&6 ++ ;; ++ ++ unknown) ++ echo "$as_me:$LINENO: result: can't tell" >&5 ++echo "${ECHO_T}can't tell" >&6 ++ ;; ++ ++ *) ++ { { echo "$as_me:$LINENO: error: internal error" >&5 ++echo "$as_me: error: internal error" >&2;} ++ { (exit 1); exit 1; }; } ++ ;; ++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 ++ ++ + + + OLDLIBS="${LIBS}" + LIBS= + CONNECTLIB= + for LIB in c socket; do +- echo $ac_n "checking for connect in -l"${LIB}"""... $ac_c" 1>&6 +-echo "configure:1441: checking for connect in -l"${LIB}"" >&5 +-ac_lib_var=`echo "${LIB}"'_'connect | sed 'y%./+-%__p_%'` +-if eval "test "`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++ as_ac_Lib=`echo "ac_cv_lib_"${LIB}"''_connect" | $as_tr_sh` ++echo "$as_me:$LINENO: checking for connect in -l"${LIB}"" >&5 ++echo $ECHO_N "checking for connect in -l"${LIB}"... $ECHO_C" >&6 ++if eval "test "${$as_ac_Lib+set}" = set"; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- ac_save_LIBS="$LIBS" ++ ac_check_lib_save_LIBS=$LIBS + LIBS="-l"${LIB}" $LIBS" +-cat > conftest.$ac_ext <<EOF +-#line 1449 "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. */ ++ + /* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++#endif + /* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char connect(); +- +-int main() { +-connect() +-; return 0; } +-EOF +-if { (eval echo configure:1460: "$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" ++ builtin and then its argument prototype would still apply. */ ++char connect (); ++int ++main () ++{ ++connect (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: "$ac_link"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ eval "$as_ac_Lib=yes" ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++eval "$as_ac_Lib=no" ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 ++echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 ++if test `eval echo '${'$as_ac_Lib'}'` = yes; then + +-fi +-if eval "test "`echo '$ac_cv_lib_'$ac_lib_var`" = yes"; then +- echo "$ac_t""yes" 1>&6 +- + CONNECTLIB="${LIB}" + break +- +-else +- echo "$ac_t""no" 1>&6 ++ + fi + + done + LIBS="${OLDLIBS} -l${CONNECTLIB}" + if test "${CONNECTLIB}" = ""; then +- { echo "configure: error: 'Could not find library containing connect()'" 1>&2; exit 1; } +-fi ++ { { echo "$as_me:$LINENO: error: 'Could not find library containing connect()'" >&5 ++echo "$as_me: error: 'Could not find library containing connect()'" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++echo "$as_me:$LINENO: checking for socket" >&5 ++echo $ECHO_N "checking for socket... $ECHO_C" >&6 ++if test "${ac_cv_func_socket+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 socket to an innocuous variant, in case <limits.h> declares socket. ++ For example, HP-UX 11i <limits.h> declares gettimeofday. */ ++#define socket innocuous_socket + +-echo $ac_n "checking for socket""... $ac_c" 1>&6 +-echo "configure:1490: 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 1495 "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(); ++ which can conflict with char socket (); 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 socket ++ ++/* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char socket (); + /* 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 + #else +-socket(); ++char (*f) () = socket; ++#endif ++#ifdef __cplusplus ++} + #endif + +-; return 0; } +-EOF +-if { (eval echo configure:1518: "$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 ++int ++main () ++{ ++return f != socket; ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: "$ac_link"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_func_socket=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_func_socket=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++echo "$as_me:$LINENO: result: $ac_cv_func_socket" >&5 ++echo "${ECHO_T}$ac_cv_func_socket" >&6 ++if test $ac_cv_func_socket = yes; then + : + else +- echo "$ac_t""no" 1>&6 + +- echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 +-echo "configure:1537: 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 ++ ++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 $LIBS" +-cat > conftest.$ac_ext <<EOF +-#line 1545 "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. */ ++ + /* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++#endif + /* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char socket(); +- +-int main() { +-socket() +-; return 0; } +-EOF +-if { (eval echo configure:1556: "$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 ++ builtin and then its argument prototype would still apply. */ ++char socket (); ++int ++main () ++{ ++socket (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: "$ac_link"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_lib_socket_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 conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 ++echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 ++if test $ac_cv_lib_socket_socket = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_LIBSOCKET 1 ++_ACEOF + + LIBS="-lsocket $LIBS" + + else +- echo "$ac_t""no" 1>&6 +-{ echo "configure: error: "socket function not found"" 1>&2; exit 1; } ++ { { echo "$as_me:$LINENO: error: "socket function not found"" >&5 ++echo "$as_me: error: "socket function not found"" >&2;} ++ { (exit 1); exit 1; }; } + fi + + fi + + +-echo $ac_n "checking for inet_aton""... $ac_c" 1>&6 +-echo "configure:1588: checking for inet_aton" >&5 +-if eval "test "`echo '$''{'ac_cv_func_inet_aton'+set}'`" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking for inet_aton" >&5 ++echo $ECHO_N "checking for inet_aton... $ECHO_C" >&6 ++if test "${ac_cv_func_inet_aton+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- cat > conftest.$ac_ext <<EOF +-#line 1593 "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. */ ++/* Define inet_aton to an innocuous variant, in case <limits.h> declares inet_aton. ++ For example, HP-UX 11i <limits.h> declares gettimeofday. */ ++#define inet_aton innocuous_inet_aton ++ + /* System header to define __stub macros and hopefully few prototypes, +- which can conflict with char inet_aton(); 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 inet_aton(); ++ which can conflict with char inet_aton (); 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 inet_aton ++ ++/* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char inet_aton (); + /* 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_inet_aton) || defined (__stub___inet_aton) + choke me + #else +-inet_aton(); ++char (*f) () = inet_aton; ++#endif ++#ifdef __cplusplus ++} + #endif + +-; return 0; } +-EOF +-if { (eval echo configure:1616: "$ac_link") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_inet_aton=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_inet_aton=no" +-fi +-rm -f conftest* +-fi +- +-if eval "test "`echo '$ac_cv_func_'inet_aton`" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF ++int ++main () ++{ ++return f != inet_aton; ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: "$ac_link"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_func_inet_aton=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_func_inet_aton=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++echo "$as_me:$LINENO: result: $ac_cv_func_inet_aton" >&5 ++echo "${ECHO_T}$ac_cv_func_inet_aton" >&6 ++if test $ac_cv_func_inet_aton = yes; then ++ cat >>confdefs.h <<_ACEOF + #define HAVE_INET_ATON 1 +-EOF ++_ACEOF + + else +- echo "$ac_t""no" 1>&6 + +- echo $ac_n "checking for inet_addr""... $ac_c" 1>&6 +-echo "configure:1638: checking for inet_addr" >&5 +-if eval "test "`echo '$''{'ac_cv_func_inet_addr'+set}'`" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext <<EOF +-#line 1643 "configure" +-#include "confdefs.h" ++ echo "$as_me:$LINENO: checking for inet_addr" >&5 ++echo $ECHO_N "checking for inet_addr... $ECHO_C" >&6 ++if test "${ac_cv_func_inet_addr+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 inet_addr to an innocuous variant, in case <limits.h> declares inet_addr. ++ For example, HP-UX 11i <limits.h> declares gettimeofday. */ ++#define inet_addr innocuous_inet_addr ++ + /* System header to define __stub macros and hopefully few prototypes, +- which can conflict with char inet_addr(); 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 inet_addr(); ++ which can conflict with char inet_addr (); 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 inet_addr + ++/* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char inet_addr (); + /* 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_inet_addr) || defined (__stub___inet_addr) + choke me + #else +-inet_addr(); ++char (*f) () = inet_addr; ++#endif ++#ifdef __cplusplus ++} + #endif + +-; return 0; } +-EOF +-if { (eval echo configure:1666: "$ac_link") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_inet_addr=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_inet_addr=no" +-fi +-rm -f conftest* +-fi +- +-if eval "test "`echo '$ac_cv_func_'inet_addr`" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF ++int ++main () ++{ ++return f != inet_addr; ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: "$ac_link"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_func_inet_addr=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_func_inet_addr=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++echo "$as_me:$LINENO: result: $ac_cv_func_inet_addr" >&5 ++echo "${ECHO_T}$ac_cv_func_inet_addr" >&6 ++if test $ac_cv_func_inet_addr = yes; then ++ cat >>confdefs.h <<_ACEOF + #define HAVE_INET_ADDR 1 +-EOF ++_ACEOF + + else +- echo "$ac_t""no" 1>&6 + +- echo $ac_n "checking for inet_addr in -lnsl""... $ac_c" 1>&6 +-echo "configure:1688: checking for inet_addr in -lnsl" >&5 +-ac_lib_var=`echo nsl'_'inet_addr | 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 inet_addr in -lnsl" >&5 ++echo $ECHO_N "checking for inet_addr in -lnsl... $ECHO_C" >&6 ++if test "${ac_cv_lib_nsl_inet_addr+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- ac_save_LIBS="$LIBS" +-LIBS="-lnsl $LIBS" +-cat > conftest.$ac_ext <<EOF +-#line 1696 "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 inet_addr(); +- +-int main() { +-inet_addr() +-; return 0; } +-EOF +-if { (eval echo configure:1707: "$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" ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lnsl $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ + +-fi +-if eval "test "`echo '$ac_cv_lib_'$ac_lib_var`" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF ++/* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char inet_addr (); ++int ++main () ++{ ++inet_addr (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: "$ac_link"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_lib_nsl_inet_addr=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_lib_nsl_inet_addr=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_inet_addr" >&5 ++echo "${ECHO_T}$ac_cv_lib_nsl_inet_addr" >&6 ++if test $ac_cv_lib_nsl_inet_addr = yes; then ++ cat >>confdefs.h <<_ACEOF + #define HAVE_INET_ADDR 1 +-EOF ++_ACEOF + +- LIBS="${LIBS} -lnsl" ++ LIBS="${LIBS} -lnsl" + else +- echo "$ac_t""no" 1>&6 + +- { echo "configure: error: "Neither inet_aton or inet_addr present"" 1>&2; exit 1; } ++ { { echo "$as_me:$LINENO: error: "Neither inet_aton or inet_addr present"" >&5 ++echo "$as_me: error: "Neither inet_aton or inet_addr present"" >&2;} ++ { (exit 1); exit 1; }; } + fi + + fi + + fi + + +-echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 +-echo "configure:1739: checking for gethostbyname" >&5 +-if eval "test "`echo '$''{'ac_cv_func_gethostbyname'+set}'`" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo "$as_me:$LINENO: checking for gethostbyname" >&5 ++echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 ++if test "${ac_cv_func_gethostbyname+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- cat > conftest.$ac_ext <<EOF +-#line 1744 "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. */ ++/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname. ++ For example, HP-UX 11i <limits.h> declares gettimeofday. */ ++#define gethostbyname innocuous_gethostbyname ++ + /* 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(); ++ which can conflict with char gethostbyname (); 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 gethostbyname ++ ++/* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char gethostbyname (); + /* 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(); ++char (*f) () = gethostbyname; ++#endif ++#ifdef __cplusplus ++} + #endif + +-; return 0; } +-EOF +-if { (eval echo configure:1767: "$ac_link") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_gethostbyname=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_gethostbyname=no" +-fi +-rm -f conftest* +-fi +- +-if eval "test "`echo '$ac_cv_func_'gethostbyname`" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF ++int ++main () ++{ ++return f != gethostbyname; ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: "$ac_link"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_func_gethostbyname=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_func_gethostbyname=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 ++echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 ++if test $ac_cv_func_gethostbyname = yes; then ++ cat >>confdefs.h <<_ACEOF + #define HAVE_GETHOSTBYNAME 1 +-EOF ++_ACEOF + + else +- echo "$ac_t""no" 1>&6 + +- echo $ac_n "checking for gethostbyname in -lxnet""... $ac_c" 1>&6 +-echo "configure:1789: checking for gethostbyname in -lxnet" >&5 +-ac_lib_var=`echo xnet'_'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 gethostbyname in -lxnet" >&5 ++echo $ECHO_N "checking for gethostbyname in -lxnet... $ECHO_C" >&6 ++if test "${ac_cv_lib_xnet_gethostbyname+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- ac_save_LIBS="$LIBS" ++ ac_check_lib_save_LIBS=$LIBS + LIBS="-lxnet $LIBS" +-cat > conftest.$ac_ext <<EOF +-#line 1797 "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. */ ++ + /* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++#endif + /* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char gethostbyname(); +- +-int main() { +-gethostbyname() +-; return 0; } +-EOF +-if { (eval echo configure:1808: "$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 >> confdefs.h <<\EOF ++ builtin and then its argument prototype would still apply. */ ++char gethostbyname (); ++int ++main () ++{ ++gethostbyname (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: "$ac_link"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_lib_xnet_gethostbyname=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_lib_xnet_gethostbyname=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++echo "$as_me:$LINENO: result: $ac_cv_lib_xnet_gethostbyname" >&5 ++echo "${ECHO_T}$ac_cv_lib_xnet_gethostbyname" >&6 ++if test $ac_cv_lib_xnet_gethostbyname = yes; then ++ cat >>confdefs.h <<_ACEOF + #define HAVE_GETHOSTBYNAME 1 +-EOF ++_ACEOF + + else +- echo "$ac_t""no" 1>&6 + +- { echo "configure: error: "gethostbyname not found, name lookups in " \ +- "tsocks and inspectsocks disabled"" 1>&2; exit 1; } ++ { { echo "$as_me:$LINENO: error: "gethostbyname not found, name lookups in " \ ++ "tsocks and inspectsocks disabled"" >&5 ++echo "$as_me: error: "gethostbyname not found, name lookups in " \ ++ "tsocks and inspectsocks disabled"" >&2;} ++ { (exit 1); exit 1; }; } + fi + + fi + + + SIMPLELIBS=${LIBS} + LIBS= + +-echo $ac_n "checking for dlsym in -ldl""... $ac_c" 1>&6 +-echo "configure:1841: checking for dlsym in -ldl" >&5 +-ac_lib_var=`echo dl'_'dlsym | 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 dlsym in -ldl" >&5 ++echo $ECHO_N "checking for dlsym in -ldl... $ECHO_C" >&6 ++if test "${ac_cv_lib_dl_dlsym+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- ac_save_LIBS="$LIBS" ++ ac_check_lib_save_LIBS=$LIBS + LIBS="-ldl $LIBS" +-cat > conftest.$ac_ext <<EOF +-#line 1849 "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. */ ++ + /* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++#endif + /* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char dlsym(); +- +-int main() { +-dlsym() +-; return 0; } +-EOF +-if { (eval echo configure:1860: "$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 dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ +- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` +- cat >> confdefs.h <<EOF +-#define $ac_tr_lib 1 +-EOF ++ builtin and then its argument prototype would still apply. */ ++char dlsym (); ++int ++main () ++{ ++dlsym (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: "$ac_link"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_lib_dl_dlsym=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_lib_dl_dlsym=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlsym" >&5 ++echo "${ECHO_T}$ac_cv_lib_dl_dlsym" >&6 ++if test $ac_cv_lib_dl_dlsym = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_LIBDL 1 ++_ACEOF + + LIBS="-ldl $LIBS" + + else +- echo "$ac_t""no" 1>&6 +-{ echo "configure: error: "libdl is required"" 1>&2; exit 1; } ++ { { echo "$as_me:$LINENO: error: "libdl is required"" >&5 ++echo "$as_me: error: "libdl is required"" >&2;} ++ { (exit 1); exit 1; }; } + fi + + +-echo $ac_n "checking "for RTLD_NEXT from dlfcn.h"""... $ac_c" 1>&6 +-echo "configure:1890: checking "for RTLD_NEXT from dlfcn.h"" >&5 +-cat > conftest.$ac_ext <<EOF +-#line 1892 "configure" +-#include "confdefs.h" ++echo "$as_me:$LINENO: checking for RTLD_NEXT from dlfcn.h" >&5 ++echo $ECHO_N "checking for RTLD_NEXT from dlfcn.h... $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 <dlfcn.h> + #ifdef RTLD_NEXT + yes + #endif + +-EOF ++_ACEOF + 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 ++ $EGREP "yes" >/dev/null 2>&1; then ++ ++ echo "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6 + + else +- rm -rf conftest* +- +- echo "$ac_t""no" 1>&6 +- echo $ac_n "checking "for RTLD_NEXT from dlfcn.h with _GNU_SOURCE"""... $ac_c" 1>&6 +-echo "configure:1912: checking "for RTLD_NEXT from dlfcn.h with _GNU_SOURCE"" >&5 +- cat > conftest.$ac_ext <<EOF +-#line 1914 "configure" +-#include "confdefs.h" ++ ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++ echo "$as_me:$LINENO: checking for RTLD_NEXT from dlfcn.h with _GNU_SOURCE" >&5 ++echo $ECHO_N "checking for RTLD_NEXT from dlfcn.h with _GNU_SOURCE... $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. */ + + #define _GNU_SOURCE + #include <dlfcn.h> + #ifdef RTLD_NEXT + yes + #endif +- +-EOF ++ ++_ACEOF + 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 ++ $EGREP "yes" >/dev/null 2>&1; then ++ ++ echo "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6 ++ cat >>confdefs.h <<_ACEOF + #define USE_GNU_SOURCE 1 +-EOF ++_ACEOF ++ + +- + else +- rm -rf conftest* +- +- echo "$ac_t""no" 1>&6 +- cat >> confdefs.h <<\EOF ++ ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++ cat >>confdefs.h <<_ACEOF + #define USE_OLD_DLSYM 1 +-EOF ++_ACEOF + + oldmethod="yes" +- ++ + fi + rm -f conftest* +- ++ + + fi + rm -f conftest* + + + if test "${enable_socksdns}" = "yes"; then +- cat >> confdefs.h <<\EOF ++ cat >>confdefs.h <<_ACEOF + #define USE_SOCKS_DNS 1 +-EOF ++_ACEOF ++ ++fi + ++echo "$as_me:$LINENO: checking whether to enable tordns" >&5 ++echo $ECHO_N "checking whether to enable tordns... $ECHO_C" >&6 ++if test "x${enable_tordns}" = "x"; then ++ cat >>confdefs.h <<_ACEOF ++#define USE_TOR_DNS 1 ++_ACEOF ++ ++ DEADPOOL_O="${DEADPOOL}.o" ++ echo "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6 ++else ++ DEADPOOL_O="" ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 + fi + ++ + if test "x${enable_envconf}" = "x"; then +- cat >> confdefs.h <<\EOF ++ cat >>confdefs.h <<_ACEOF + #define ALLOW_ENV_CONFIG 1 +-EOF ++_ACEOF + + fi + + if test "${enable_oldmethod}" = "yes"; then +- cat >> confdefs.h <<\EOF ++ cat >>confdefs.h <<_ACEOF + #define USE_OLD_DLSYM 1 +-EOF ++_ACEOF + + oldmethod="yes" + fi + + if test "x${enable_debug}" = "x"; then +- cat >> confdefs.h <<\EOF ++ cat >>confdefs.h <<_ACEOF + #define ALLOW_MSG_OUTPUT 1 +-EOF ++_ACEOF + + fi + +-if test "x${enable_hostnames}" = "x"; then +- cat >> confdefs.h <<\EOF ++if test "x${enable_hostnames}" = "xyes"; then ++ cat >>confdefs.h <<_ACEOF + #define HOSTNAMES 1 +-EOF ++_ACEOF + + fi + + if test "${enable_socksdns}" = "yes" -a \ +- "x${enable_hostnames}" = "x" ; then +- { echo "configure: error: "--enable-socksdns is not valid without --disable-hostnames"" 1>&2; exit 1; } ++ "x${enable_hostnames}" = "xyes" ; then ++ { { echo "$as_me:$LINENO: error: "--enable-socksdns is not valid with --enable-hostnames"" >&5 ++echo "$as_me: error: "--enable-socksdns is not valid with --enable-hostnames"" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++if test "x${enable_tordns}" = "x" -a \ ++ "x${enable_hostnames}" = "xyes" ; then ++ { { echo "$as_me:$LINENO: error: "--enable-tordns is not valid with --enable-hostnames"" >&5 ++echo "$as_me: error: "--enable-tordns is not valid with --enable-hostnames"" >&2;} ++ { (exit 1); exit 1; }; } + fi + +-if test "${oldmethod}" = "yes"; then +- ++if test "${oldmethod}" = "yes"; then ++ + # Extract the first word of "find", so it can be a program name with args. + set dummy find; ac_word=$2 +-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1998: checking for $ac_word" >&5 +-if eval "test "`echo '$''{'ac_cv_prog_FIND'+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_FIND+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$FIND"; then + ac_cv_prog_FIND="$FIND" # 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_FIND="find" +- 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_FIND="find" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ + fi + fi +-FIND="$ac_cv_prog_FIND" ++FIND=$ac_cv_prog_FIND + if test -n "$FIND"; then +- echo "$ac_t""$FIND" 1>&6 ++ echo "$as_me:$LINENO: result: $FIND" >&5 ++echo "${ECHO_T}$FIND" >&6 + else +- echo "$ac_t""no" 1>&6 ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 + fi + + if test "${FIND}" = ""; then +- { echo "configure: error: 'find not found in path'" 1>&2; exit 1; } ++ { { echo "$as_me:$LINENO: error: 'find not found in path'" >&5 ++echo "$as_me: error: 'find not found in path'" >&2;} ++ { (exit 1); exit 1; }; } + fi + + # Extract the first word of "tail", so it can be a program name with args. + set dummy tail; ac_word=$2 +-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2031: checking for $ac_word" >&5 +-if eval "test "`echo '$''{'ac_cv_prog_TAIL'+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_TAIL+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$TAIL"; then + ac_cv_prog_TAIL="$TAIL" # 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_TAIL="tail" +- 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_TAIL="tail" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ + fi + fi +-TAIL="$ac_cv_prog_TAIL" ++TAIL=$ac_cv_prog_TAIL + if test -n "$TAIL"; then +- echo "$ac_t""$TAIL" 1>&6 ++ echo "$as_me:$LINENO: result: $TAIL" >&5 ++echo "${ECHO_T}$TAIL" >&6 + else +- echo "$ac_t""no" 1>&6 ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 + fi + + if test "${TAIL}" = ""; then +- { echo "configure: error: 'tail not found in path'" 1>&2; exit 1; } ++ { { echo "$as_me:$LINENO: error: 'tail not found in path'" >&5 ++echo "$as_me: error: 'tail not found in path'" >&2;} ++ { (exit 1); exit 1; }; } + fi + +- echo $ac_n "checking "location of lib${CONNECTLIB}.so"""... $ac_c" 1>&6 +-echo "configure:2062: checking "location of lib${CONNECTLIB}.so"" >&5 ++ echo "$as_me:$LINENO: checking location of lib${CONNECTLIB}.so" >&5 ++echo $ECHO_N "checking location of lib${CONNECTLIB}.so... $ECHO_C" >&6 + LIBCONNECT= + for DIR in '/lib' '/usr/lib'; do + if test "${LIBCONNECT}" = ""; then + LIBCONNECT=`$FIND $DIR -name "lib${CONNECTLIB}.so.?" 2>/dev/null | $TAIL -1` + fi + done + +- cat >> confdefs.h <<EOF ++ cat >>confdefs.h <<_ACEOF + #define LIBCONNECT "${LIBCONNECT}" +-EOF ++_ACEOF + + if test "${LIBCONNECT}" = ""; then +- { echo "configure: error: "not found!"" 1>&2; exit 1; } ++ { { echo "$as_me:$LINENO: error: "not found!"" >&5 ++echo "$as_me: error: "not found!"" >&2;} ++ { (exit 1); exit 1; }; } + fi + +- echo "$ac_t""$LIBCONNECT" 1>&6 ++ echo "$as_me:$LINENO: result: $LIBCONNECT" >&5 ++echo "${ECHO_T}$LIBCONNECT" >&6 + +- echo $ac_n "checking "location of libc.so"""... $ac_c" 1>&6 +-echo "configure:2081: checking "location of libc.so"" >&5 ++ echo "$as_me:$LINENO: checking location of libc.so" >&5 ++echo $ECHO_N "checking location of libc.so... $ECHO_C" >&6 + LIBC= + for DIR in '/lib' '/usr/lib'; do + if test "${LIBC}" = ""; then + LIBC=`$FIND $DIR -name "libc.so.?" 2>/dev/null | $TAIL -1` + fi + done + +- cat >> confdefs.h <<EOF ++ cat >>confdefs.h <<_ACEOF + #define LIBC "${LIBC}" +-EOF ++_ACEOF + + if test "${LIBC}" = ""; then +- { echo "configure: error: "not found!"" 1>&2; exit 1; } ++ { { echo "$as_me:$LINENO: error: "not found!"" >&5 ++echo "$as_me: error: "not found!"" >&2;} ++ { (exit 1); exit 1; }; } + fi + +- echo "$ac_t""$LIBC" 1>&6 ++ echo "$as_me:$LINENO: result: $LIBC" >&5 ++echo "${ECHO_T}$LIBC" >&6 + fi + +-echo $ac_n "checking for correct select prototype""... $ac_c" 1>&6 +-echo "configure:2101: checking for correct select prototype" >&5 ++echo "$as_me:$LINENO: checking for correct select prototype" >&5 ++echo $ECHO_N "checking for correct select prototype... $ECHO_C" >&6 + PROTO= +-for testproto in 'int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout' ++for testproto in 'int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout' + do + if test "${PROTO}" = ""; then +- cat > conftest.$ac_ext <<EOF +-#line 2107 "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/time.h> + #include <sys/types.h> + #include <unistd.h> + int select($testproto); +- +-int main() { + +-; return 0; } +-EOF +-if { (eval echo configure:2119: "$ac_compile") 1>&5; (eval $ac_compile) 2>&5; }; then +- rm -rf conftest* ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then + PROTO="$testproto"; + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ + fi +-rm -f conftest* ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + done + if test "${PROTO}" = ""; then +- { echo "configure: error: "no match found!"" 1>&2; exit 1; } +-fi +-echo "$ac_t""select(${PROTO})" 1>&6 +-cat >> confdefs.h <<EOF ++ { { echo "$as_me:$LINENO: error: "no match found!"" >&5 ++echo "$as_me: error: "no match found!"" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++echo "$as_me:$LINENO: result: select(${PROTO})" >&5 ++echo "${ECHO_T}select(${PROTO})" >&6 ++cat >>confdefs.h <<_ACEOF + #define SELECT_SIGNATURE ${PROTO} +-EOF ++_ACEOF + + +-echo $ac_n "checking for correct connect prototype""... $ac_c" 1>&6 +-echo "configure:2139: checking for correct connect prototype" >&5 ++echo "$as_me:$LINENO: checking for correct connect prototype" >&5 ++echo $ECHO_N "checking for correct connect prototype... $ECHO_C" >&6 + PROTO= + PROTO1='int __fd, const struct sockaddr * __addr, int len' + PROTO2='int __fd, const struct sockaddr_in * __addr, socklen_t __len' + PROTO3='int __fd, struct sockaddr * __addr, int __len' + PROTO4='int __fd, const struct sockaddr * __addr, socklen_t __len' + for testproto in "${PROTO1}" \ + "${PROTO2}" \ + "${PROTO3}" \ +- "${PROTO4}" ++ "${PROTO4}" + do + if test "${PROTO}" = ""; then +- cat > conftest.$ac_ext <<EOF +-#line 2152 "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/socket.h> + int connect($testproto); +- +-int main() { + +-; return 0; } +-EOF +-if { (eval echo configure:2162: "$ac_compile") 1>&5; (eval $ac_compile) 2>&5; }; then +- rm -rf conftest* ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then + PROTO="$testproto"; + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ + fi +-rm -f conftest* ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + done + if test "${PROTO}" = ""; then +- { echo "configure: error: "no match found!"" 1>&2; exit 1; } +-fi +-echo "$ac_t""connect(${PROTO})" 1>&6 +-cat >> confdefs.h <<EOF ++ { { echo "$as_me:$LINENO: error: "no match found!"" >&5 ++echo "$as_me: error: "no match found!"" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++echo "$as_me:$LINENO: result: connect(${PROTO})" >&5 ++echo "${ECHO_T}connect(${PROTO})" >&6 ++cat >>confdefs.h <<_ACEOF + #define CONNECT_SIGNATURE ${PROTO} +-EOF ++_ACEOF + + + SOCKETARG="struct sockaddr *" + case "${PROTO}" in + *sockaddr_in*) + SOCKETARG="struct sockaddr_in *" + ;; + esac +-cat >> confdefs.h <<EOF ++cat >>confdefs.h <<_ACEOF + #define CONNECT_SOCKARG ${SOCKETARG} +-EOF ++_ACEOF + + +-echo $ac_n "checking for correct close prototype""... $ac_c" 1>&6 +-echo "configure:2193: checking for correct close prototype" >&5 ++echo "$as_me:$LINENO: checking for correct close prototype" >&5 ++echo $ECHO_N "checking for correct close prototype... $ECHO_C" >&6 + PROTO= + PROTO1='int fd' +-for testproto in "${PROTO1}" ++for testproto in "${PROTO1}" + do + if test "${PROTO}" = ""; then +- cat > conftest.$ac_ext <<EOF +-#line 2200 "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> + int close($testproto); +- +-int main() { + +-; return 0; } +-EOF +-if { (eval echo configure:2210: "$ac_compile") 1>&5; (eval $ac_compile) 2>&5; }; then +- rm -rf conftest* ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then + PROTO="$testproto"; + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ + fi +-rm -f conftest* ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + done + if test "${PROTO}" = ""; then +- { echo "configure: error: "no match found!"" 1>&2; exit 1; } +-fi +-echo "$ac_t""close(${PROTO})" 1>&6 +-cat >> confdefs.h <<EOF ++ { { echo "$as_me:$LINENO: error: "no match found!"" >&5 ++echo "$as_me: error: "no match found!"" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++echo "$as_me:$LINENO: result: close(${PROTO})" >&5 ++echo "${ECHO_T}close(${PROTO})" >&6 ++cat >>confdefs.h <<_ACEOF + #define CLOSE_SIGNATURE ${PROTO} +-EOF ++_ACEOF + + +-echo $ac_n "checking for correct poll prototype""... $ac_c" 1>&6 +-echo "configure:2230: checking for correct poll prototype" >&5 ++echo "$as_me:$LINENO: checking for correct poll prototype" >&5 ++echo $ECHO_N "checking for correct poll prototype... $ECHO_C" >&6 + PROTO= +-for testproto in 'struct pollfd *ufds, unsigned long nfds, int timeout' ++for testproto in 'struct pollfd *ufds, unsigned long nfds, int timeout' + do + if test "${PROTO}" = ""; then +- cat > conftest.$ac_ext <<EOF +-#line 2236 "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/poll.h> + int poll($testproto); +- +-int main() { + +-; return 0; } +-EOF +-if { (eval echo configure:2246: "$ac_compile") 1>&5; (eval $ac_compile) 2>&5; }; then +- rm -rf conftest* ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: $? = $ac_status" >&5 ++ (exit $ac_status); }; }; then + PROTO="$testproto"; + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ + fi +-rm -f conftest* ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + done + if test "${PROTO}" = ""; then +- { echo "configure: error: "no match found!"" 1>&2; exit 1; } +-fi +-echo "$ac_t""poll(${PROTO})" 1>&6 +-cat >> confdefs.h <<EOF ++ { { echo "$as_me:$LINENO: error: "no match found!"" >&5 ++echo "$as_me: error: "no match found!"" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++echo "$as_me:$LINENO: result: poll(${PROTO})" >&5 ++echo "${ECHO_T}poll(${PROTO})" >&6 ++cat >>confdefs.h <<_ACEOF + #define POLL_SIGNATURE ${PROTO} +-EOF ++_ACEOF ++ ++ ++PROTO="const char *name" ++cat >>confdefs.h <<_ACEOF ++#define GETHOSTBYNAME_SIGNATURE ${PROTO} ++_ACEOF ++ ++ ++PROTO="const char *node, const char *service, void *hints, void *res" ++cat >>confdefs.h <<_ACEOF ++#define GETADDRINFO_SIGNATURE ${PROTO} ++_ACEOF ++ ++ ++PROTO="const char *name, int af, int flags, int *error_num" ++cat >>confdefs.h <<_ACEOF ++#define GETIPNODEBYNAME_SIGNATURE ${PROTO} ++_ACEOF + + + SPECIALLIBS=${LIBS} + + LIBS=${SIMPLELIBS} + +-trap '' 1 2 15 +-cat > confcache <<\EOF ++ ac_config_files="$ac_config_files Makefile" ++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. + # 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 ++{ ++ (set) 2>&1 | ++ case `(ac_space=' '; set | grep ac_space) 2>&1` in ++ *ac_space=\ *) ++ # `set' does not quote correctly, so add quotes (double-quote ++ # substitution turns \\ into \, and sed turns \ into ). ++ sed -n \ ++ "s/'/'\\''/g; ++ s/^\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\)=\(.*\)/\1='\2'/p" ++ ;; ++ *) ++ # `set' quotes correctly as required by POSIX, so do not add quotes. ++ sed -n \ ++ "s/^\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\)=\(.*\)/\1=\2/p" ++ ;; ++ esac; ++} | ++ sed ' ++ t clear ++ : clear ++ s/^([^=]*)=(.*[{}].*)$/test "${\1+set}" = set || &/ ++ t end ++ /^ac_cv_env/!s/^([^=]*)=(.*)$/\1=${\1=\2}/ ++ : end' >>confcache ++if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then +- echo "updating cache $cache_file" +- cat confcache > $cache_file ++ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" ++ cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi + fi + rm -f confcache + +-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. ++# 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[ ]*=[^:]*$/d' ++ ac_vpsub='/^[ ]*VPATH[ ]*=/{ ++s/:*$(srcdir):*/:/; ++s/:*${srcdir}:*/:/; ++s/:*@srcdir@:*/:/; ++s/^([^=]*=[ ]*):*/\1/; ++s/:*$//; ++s/^[^=]*=[ ]*$//; ++}' + fi + +-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 +- + DEFS=-DHAVE_CONFIG_H + +-# Without the "./", some shells look in PATH for config.status. +-: ${CONFIG_STATUS=./config.status} ++ac_libobjs= ++ac_ltlibobjs= ++for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue ++ # 1. Remove the extension, and $U if already installed. ++ ac_i=`echo "$ac_i" | ++ sed 's/$U././;s/.o$//;s/.obj$//'` ++ # 2. Add them. ++ ac_libobjs="$ac_libobjs $ac_i$U.$ac_objext" ++ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' ++done ++LIBOBJS=$ac_libobjs + +-echo creating $CONFIG_STATUS +-rm -f $CONFIG_STATUS +-cat > $CONFIG_STATUS <<EOF +-#! /bin/sh +-# Generated automatically by configure. ++LTLIBOBJS=$ac_ltlibobjs ++ ++ ++ ++: ${CONFIG_STATUS=./config.status} ++ac_clean_files_save=$ac_clean_files ++ac_clean_files="$ac_clean_files $CONFIG_STATUS" ++{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 ++echo "$as_me: creating $CONFIG_STATUS" >&6;} ++cat >$CONFIG_STATUS <<_ACEOF ++#! $SHELL ++# Generated by $as_me. + # Run this file to recreate the current configuration. +-# 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 Bourne compatible ++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then ++ emulate sh ++ NULLCMD=: ++ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which ++ # is contrary to our usage. Disable this feature. ++ alias -g '${1+"$@"}'='"$@"' ++elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then ++ set -o posix ++fi ++DUALCASE=1; export DUALCASE # for MKS sh ++ ++# Support unset when possible. ++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then ++ as_unset=unset ++else ++ as_unset=false ++fi ++ ++ ++# Work around bugs in pre-3.0 UWIN ksh. ++$as_unset ENV MAIL MAILPATH ++PS1='$ ' ++PS2='> ' ++PS4='+ ' ++ ++# NLS nuisances. ++for as_var in \ ++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ ++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ ++ LC_TELEPHONE LC_TIME ++do ++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then ++ eval $as_var=C; export $as_var ++ else ++ $as_unset $as_var ++ fi ++done ++ ++# Required to use basename. ++if expr a : '(a)' >/dev/null 2>&1; then ++ as_expr=expr ++else ++ as_expr=false ++fi ++ ++if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then ++ as_basename=basename ++else ++ as_basename=false ++fi ++ ++ ++# Name of the executable. ++as_me=`$as_basename "$0" || ++$as_expr X/"$0" : '.*/([^/][^/]*)/*$' | \ ++ X"$0" : 'X(//)$' | \ ++ X"$0" : 'X(/)$' | \ ++ . : '(.)' 2>/dev/null || ++echo X/"$0" | ++ sed '/^.*/([^/][^/]*)/*$/{ s//\1/; q; } ++ /^X/(//)$/{ s//\1/; q; } ++ /^X/(/).*/{ s//\1/; q; } ++ s/.*/./; q'` ++ ++ ++# PATH needs CR, and LINENO needs CR and PATH. ++# Avoid depending upon Character Ranges. ++as_cr_letters='abcdefghijklmnopqrstuvwxyz' ++as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' ++as_cr_Letters=$as_cr_letters$as_cr_LETTERS ++as_cr_digits='0123456789' ++as_cr_alnum=$as_cr_Letters$as_cr_digits ++ ++# The user is always right. ++if test "${PATH_SEPARATOR+set}" != set; then ++ echo "#! /bin/sh" >conf$$.sh ++ echo "exit 0" >>conf$$.sh ++ chmod +x conf$$.sh ++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then ++ PATH_SEPARATOR=';' ++ else ++ PATH_SEPARATOR=: ++ fi ++ rm -f conf$$.sh ++fi ++ ++ ++ as_lineno_1=$LINENO ++ as_lineno_2=$LINENO ++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` ++ test "x$as_lineno_1" != "x$as_lineno_2" && ++ test "x$as_lineno_3" = "x$as_lineno_2" || { ++ # Find who we are. Look in the path if we contain no path at all ++ # relative or not. ++ case $0 in ++ *[\/]* ) as_myself=$0 ;; ++ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break ++done ++ ++ ;; ++ esac ++ # We did not find ourselves, most probably we were run as `sh COMMAND' ++ # in which case we are not to be found in the path. ++ if test "x$as_myself" = x; then ++ as_myself=$0 ++ fi ++ if test ! -f "$as_myself"; then ++ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 ++echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} ++ { (exit 1); exit 1; }; } ++ fi ++ case $CONFIG_SHELL in ++ '') ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH + do +- case "$ac_option" in ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for as_base in sh bash ksh sh5; do ++ case $as_dir in ++ /*) ++ if ("$as_dir/$as_base" -c ' ++ as_lineno_1=$LINENO ++ as_lineno_2=$LINENO ++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` ++ test "x$as_lineno_1" != "x$as_lineno_2" && ++ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then ++ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } ++ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } ++ CONFIG_SHELL=$as_dir/$as_base ++ export CONFIG_SHELL ++ exec "$CONFIG_SHELL" "$0" ${1+"$@"} ++ fi;; ++ esac ++ done ++done ++;; ++ esac ++ ++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO ++ # uniformly replaced by the line number. The first 'sed' inserts a ++ # line-number line before each line; the second 'sed' does the real ++ # work. The second script uses 'N' to pair each line-number line ++ # with the numbered line, and appends trailing '-' during ++ # substitution so that $LINENO is not a special case at line end. ++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the ++ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) ++ sed '=' <$as_myself | ++ sed ' ++ N ++ s,$,-, ++ : loop ++ s,^(['$as_cr_digits']*)(.*)[$]LINENO([^'$as_cr_alnum'_]),\1\2\1\3, ++ t loop ++ s,-$,, ++ s,^['$as_cr_digits']*\n,, ++ ' >$as_me.lineno && ++ chmod +x $as_me.lineno || ++ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 ++echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} ++ { (exit 1); exit 1; }; } ++ ++ # Don't try to exec as it changes $[0], causing all sort of problems ++ # (the dirname of $[0] is not the place where we might find the ++ # original and so on. Autoconf is especially sensible to this). ++ . ./$as_me.lineno ++ # Exit status is that of the last command. ++ exit ++} ++ ++ ++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in ++ *c*,-n*) ECHO_N= ECHO_C=' ++' ECHO_T=' ' ;; ++ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; ++ *) ECHO_N= ECHO_C='\c' ECHO_T= ;; ++esac ++ ++if expr a : '(a)' >/dev/null 2>&1; then ++ as_expr=expr ++else ++ as_expr=false ++fi ++ ++rm -f conf$$ conf$$.exe conf$$.file ++echo >conf$$.file ++if ln -s conf$$.file conf$$ 2>/dev/null; then ++ # We could just check for DJGPP; but this test a) works b) is more generic ++ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). ++ if test -f conf$$.exe; then ++ # Don't use ln at all; we don't have any links ++ as_ln_s='cp -p' ++ else ++ as_ln_s='ln -s' ++ fi ++elif ln conf$$.file conf$$ 2>/dev/null; then ++ as_ln_s=ln ++else ++ as_ln_s='cp -p' ++fi ++rm -f conf$$ conf$$.exe conf$$.file ++ ++if mkdir -p . 2>/dev/null; then ++ as_mkdir_p=: ++else ++ test -d ./-p && rmdir ./-p ++ as_mkdir_p=false ++fi ++ ++as_executable_p="test -f" ++ ++# Sed expression to map a string onto a valid CPP name. ++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" ++ ++# Sed expression to map a string onto a valid variable name. ++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" ++ ++ ++# IFS ++# We need space, tab and new line, in precisely that order. ++as_nl=' ++' ++IFS=" $as_nl" ++ ++# CDPATH. ++$as_unset CDPATH ++ ++exec 6>&1 ++ ++# Open the log real soon, to keep $[0] and so on meaningful, and to ++# report actual input values of CONFIG_FILES etc. instead of their ++# values after options handling. Logging --version etc. is OK. ++exec 5>>config.log ++{ ++ echo ++ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ++## Running $as_me. ## ++_ASBOX ++} >&5 ++cat >&5 <<_CSEOF ++ ++This file was extended by $as_me, which was ++generated by GNU Autoconf 2.59. Invocation command line was ++ ++ CONFIG_FILES = $CONFIG_FILES ++ CONFIG_HEADERS = $CONFIG_HEADERS ++ CONFIG_LINKS = $CONFIG_LINKS ++ CONFIG_COMMANDS = $CONFIG_COMMANDS ++ $ $0 $@ ++ ++_CSEOF ++echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 ++echo >&5 ++_ACEOF ++ ++# Files that config.status was made for. ++if test -n "$ac_config_files"; then ++ echo "config_files="$ac_config_files"" >>$CONFIG_STATUS ++fi ++ ++if test -n "$ac_config_headers"; then ++ echo "config_headers="$ac_config_headers"" >>$CONFIG_STATUS ++fi ++ ++if test -n "$ac_config_links"; then ++ echo "config_links="$ac_config_links"" >>$CONFIG_STATUS ++fi ++ ++if test -n "$ac_config_commands"; then ++ echo "config_commands="$ac_config_commands"" >>$CONFIG_STATUS ++fi ++ ++cat >>$CONFIG_STATUS <<_ACEOF ++ ++ac_cs_usage="\ ++`$as_me' instantiates files from templates according to the ++current configuration. ++ ++Usage: $0 [OPTIONS] [FILE]... ++ ++ -h, --help print this help, then exit ++ -V, --version print version number, then exit ++ -q, --quiet do not print progress messages ++ -d, --debug don't remove temporary files ++ --recheck update $as_me by reconfiguring in the same conditions ++ --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="\ ++config.status ++configured by $0, generated by GNU Autoconf 2.59, ++ with options \"`echo "$ac_configure_args" | sed 's/[\""`$]/\\&/g'`\" ++ ++Copyright (C) 2003 Free Software Foundation, Inc. ++This config.status script is free software; the Free Software Foundation ++gives unlimited permission to copy, distribute and modify it." ++srcdir=$srcdir ++INSTALL="$INSTALL" ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<_ACEOF ++# If no file are specified by the user, then we need to provide default ++# value. By we need to know if files were specified by the user. ++ac_need_defaults=: ++while test $# != 0 ++do ++ case $1 in ++ --*=*) ++ ac_option=`expr "x$1" : 'x([^=]*)='` ++ ac_optarg=`expr "x$1" : 'x[^=]*=(.*)'` ++ ac_shift=: ++ ;; ++ -*) ++ ac_option=$1 ++ ac_optarg=$2 ++ ac_shift=shift ++ ;; ++ *) # This is not an option, so the user has probably given explicit ++ # arguments. ++ ac_option=$1 ++ ac_need_defaults=false;; ++ esac ++ ++ case $ac_option in ++ # Handling of the options. ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) +- 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 ;; ++ ac_cs_recheck=: ;; ++ --version | --vers* | -V ) ++ echo "$ac_cs_version"; exit 0 ;; ++ --he | --h) ++ # Conflict between --help and --header ++ { { echo "$as_me:$LINENO: error: ambiguous option: $1 ++Try `$0 --help' for more information." >&5 ++echo "$as_me: error: ambiguous option: $1 ++Try `$0 --help' for more information." >&2;} ++ { (exit 1); exit 1; }; };; ++ --help | --hel | -h ) ++ echo "$ac_cs_usage"; exit 0 ;; ++ --debug | --d* | -d ) ++ debug=: ;; ++ --file | --fil | --fi | --f ) ++ $ac_shift ++ CONFIG_FILES="$CONFIG_FILES $ac_optarg" ++ ac_need_defaults=false;; ++ --header | --heade | --head | --hea ) ++ $ac_shift ++ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ++ ac_need_defaults=false;; ++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ ++ | -silent | --silent | --silen | --sile | --sil | --si | --s) ++ ac_cs_silent=: ;; ++ ++ # This is an error. ++ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 ++Try `$0 --help' for more information." >&5 ++echo "$as_me: error: unrecognized option: $1 ++Try `$0 --help' for more information." >&2;} ++ { (exit 1); exit 1; }; } ;; ++ ++ *) ac_config_targets="$ac_config_targets $1" ;; ++ + esac ++ shift + done + +-ac_given_srcdir=$srcdir +-ac_given_INSTALL="$INSTALL" ++ac_configure_extra_args= ++ ++if $ac_cs_silent; then ++ exec 6>/dev/null ++ ac_configure_extra_args="$ac_configure_extra_args --silent" ++fi ++ ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF ++if $ac_cs_recheck; then ++ echo "running $SHELL $0 " $ac_configure_args $ac_configure_extra_args " --no-create --no-recursion" >&6 ++ exec $SHELL $0 $ac_configure_args $ac_configure_extra_args --no-create --no-recursion ++fi ++ ++_ACEOF ++ ++ ++ + +-trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +-EOF +-cat >> $CONFIG_STATUS <<EOF +- +-# 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%@host@%$host%g +-s%@host_alias@%$host_alias%g +-s%@host_cpu@%$host_cpu%g +-s%@host_vendor@%$host_vendor%g +-s%@host_os@%$host_os%g +-s%@CC@%$CC%g +-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +-s%@INSTALL_DATA@%$INSTALL_DATA%g +-s%@LN_S@%$LN_S%g +-s%@CPP@%$CPP%g +-s%@FIND@%$FIND%g +-s%@TAIL@%$TAIL%g +-s%@SPECIALLIBS@%$SPECIALLIBS%g + ++cat >>$CONFIG_STATUS <<_ACEOF ++for ac_config_target in $ac_config_targets ++do ++ case "$ac_config_target" in ++ # Handling of arguments. ++ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; ++ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; ++ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 ++echo "$as_me: error: invalid argument: $ac_config_target" >&2;} ++ { (exit 1); exit 1; }; };; ++ esac ++done ++ ++# If the user did not use the arguments to specify the items to instantiate, ++# then the envvar interface is used. Set only those that are not. ++# We use the long form for the default assignment because of an extremely ++# bizarre bug on SunOS 4.1.3. ++if $ac_need_defaults; then ++ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files ++ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers ++fi ++ ++# Have a temporary directory for convenience. Make it in the build tree ++# simply because there is no reason to put it here, and in addition, ++# creating and moving files from /tmp can sometimes cause problems. ++# Create a temporary directory, and hook for its removal unless debugging. ++$debug || ++{ ++ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 ++ trap '{ (exit 1); exit 1; }' 1 2 13 15 ++} ++ ++# Create a (secure) tmp directory for tmp files. ++ ++{ ++ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && ++ test -n "$tmp" && test -d "$tmp" ++} || ++{ ++ tmp=./confstat$$-$RANDOM ++ (umask 077 && mkdir $tmp) ++} || ++{ ++ echo "$me: cannot create a temporary directory in ." >&2 ++ { (exit 1); exit 1; } ++} ++ ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<_ACEOF ++ ++# ++# CONFIG_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 ++ # Protect against being on the right side of a sed subst in config.status. ++ sed 's/,@/@@/; s/@,/@@/; s/,;t t$/@;t t/; /@;t t$/s/[\\&,]/\\&/g; ++ s/@@/,@/; s/@@/@,/; s/@;t t$/,;t t/' >$tmp/subs.sed <<\CEOF ++s,@SHELL@,$SHELL,;t t ++s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t ++s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t ++s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t ++s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t ++s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t ++s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t ++s,@exec_prefix@,$exec_prefix,;t t ++s,@prefix@,$prefix,;t t ++s,@program_transform_name@,$program_transform_name,;t t ++s,@bindir@,$bindir,;t t ++s,@sbindir@,$sbindir,;t t ++s,@libexecdir@,$libexecdir,;t t ++s,@datadir@,$datadir,;t t ++s,@sysconfdir@,$sysconfdir,;t t ++s,@sharedstatedir@,$sharedstatedir,;t t ++s,@localstatedir@,$localstatedir,;t t ++s,@libdir@,$libdir,;t t ++s,@includedir@,$includedir,;t t ++s,@oldincludedir@,$oldincludedir,;t t ++s,@infodir@,$infodir,;t t ++s,@mandir@,$mandir,;t t ++s,@build_alias@,$build_alias,;t t ++s,@host_alias@,$host_alias,;t t ++s,@target_alias@,$target_alias,;t t ++s,@DEFS@,$DEFS,;t t ++s,@ECHO_C@,$ECHO_C,;t t ++s,@ECHO_N@,$ECHO_N,;t t ++s,@ECHO_T@,$ECHO_T,;t t ++s,@LIBS@,$LIBS,;t t ++s,@build@,$build,;t t ++s,@build_cpu@,$build_cpu,;t t ++s,@build_vendor@,$build_vendor,;t t ++s,@build_os@,$build_os,;t t ++s,@host@,$host,;t t ++s,@host_cpu@,$host_cpu,;t t ++s,@host_vendor@,$host_vendor,;t t ++s,@host_os@,$host_os,;t t ++s,@CC@,$CC,;t t ++s,@CFLAGS@,$CFLAGS,;t t ++s,@LDFLAGS@,$LDFLAGS,;t t ++s,@CPPFLAGS@,$CPPFLAGS,;t t ++s,@ac_ct_CC@,$ac_ct_CC,;t t ++s,@EXEEXT@,$EXEEXT,;t t ++s,@OBJEXT@,$OBJEXT,;t t ++s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t ++s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t ++s,@INSTALL_DATA@,$INSTALL_DATA,;t t ++s,@LN_S@,$LN_S,;t t ++s,@CPP@,$CPP,;t t ++s,@EGREP@,$EGREP,;t t ++s,@DEADPOOL_O@,$DEADPOOL_O,;t t ++s,@FIND@,$FIND,;t t ++s,@TAIL@,$TAIL,;t t ++s,@SPECIALLIBS@,$SPECIALLIBS,;t t ++s,@LIBOBJS@,$LIBOBJS,;t t ++s,@LTLIBOBJS@,$LTLIBOBJS,;t t + CEOF +-EOF + +-cat >> $CONFIG_STATUS <<\EOF ++_ACEOF + +-# 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 +- else +- sed "${ac_end}q" conftest.subs > conftest.s$ac_file +- fi +- if test ! -s conftest.s$ac_file; then +- ac_more_lines=false +- rm -f conftest.s$ac_file +- else +- if test -z "$ac_sed_cmds"; then +- ac_sed_cmds="sed -f conftest.s$ac_file" ++ cat >>$CONFIG_STATUS <<_ACEOF ++ # 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_lines=48 ++ ac_sed_frag=1 # Number of current file. ++ ac_beg=1 # First line for current file. ++ ac_end=$ac_max_sed_lines # 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" $tmp/subs.sed >$tmp/subs.frag ++ else ++ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag ++ fi ++ if test ! -s $tmp/subs.frag; then ++ ac_more_lines=false + else +- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" ++ # The purpose of the label and of the branching condition is to ++ # speed up the sed processing (if there are no `@' at all, there ++ # is no need to browse any of the substitutions). ++ # These are the two extra sed commands mentioned above. ++ (echo ':t ++ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed ++ if test -z "$ac_sed_cmds"; then ++ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" ++ else ++ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" ++ fi ++ ac_sed_frag=`expr $ac_sed_frag + 1` ++ ac_beg=$ac_end ++ ac_end=`expr $ac_end + $ac_max_sed_lines` + fi +- ac_file=`expr $ac_file + 1` +- ac_beg=$ac_end +- ac_end=`expr $ac_end + $ac_max_sed_cmds` ++ done ++ if test -z "$ac_sed_cmds"; then ++ ac_sed_cmds=cat + fi +-done +-if test -z "$ac_sed_cmds"; then +- ac_sed_cmds=cat +-fi +-EOF +- +-cat >> $CONFIG_STATUS <<EOF ++fi # test -n "$CONFIG_FILES" + +-CONFIG_FILES=${CONFIG_FILES-"Makefile"} +-EOF +-cat >> $CONFIG_STATUS <<\EOF +-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF ++for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # 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" ;; ++ case $ac_file in ++ - | *:- | *:-:* ) # input from stdin ++ cat >$tmp/stdin ++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; ++ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; ++ * ) ac_file_in=$ac_file.in ;; + esac + +- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. +- +- # 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'` +- else +- ac_dir_suffix= ac_dots= +- fi +- +- 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" ;; ++ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ++ ac_dir=`(dirname "$ac_file") 2>/dev/null || ++$as_expr X"$ac_file" : 'X(.*[^/])//*[^/][^/]*/*$' | \ ++ X"$ac_file" : 'X(//)[^/]' | \ ++ X"$ac_file" : 'X(//)$' | \ ++ X"$ac_file" : 'X(/)' | \ ++ . : '(.)' 2>/dev/null || ++echo X"$ac_file" | ++ sed '/^X(.*[^/])//*[^/][^/]*/*$/{ s//\1/; q; } ++ /^X(//)[^/].*/{ s//\1/; q; } ++ /^X(//)$/{ s//\1/; q; } ++ /^X(/).*/{ s//\1/; q; } ++ s/.*/./; q'` ++ { if $as_mkdir_p; then ++ mkdir -p "$ac_dir" ++ else ++ as_dir="$ac_dir" ++ as_dirs= ++ while test ! -d "$as_dir"; do ++ as_dirs="$as_dir $as_dirs" ++ as_dir=`(dirname "$as_dir") 2>/dev/null || ++$as_expr X"$as_dir" : 'X(.*[^/])//*[^/][^/]*/*$' | \ ++ X"$as_dir" : 'X(//)[^/]' | \ ++ X"$as_dir" : 'X(//)$' | \ ++ X"$as_dir" : 'X(/)' | \ ++ . : '(.)' 2>/dev/null || ++echo X"$as_dir" | ++ sed '/^X(.*[^/])//*[^/][^/]*/*$/{ s//\1/; q; } ++ /^X(//)[^/].*/{ s//\1/; q; } ++ /^X(//)$/{ s//\1/; q; } ++ /^X(/).*/{ s//\1/; q; } ++ s/.*/./; q'` ++ done ++ test ! -n "$as_dirs" || mkdir $as_dirs ++ fi || { { echo "$as_me:$LINENO: error: cannot create directory "$ac_dir"" >&5 ++echo "$as_me: error: cannot create directory "$ac_dir"" >&2;} ++ { (exit 1); exit 1; }; }; } ++ ++ ac_builddir=. ++ ++if test "$ac_dir" != .; then ++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^.[\/],,'` ++ # A "../" for each directory in $ac_dir_suffix. ++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\/]*,../,g'` ++else ++ ac_dir_suffix= ac_top_builddir= ++fi ++ ++case $srcdir in ++ .) # No --srcdir option. We are building in place. ++ ac_srcdir=. ++ if test -z "$ac_top_builddir"; then ++ ac_top_srcdir=. ++ else ++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` ++ fi ;; ++ [\/]* | ?:[\/]* ) # Absolute path. ++ ac_srcdir=$srcdir$ac_dir_suffix; ++ ac_top_srcdir=$srcdir ;; + *) # Relative path. +- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" +- top_srcdir="$ac_dots$ac_given_srcdir" ;; +- esac ++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ++ ac_top_srcdir=$ac_top_builddir$srcdir ;; ++esac ++ ++# Do not use `cd foo && pwd` to compute absolute paths, because ++# the directories may not exist. ++case `pwd` in ++.) ac_abs_builddir="$ac_dir";; ++*) ++ case "$ac_dir" in ++ .) ac_abs_builddir=`pwd`;; ++ [\/]* | ?:[\/]* ) ac_abs_builddir="$ac_dir";; ++ *) ac_abs_builddir=`pwd`/"$ac_dir";; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_builddir=${ac_top_builddir}.;; ++*) ++ case ${ac_top_builddir}. in ++ .) ac_abs_top_builddir=$ac_abs_builddir;; ++ [\/]* | ?:[\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; ++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_srcdir=$ac_srcdir;; ++*) ++ case $ac_srcdir in ++ .) ac_abs_srcdir=$ac_abs_builddir;; ++ [\/]* | ?:[\/]* ) ac_abs_srcdir=$ac_srcdir;; ++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_srcdir=$ac_top_srcdir;; ++*) ++ case $ac_top_srcdir in ++ .) ac_abs_top_srcdir=$ac_abs_builddir;; ++ [\/]* | ?:[\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; ++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; ++ esac;; ++esac + +- case "$ac_given_INSTALL" in +- [/$]*) INSTALL="$ac_given_INSTALL" ;; +- *) INSTALL="$ac_dots$ac_given_INSTALL" ;; +- esac + +- 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 $INSTALL in ++ [\/$]* | ?:[\/]* ) ac_INSTALL=$INSTALL ;; ++ *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + 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* ++ # Let's still pretend it is `configure' which instantiates (i.e., don't ++ # use $as_me), people would be surprised to read: ++ # /* config.h. Generated by config.status. */ ++ if test x"$ac_file" = x-; then ++ configure_input= ++ else ++ configure_input="$ac_file. " ++ fi ++ configure_input=$configure_input"Generated from `echo $ac_file_in | ++ sed 's,.*/,,'` by configure." ++ ++ # First look for the input files in the build tree, otherwise in the ++ # src tree. ++ ac_file_inputs=`IFS=: ++ for f in $ac_file_in; do ++ case $f in ++ -) echo $tmp/stdin ;; ++ [\/$]*) ++ # Absolute (can't be DOS-style, as IFS=:) ++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 ++echo "$as_me: error: cannot find input file: $f" >&2;} ++ { (exit 1); exit 1; }; } ++ echo "$f";; ++ *) # Relative ++ if test -f "$f"; then ++ # Build tree ++ echo "$f" ++ elif test -f "$srcdir/$f"; then ++ # Source tree ++ echo "$srcdir/$f" ++ else ++ # /dev/null tree ++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 ++echo "$as_me: error: cannot find input file: $f" >&2;} ++ { (exit 1); exit 1; }; } ++ fi;; ++ esac ++ done` || { (exit 1); exit 1; } ++ ++ if test x"$ac_file" != x-; then ++ { echo "$as_me:$LINENO: creating $ac_file" >&5 ++echo "$as_me: creating $ac_file" >&6;} ++ rm -f "$ac_file" ++ fi ++_ACEOF ++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,@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,@top_builddir@,$ac_top_builddir,;t t ++s,@abs_top_builddir@,$ac_abs_top_builddir,;t t ++s,@INSTALL@,$ac_INSTALL,;t t ++" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out ++ rm -f $tmp/stdin ++ if test x"$ac_file" != x-; then ++ mv $tmp/out $ac_file ++ else ++ cat $tmp/out ++ rm -f $tmp/out ++ fi ++ ++done ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF ++ ++# ++# CONFIG_HEADER section. ++# + + # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where + # NAME is the cpp macro being defined and VALUE is the value it is being given. + # + # ac_d sets the value in "#define NAME VALUE" lines. +-ac_dA='s%^([ ]*)#([ ]*define[ ][ ]*)' +-ac_dB='([ ][ ]*)[^ ]*%\1#\2' +-ac_dC='\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_dA='s,^([ ]*)#([ ]*define[ ][ ]*)' ++ac_dB='[ ].*$,\1#\2' ++ac_dC=' ' ++ac_dD=',;t' ++# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ++ac_uA='s,^([ ]*)#([ ]*)undef([ ][ ]*)' ++ac_uB='$,\1#\2define\3' + ac_uC=' ' +-ac_uD='\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 ++ac_uD=',;t' ++ ++for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". +- case "$ac_file" in +- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` +- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; +- *) ac_file_in="${ac_file}.in" ;; ++ case $ac_file in ++ - | *:- | *:-:* ) # input from stdin ++ cat >$tmp/stdin ++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; ++ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; ++ * ) ac_file_in=$ac_file.in ;; + esac + +- echo creating $ac_file ++ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 ++echo "$as_me: creating $ac_file" >&6;} + +- 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 ++ # First look for the input files in the build tree, otherwise in the ++ # src tree. ++ ac_file_inputs=`IFS=: ++ for f in $ac_file_in; do ++ case $f in ++ -) echo $tmp/stdin ;; ++ [\/$]*) ++ # Absolute (can't be DOS-style, as IFS=:) ++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 ++echo "$as_me: error: cannot find input file: $f" >&2;} ++ { (exit 1); exit 1; }; } ++ # Do quote $f, to prevent DOS paths from being IFS'd. ++ echo "$f";; ++ *) # Relative ++ if test -f "$f"; then ++ # Build tree ++ echo "$f" ++ elif test -f "$srcdir/$f"; then ++ # Source tree ++ echo "$srcdir/$f" ++ else ++ # /dev/null tree ++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 ++echo "$as_me: error: cannot find input file: $f" >&2;} ++ { (exit 1); exit 1; }; } ++ fi;; ++ esac ++ done` || { (exit 1); exit 1; } ++ # Remove the trailing spaces. ++ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in ++ ++_ACEOF ++ ++# Transform confdefs.h into two sed scripts, `conftest.defines' and ++# `conftest.undefs', that substitutes the proper values into ++# config.h.in to produce config.h. The first handles `#define' ++# templates, and the second `#undef' templates. ++# And first: Protect against being on the right side of a sed subst in ++# config.status. Protect against being in an unquoted here document ++# in config.status. ++rm -f conftest.defines conftest.undefs ++# Using a here document instead of a string reduces the quoting nightmare. ++# Putting comments in sed scripts is not portable. ++# ++# `end' is used to avoid that the second main sed command (meant for ++# 0-ary CPP macros) applies to n-ary macro definitions. ++# See the Autoconf documentation for `clear'. ++cat >confdef2sed.sed <<_ACEOF ++s/[\&,]/\&/g ++s,[\$`],\&,g ++t clear ++: clear ++s,^[ ]*#[ ]*define[ ][ ]*([^ (][^ (]*)(([^)]*))[ ]*(.*)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp ++t end ++s,^[ ]*#[ ]*define[ ][ ]*([^ ][^ ]*)[ ]*(.*)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp ++: end ++_ACEOF ++# If some macros were called several times there might be several times ++# the same #defines, which is useless. Nevertheless, we may not want to ++# sort them, since we want the *last* AC-DEFINE to be honored. ++uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines ++sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs ++rm -f confdef2sed.sed + + # This sed command replaces #undef with comments. This is necessary, for + # example, in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. +-cat >> conftest.vals <<\EOF +-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +-EOF +- +-# Break up conftest.vals because some shells have a limit on +-# the size of here documents, and old seds have small limits too. +- ++cat >>conftest.undefs <<_ACEOF ++s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, ++_ACEOF ++ ++# Break up conftest.defines because some shells have a limit on the size ++# of here documents, and old seds have small limits too (100 cmds). ++echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS ++echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS ++echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS ++echo ' :' >>$CONFIG_STATUS + rm -f conftest.tail +-while : ++while grep . conftest.defines >/dev/null + 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 limited-size here document to $tmp/defines.sed. ++ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS ++ # Speed up: don't consider the non `#define' lines. ++ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS ++ # Work around the forget-to-reset-the-flag bug. ++ echo 't clr' >>$CONFIG_STATUS ++ echo ': clr' >>$CONFIG_STATUS ++ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF +- sed -f 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 +-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" +- fi +- rm -f $ac_file +- mv conftest.h $ac_file ++ sed -f $tmp/defines.sed $tmp/in >$tmp/out ++ rm -f $tmp/in ++ mv $tmp/out $tmp/in ++' >>$CONFIG_STATUS ++ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail ++ rm -f conftest.defines ++ mv conftest.tail conftest.defines ++done ++rm -f conftest.defines ++echo ' fi # grep' >>$CONFIG_STATUS ++echo >>$CONFIG_STATUS ++ ++# Break up conftest.undefs because some shells have a limit on the size ++# of here documents, and old seds have small limits too (100 cmds). ++echo ' # Handle all the #undef templates' >>$CONFIG_STATUS ++rm -f conftest.tail ++while grep . conftest.undefs >/dev/null ++do ++ # Write a limited-size here document to $tmp/undefs.sed. ++ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS ++ # Speed up: don't consider the non `#undef' ++ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS ++ # Work around the forget-to-reset-the-flag bug. ++ echo 't clr' >>$CONFIG_STATUS ++ echo ': clr' >>$CONFIG_STATUS ++ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS ++ echo 'CEOF ++ sed -f $tmp/undefs.sed $tmp/in >$tmp/out ++ rm -f $tmp/in ++ mv $tmp/out $tmp/in ++' >>$CONFIG_STATUS ++ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail ++ rm -f conftest.undefs ++ mv conftest.tail conftest.undefs ++done ++rm -f conftest.undefs ++ ++cat >>$CONFIG_STATUS <<_ACEOF ++ # Let's still pretend it is `configure' which instantiates (i.e., don't ++ # use $as_me), people would be surprised to read: ++ # /* config.h. Generated by config.status. */ ++ if test x"$ac_file" = x-; then ++ echo "/* Generated by configure. */" >$tmp/config.h ++ else ++ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi +-fi; done ++ cat $tmp/in >>$tmp/config.h ++ rm -f $tmp/in ++ if test x"$ac_file" != x-; then ++ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then ++ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 ++echo "$as_me: $ac_file is unchanged" >&6;} ++ else ++ ac_dir=`(dirname "$ac_file") 2>/dev/null || ++$as_expr X"$ac_file" : 'X(.*[^/])//*[^/][^/]*/*$' | \ ++ X"$ac_file" : 'X(//)[^/]' | \ ++ X"$ac_file" : 'X(//)$' | \ ++ X"$ac_file" : 'X(/)' | \ ++ . : '(.)' 2>/dev/null || ++echo X"$ac_file" | ++ sed '/^X(.*[^/])//*[^/][^/]*/*$/{ s//\1/; q; } ++ /^X(//)[^/].*/{ s//\1/; q; } ++ /^X(//)$/{ s//\1/; q; } ++ /^X(/).*/{ s//\1/; q; } ++ s/.*/./; q'` ++ { if $as_mkdir_p; then ++ mkdir -p "$ac_dir" ++ else ++ as_dir="$ac_dir" ++ as_dirs= ++ while test ! -d "$as_dir"; do ++ as_dirs="$as_dir $as_dirs" ++ as_dir=`(dirname "$as_dir") 2>/dev/null || ++$as_expr X"$as_dir" : 'X(.*[^/])//*[^/][^/]*/*$' | \ ++ X"$as_dir" : 'X(//)[^/]' | \ ++ X"$as_dir" : 'X(//)$' | \ ++ X"$as_dir" : 'X(/)' | \ ++ . : '(.)' 2>/dev/null || ++echo X"$as_dir" | ++ sed '/^X(.*[^/])//*[^/][^/]*/*$/{ s//\1/; q; } ++ /^X(//)[^/].*/{ s//\1/; q; } ++ /^X(//)$/{ s//\1/; q; } ++ /^X(/).*/{ s//\1/; q; } ++ s/.*/./; q'` ++ done ++ test ! -n "$as_dirs" || mkdir $as_dirs ++ fi || { { echo "$as_me:$LINENO: error: cannot create directory "$ac_dir"" >&5 ++echo "$as_me: error: cannot create directory "$ac_dir"" >&2;} ++ { (exit 1); exit 1; }; }; } + +-EOF +-cat >> $CONFIG_STATUS <<EOF ++ rm -f $ac_file ++ mv $tmp/config.h $ac_file ++ fi ++ else ++ cat $tmp/config.h ++ rm -f $tmp/config.h ++ fi ++done ++_ACEOF + +-EOF +-cat >> $CONFIG_STATUS <<\EOF ++cat >>$CONFIG_STATUS <<_ACEOF + +-exit 0 +-EOF ++{ (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 -rN -U 5 tsocks-1.8/configure.in tsocks/configure.in +--- tsocks-1.8/configure.in 2002-07-16 10:51:03.000000000 +1200 ++++ tsocks/configure.in 2005-10-02 21:52:00.000000000 +1300 +@@ -11,17 +11,19 @@ + dnl /etc/ld.so.preload file + test "$libdir" = "${exec_prefix}/lib" && libdir="/lib" + + dnl Arguments we allow + AC_ARG_ENABLE(socksdns, +-[ --enable-socksdns force dns lookups to use tcp ]) ++[ --enable-socksdns force dns lookups to use tcp ]) ++AC_ARG_ENABLE(tordns, ++[ --disable-tordns don't override name lookup calls to use SOCKS ]) + AC_ARG_ENABLE(debug, + [ --disable-debug disable ALL error messages from tsocks ]) + AC_ARG_ENABLE(oldmethod, +-[ --enable-oldmethod use the old method to override connect ]) ++[ --enable-oldmethod use the old method to override connect ]) + AC_ARG_ENABLE(hostnames, +-[ --disable-hostnames disable hostname lookups for socks servers ]) ++[ --enable-hostnames enable hostname lookups for socks servers ]) + AC_ARG_ENABLE(envconf, + [ --disable-envconf do not allow TSOCKS_CONF_FILE to specify configuration file ]) + AC_ARG_WITH(conf, + [ --with-conf=<file> location of configuration file (/etc/tsocks.conf default)],[ + if test "${withval}" = "yes" ; then +@@ -43,11 +45,11 @@ + AC_PROG_CC + AC_PROG_INSTALL + AC_PROG_LN_S + + dnl Check if the C compiler accepts -Wall +-AC_MSG_CHECKING("if the C compiler accepts -Wall") ++AC_MSG_CHECKING(if the C compiler accepts -Wall) + OLDCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wall" + AC_TRY_COMPILE(,,AC_MSG_RESULT(yes),[ + CFLAGS="$OLDCFLAGS" + AC_MSG_RESULT(no)]) +@@ -68,16 +70,23 @@ + AC_CHECK_HEADER(fcntl.h,,AC_MSG_ERROR("fcntl.h not found")) + + dnl Check for the poll header + AC_CHECK_HEADER(sys/poll.h,,AC_MSG_ERROR("sys/poll.h not found")) + ++dnl Check for the mmap header ++AC_CHECK_HEADER(sys/mman.h,,AC_MSG_ERROR("sys/mman.h not found")) ++ + dnl Other headers we're interested in + AC_CHECK_HEADERS(unistd.h) + + dnl Checks for library functions. +-AC_CHECK_FUNCS(strcspn strdup strerror strspn strtol,,[ +- AC_MSG_ERROR("Required function not found")]) ++AC_CHECK_FUNCS(strcspn strdup strerror strspn strtol mmap strcasecmp \ ++ strncasecmp strtol,,[AC_MSG_ERROR("Required function not found")]) ++ ++dnl Find which version of gethostbyname_r we should be using (actually this ++dnl isn't used right now). ++AX_FUNC_WHICH_GETHOSTBYNAME_R + + dnl First find the library that contains connect() (obviously + dnl the most important library for us). Once we've found it + dnl we chuck it on the end of LIBS, that lib may end up there + dnl more than once (since we do our search with an empty libs +@@ -123,22 +132,22 @@ + dnl Checks for libraries. + dnl Replace `main' with a function in -ldl: + AC_CHECK_LIB(dl, dlsym,,AC_MSG_ERROR("libdl is required")) + + dnl If we're using gcc here define _GNU_SOURCE +-AC_MSG_CHECKING("for RTLD_NEXT from dlfcn.h") ++AC_MSG_CHECKING(for RTLD_NEXT from dlfcn.h) + AC_EGREP_CPP(yes, + [ + #include <dlfcn.h> + #ifdef RTLD_NEXT + yes + #endif + ], [ + AC_MSG_RESULT(yes) + ], [ + AC_MSG_RESULT(no) +- AC_MSG_CHECKING("for RTLD_NEXT from dlfcn.h with _GNU_SOURCE") ++ AC_MSG_CHECKING(for RTLD_NEXT from dlfcn.h with _GNU_SOURCE) + AC_EGREP_CPP(yes, + [ + #define _GNU_SOURCE + #include <dlfcn.h> + #ifdef RTLD_NEXT +@@ -156,10 +165,21 @@ + + if test "${enable_socksdns}" = "yes"; then + AC_DEFINE(USE_SOCKS_DNS) + fi + ++AC_MSG_CHECKING(whether to enable tordns) ++if test "x${enable_tordns}" = "x"; then ++ AC_DEFINE(USE_TOR_DNS) ++ DEADPOOL_O="${DEADPOOL}.o" ++ AC_MSG_RESULT(yes) ++else ++ DEADPOOL_O="" ++ AC_MSG_RESULT(no) ++fi ++AC_SUBST(DEADPOOL_O) ++ + if test "x${enable_envconf}" = "x"; then + AC_DEFINE(ALLOW_ENV_CONFIG) + fi + + if test "${enable_oldmethod}" = "yes"; then +@@ -169,17 +189,22 @@ + + if test "x${enable_debug}" = "x"; then + AC_DEFINE(ALLOW_MSG_OUTPUT) + fi + +-if test "x${enable_hostnames}" = "x"; then ++if test "x${enable_hostnames}" = "xyes"; then + AC_DEFINE(HOSTNAMES) + fi + + if test "${enable_socksdns}" = "yes" -a \ +- "x${enable_hostnames}" = "x" ; then +- AC_MSG_ERROR("--enable-socksdns is not valid without --disable-hostnames") ++ "x${enable_hostnames}" = "xyes" ; then ++ AC_MSG_ERROR("--enable-socksdns is not valid with --enable-hostnames") ++fi ++ ++if test "x${enable_tordns}" = "x" -a \ ++ "x${enable_hostnames}" = "xyes" ; then ++ AC_MSG_ERROR("--enable-tordns is not valid with --enable-hostnames") + fi + + dnl If we have to use the old method of overriding connect (i.e no + dnl RTLD_NEXT) we need to know the location of the library that + dnl contains connect(), select(), poll() and close() +@@ -201,11 +226,11 @@ + if test "${TAIL}" = ""; then + AC_MSG_ERROR('tail not found in path') + fi + + dnl Now find the library we need +- AC_MSG_CHECKING("location of lib${CONNECTLIB}.so") ++ AC_MSG_CHECKING(location of lib${CONNECTLIB}.so) + LIBCONNECT= + for DIR in '/lib' '/usr/lib'; do + if test "${LIBCONNECT}" = ""; then + LIBCONNECT=`$FIND $DIR -name "lib${CONNECTLIB}.so.?" 2>/dev/null | $TAIL -1` + fi +@@ -217,11 +242,11 @@ + fi + + AC_MSG_RESULT($LIBCONNECT) + + dnl close() should be in libc, find it +- AC_MSG_CHECKING("location of libc.so") ++ AC_MSG_CHECKING(location of libc.so) + LIBC= + for DIR in '/lib' '/usr/lib'; do + if test "${LIBC}" = ""; then + LIBC=`$FIND $DIR -name "libc.so.?" 2>/dev/null | $TAIL -1` + fi +@@ -325,10 +350,22 @@ + AC_MSG_ERROR("no match found!") + fi + AC_MSG_RESULT([poll(${PROTO})]) + AC_DEFINE_UNQUOTED(POLL_SIGNATURE, [${PROTO}]) + ++dnl Emit signature for gethostbyname ++PROTO="const char *name" ++AC_DEFINE_UNQUOTED(GETHOSTBYNAME_SIGNATURE, [${PROTO}]) ++ ++dnl Emit signature for getaddrinfo ++PROTO="const char *node, const char *service, void *hints, void *res" ++AC_DEFINE_UNQUOTED(GETADDRINFO_SIGNATURE, [${PROTO}]) ++ ++dnl Emit signature for getipnodebyname ++PROTO="const char *name, int af, int flags, int *error_num" ++AC_DEFINE_UNQUOTED(GETIPNODEBYNAME_SIGNATURE, [${PROTO}]) ++ + dnl Output the special librarys (libdl etc needed for tsocks) + SPECIALLIBS=${LIBS} + AC_SUBST(SPECIALLIBS) + LIBS=${SIMPLELIBS} + +diff -rN -U 5 tsocks-1.8/dead_pool.c tsocks/dead_pool.c +--- tsocks-1.8/dead_pool.c 1970-01-01 12:00:00.000000000 +1200 ++++ tsocks/dead_pool.c 2005-10-01 21:26:53.000000000 +1200 +@@ -0,0 +1,541 @@ ++#include <stdio.h> ++#include <sys/socket.h> ++#include <netinet/in.h> ++#include <arpa/inet.h> ++#include <netdb.h> ++#include <stdlib.h> ++#include <string.h> ++#include <sys/mman.h> ++#include "common.h" ++#include "dead_pool.h" ++ ++int store_pool_entry(dead_pool *pool, char *hostname, struct in_addr *addr); ++void get_next_dead_address(dead_pool *pool, uint32_t *result); ++ ++static int ++do_resolve(const char *hostname, uint32_t sockshost, uint16_t socksport, ++ uint32_t *result_addr); ++ ++/* Compares the last strlen(s2) characters of s1 with s2. Returns as for ++ strcasecmp. */ ++static int ++strcasecmpend(const char *s1, const char *s2) ++{ ++ size_t n1 = strlen(s1), n2 = strlen(s2); ++ if (n2>n1) /* then they can't be the same; figure out which is bigger */ ++ return strcasecmp(s1,s2); ++ else ++ return strncasecmp(s1+(n1-n2), s2, n2); ++} ++ ++dead_pool * ++init_pool(int pool_size, struct in_addr deadrange_base, ++ struct in_addr deadrange_mask, char *sockshost, uint16_t socksport) ++{ ++ int i, deadrange_bits, deadrange_width, deadrange_size; ++ struct in_addr socks_server; ++ dead_pool *newpool = NULL; ++ ++ /* Count bits in netmask and determine deadrange width. */ ++ deadrange_bits = count_netmask_bits(deadrange_mask.s_addr); ++ if(deadrange_bits == -1) { ++ show_msg(MSGERR, "init_pool: invalid netmask for deadrange\n"); ++ return NULL; ++ } ++ deadrange_width = 32 - deadrange_bits; ++ ++ show_msg(MSGDEBUG, "deadrange width is %d bits\n", deadrange_width); ++ ++ /* Now work out how many IPs are available in the deadrange and check ++ that this number makes sense. If the deadpool is bigger than the ++ deadrange we shrink the pool. */ ++ ++ for(i=0, deadrange_size = 1; i < deadrange_width; i++) { ++ deadrange_size *= 2; ++ } ++ ++ if(deadrange_size < pool_size) { ++ show_msg(MSGWARN, "tordns cache size was %d, but deadrange size is %d: " ++ "shrinking pool size to %d entries\n", pool_size, ++ deadrange_size, deadrange_size); ++ pool_size = deadrange_size; ++ } ++ if(pool_size < 1) { ++ show_msg(MSGERR, "tordns cache size is 0, disabling tordns\n"); ++ return NULL; ++ } ++ ++ /* Allocate space for the dead_pool structure */ ++ newpool = (dead_pool *) mmap(0, sizeof(dead_pool), ++ PROT_READ | PROT_WRITE, ++ MAP_SHARED | MAP_ANONYMOUS, -1, 0); ++ if(!newpool) { ++ show_msg(MSGERR, "init_pool: unable to mmap deadpool " ++ "(tried to map %d bytes)\n", sizeof(dead_pool)); ++ return NULL; ++ } ++ ++ /* Initialize the dead_pool structure */ ++#ifdef HAVE_INET_ATON ++ inet_aton(sockshost, &socks_server); ++#elif defined(HAVE_INET_ADDR) ++ socks_server.s_addr = inet_addr(sockshost); ++#endif ++ newpool->sockshost = ntohl(socks_server.s_addr); ++ newpool->socksport = socksport; ++ newpool->deadrange_base = ntohl(deadrange_base.s_addr); ++ newpool->deadrange_mask = ntohl(deadrange_mask.s_addr); ++ newpool->deadrange_size = deadrange_size; ++ newpool->write_pos = 0; ++ newpool->dead_pos = 0; ++ newpool->n_entries = pool_size; ++ ++ /* Allocate space for the entries */ ++ newpool->entries = (pool_ent *) mmap(0, newpool->n_entries * sizeof(pool_ent), ++ PROT_READ | PROT_WRITE, ++ MAP_SHARED | MAP_ANONYMOUS, -1, 0); ++ if(!newpool->entries) { ++ munmap((void *)newpool, sizeof(dead_pool)); ++ show_msg(MSGERR, "init_pool: unable to mmap deadpool entries " ++ "(tried to map %d bytes)\n", ++ newpool->n_entries * sizeof(pool_ent)); ++ return NULL; ++ } ++ ++ /* Initialize the entries */ ++ for(i=0; i < newpool->n_entries; i++) { ++ newpool->entries[i].ip = -1; ++ newpool->entries[i].name[0] = '\0'; ++ } ++ ++ return newpool; ++} ++ ++int ++is_dead_address(dead_pool *pool, uint32_t addr) ++{ ++ uint32_t haddr = ntohl(addr); ++ if(pool == NULL) { ++ return 0; ++ } ++ return (pool->deadrange_base == (haddr & pool->deadrange_mask)); ++} ++ ++void ++get_next_dead_address(dead_pool *pool, uint32_t *result) ++{ ++ *result = htonl(pool->deadrange_base + pool->dead_pos++); ++ if(pool->dead_pos >= pool->deadrange_size) { ++ pool->dead_pos = 0; ++ } ++} ++ ++int ++store_pool_entry(dead_pool *pool, char *hostname, struct in_addr *addr) ++{ ++ int position = pool->write_pos; ++ int oldpos; ++ int rc; ++ uint32_t intaddr; ++ ++ show_msg(MSGDEBUG, "store_pool_entry: storing '%s'\n", hostname); ++ show_msg(MSGDEBUG, "store_pool_entry: write pos is: %d\n", pool->write_pos); ++ ++ /* Check to see if name already exists in pool */ ++ oldpos = search_pool_for_name(pool, hostname); ++ if(oldpos != -1){ ++ show_msg(MSGDEBUG, "store_pool_entry: not storing (entry exists)\n"); ++ addr->s_addr = pool->entries[oldpos].ip; ++ return oldpos; ++ } ++ ++ /* If this is a .onion host, then we return a bogus ip from our deadpool, ++ otherwise we try to resolve it and store the 'real' IP */ ++ if(strcasecmpend(hostname, ".onion") == 0) { ++ get_next_dead_address(pool, &pool->entries[position].ip); ++ } else { ++ rc = do_resolve(hostname, pool->sockshost, pool->socksport, &intaddr); ++ if(rc != 0) { ++ show_msg(MSGWARN, "failed to resolve: %s\n", hostname); ++ return -1; ++ } ++ if(is_dead_address(pool, intaddr)) { ++ show_msg(MSGERR, "resolved %s -> %d (deadpool address) IGNORED\n"); ++ return -1; ++ } ++ pool->entries[position].ip = intaddr; ++ } ++ ++ strncpy(pool->entries[position].name, hostname, 255); ++ pool->entries[position].name[255] = '\0'; ++ pool->write_pos++; ++ if(pool->write_pos >= pool->n_entries) { ++ pool->write_pos = 0; ++ } ++ addr->s_addr = pool->entries[position].ip; ++ ++ show_msg(MSGDEBUG, "store_pool_entry: stored entry in slot '%d'\n", position); ++ ++ return position; ++} ++ ++int ++search_pool_for_name(dead_pool *pool, const char *name) ++{ ++ int i; ++ for(i=0; i < pool->n_entries; i++){ ++ if(strcmp(name, pool->entries[i].name) == 0){ ++ return i; ++ } ++ } ++ return -1; ++} ++ ++char * ++get_pool_entry(dead_pool *pool, struct in_addr *addr) ++{ ++ int i; ++ uint32_t intaddr = addr->s_addr; ++ ++ if(pool == NULL) { ++ return NULL; ++ } ++ ++ show_msg(MSGDEBUG, "get_pool_entry: searching for: %s\n", inet_ntoa(*addr)); ++ for(i=0; i<pool->n_entries; i++) { ++ if(intaddr == pool->entries[i].ip) { ++ show_msg(MSGDEBUG, "get_pool_entry: found: %s\n", pool->entries[i].name); ++ return pool->entries[i].name; ++ } ++ } ++ show_msg(MSGDEBUG, "get_pool_entry: address not found\n"); ++ ++ return NULL; ++} ++ ++static int ++build_socks4a_resolve_request(char **out, ++ const char *username, ++ const char *hostname) ++{ ++ size_t len; ++ uint16_t port = htons(0); /* port: 0. */ ++ uint32_t addr = htonl(0x00000001u); /* addr: 0.0.0.1 */ ++ ++ len = 8 + strlen(username) + 1 + strlen(hostname) + 1; ++ *out = malloc(len); ++ (*out)[0] = 4; /* SOCKS version 4 */ ++ (*out)[1] = '\xF0'; /* Command: resolve. */ ++ ++ memcpy((*out)+2, &port, sizeof(port)); ++ memcpy((*out)+4, &addr, sizeof(addr)); ++ strcpy((*out)+8, username); ++ strcpy((*out)+8+strlen(username)+1, hostname); ++ ++ return len; ++} ++ ++#define RESPONSE_LEN 8 ++ ++static int ++parse_socks4a_resolve_response(const char *response, size_t len, ++ uint32_t *addr_out) ++{ ++ uint8_t status; ++ uint16_t port; ++ ++ if (len < RESPONSE_LEN) { ++ show_msg(MSGWARN,"Truncated socks response.\n"); ++ return -1; ++ } ++ if (((uint8_t)response[0])!=0) { /* version: 0 */ ++ show_msg(MSGWARN,"Nonzero version in socks response: bad format.\n"); ++ return -1; ++ } ++ status = (uint8_t)response[1]; ++ ++ memcpy(&port, response+2, sizeof(port)); ++ if (port!=0) { /* port: 0 */ ++ show_msg(MSGWARN,"Nonzero port in socks response: bad format.\n"); ++ return -1; ++ } ++ if (status != 90) { ++ show_msg(MSGWARN,"Bad status: socks request failed.\n"); ++ return -1; ++ } ++ ++ memcpy(addr_out, response+4, sizeof(*addr_out)); ++ ++ return 0; ++} ++ ++static int ++do_resolve(const char *hostname, uint32_t sockshost, uint16_t socksport, ++ uint32_t *result_addr) ++{ ++ int s; ++ struct sockaddr_in socksaddr; ++ char *req, *cp; ++ int r, len; ++ char response_buf[RESPONSE_LEN]; ++ ++ show_msg(MSGDEBUG, "do_resolve: resolving %s\n", hostname); ++ ++ s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); ++ if (s<0) { ++ show_msg(MSGWARN, "do_resolve: problem creating socket\n"); ++ return -1; ++ } ++ ++ memset(&socksaddr, 0, sizeof(socksaddr)); ++ socksaddr.sin_family = AF_INET; ++ socksaddr.sin_port = htons(socksport); ++ socksaddr.sin_addr.s_addr = htonl(sockshost); ++ if (realconnect(s, (struct sockaddr*)&socksaddr, sizeof(socksaddr))) { ++ show_msg(MSGWARN, "do_resolve: error connecting to SOCKS server\n"); ++ return -1; ++ } ++ ++ if ((len = build_socks4a_resolve_request(&req, "", hostname))<0) { ++ show_msg(MSGWARN, "do_resolve: error generating SOCKS request\n"); ++ return -1; ++ } ++ ++ cp = req; ++ while (len) { ++ r = send(s, cp, len, 0); ++ if (r<0) { ++ show_msg(MSGWARN, "do_resolve: error sending SOCKS request\n"); ++ free(req); ++ return -1; ++ } ++ len -= r; ++ cp += r; ++ } ++ free(req); ++ ++ len = 0; ++ while (len < RESPONSE_LEN) { ++ r = recv(s, response_buf+len, RESPONSE_LEN-len, 0); ++ if (r==0) { ++ show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS response\n"); ++ return -1; ++ } ++ if (r<0) { ++ show_msg(MSGWARN, "do_resolve: error reading SOCKS response\n"); ++ return -1; ++ } ++ len += r; ++ } ++ ++ realclose(s); ++ ++ if (parse_socks4a_resolve_response(response_buf, RESPONSE_LEN, result_addr) < 0){ ++ show_msg(MSGWARN, "do_resolve: error parsing SOCKS response\n"); ++ return -1; ++ } ++ ++ show_msg(MSGDEBUG, "do_resolve: success\n"); ++ ++ return 0; ++} ++ ++struct hostent * ++our_gethostbyname(dead_pool *pool, const char *name) ++{ ++ int pos; ++ static struct in_addr addr; ++ static struct hostent he; ++ static char *addrs[2]; ++ ++ show_msg(MSGDEBUG, "our_gethostbyname: '%s' requested\n", name); ++ ++ pos = store_pool_entry(pool,(char *) name, &addr); ++ if(pos == -1) { ++ h_errno = HOST_NOT_FOUND; ++ return NULL; ++ } ++ ++ addrs[0] = (char *)&addr; ++ addrs[1] = NULL; ++ ++ he.h_name = pool->entries[pos].name; ++ he.h_aliases = NULL; ++ he.h_length = 4; ++ he.h_addrtype = AF_INET; ++ he.h_addr_list = addrs; ++ ++ show_msg(MSGDEBUG, "our_gethostbyname: resolved '%s' to: '%s'\n", ++ name, inet_ntoa(*((struct in_addr *)he.h_addr))); ++ ++ return &he; ++} ++ ++static struct hostent * ++alloc_hostent(int af) ++{ ++ struct hostent *he = NULL; ++ char **addr_list = NULL; ++ void *addr = NULL; ++ char **aliases = NULL; ++ ++ if(af != AF_INET && af != AF_INET6) { ++ return NULL; ++ } ++ ++ /* Since the memory we allocate here will be free'd by freehostent and ++ that function is opaque to us, it's likely that we'll leak a little ++ bit of memory here. */ ++ ++ he = malloc(sizeof(struct hostent)); ++ addr_list = malloc(2 * sizeof(char *)); ++ if(af == AF_INET6) { ++ addr = malloc(sizeof(struct in6_addr)); ++ } else { ++ addr = malloc(sizeof(struct in_addr)); ++ } ++ aliases = malloc(sizeof(char *)); ++ ++ if(he == NULL || addr_list == NULL || addr == NULL || aliases == NULL) { ++ if(he) ++ free(he); ++ if(addr_list) ++ free(addr_list); ++ if(addr) ++ free(addr); ++ if(aliases) ++ free(aliases); ++ } ++ ++ he->h_name = NULL; ++ he->h_addr_list = addr_list; ++ he->h_addr_list[0] = addr; ++ he->h_addr_list[1] = NULL; ++ he->h_aliases = aliases; ++ he->h_aliases[0] = NULL; ++ he->h_length = af == AF_INET ? 4 : 16; ++ he->h_addrtype = af; ++ ++ return he; ++} ++ ++/* On Linux, there's no freehostent() anymore; we might as well implement ++ this ourselves. */ ++ ++static void ++free_hostent(struct hostent *he) ++{ ++ int i; ++ if(he->h_name) { ++ free(he->h_name); ++ } ++ if(he->h_aliases) { ++ for(i=0; he->h_aliases[i] != NULL; i++) { ++ free(he->h_aliases[i]); ++ } ++ free(he->h_aliases); ++ } ++ if(he->h_addr_list) { ++ free(he->h_addr_list); ++ } ++ free(he); ++} ++ ++int ++our_getaddrinfo(dead_pool *pool, const char *node, const char *service, ++ void *hints, void *res) ++{ ++ int pos; ++ struct in_addr addr; ++ char *ipstr; ++ int ret; ++ ++ /* If "node" looks like a dotted-decimal ip address, then just call ++ the real getaddrinfo; otherwise we'll need to get an address from ++ our pool. */ ++ ++ /* TODO: work out what to do with AF_INET6 requests */ ++ ++#ifdef HAVE_INET_ATON ++ if(inet_aton(node, &addr) == 0) { ++#elif defined(HAVE_INET_ADDR) ++ /* If we're stuck with inet_addr, then getaddrinfo() won't work ++ properly with 255.255.255.255 (= -1). There's not much we can ++ do about this */ ++ in_addr_t is_valid; ++ is_valid = inet_addr(node); ++ if(is_valid == -1) { ++#endif ++ pos = store_pool_entry(pool, (char *) node, &addr); ++ if(pos == -1) { ++ return EAI_NONAME; ++ } else { ++ ipstr = strdup(inet_ntoa(addr)); ++ ret = realgetaddrinfo(ipstr, service, hints, res); ++ free(ipstr); ++ } ++ } else { ++ ret = realgetaddrinfo(node, service, hints, res); ++ } ++ ++ return ret; ++} ++ ++struct hostent * ++our_getipnodebyname(dead_pool *pool, const char *name, int af, int flags, ++ int *error_num) ++{ ++ int pos; ++ struct hostent *he = NULL; ++ int want_4in6 = 0; ++ char addr_convert_buf[80]; ++ struct in_addr pool_addr; ++ ++ if(af == AF_INET6) { ++ /* Caller has requested an AF_INET6 address, and is not prepared to ++ accept IPv4-mapped IPV6 addresses. There's nothing we can do to ++ service their request. */ ++ if((flags & AI_V4MAPPED) == 0) { ++ show_msg(MSGWARN, "getipnodebyname: asked for V6 addresses only, " ++ "but tsocks can't handle that\n"); ++ *error_num = NO_RECOVERY; ++ return NULL; ++ } else { ++ want_4in6 = 1; ++ } ++ } ++ ++ pos = store_pool_entry(pool, (char *)name, &pool_addr); ++ if(pos == -1) { ++ *error_num = HOST_NOT_FOUND; ++ return NULL; ++ } ++ ++ he = alloc_hostent(af); ++ if(he == NULL) { ++ show_msg(MSGERR, "getipnodebyname: failed to allocate hostent\n"); ++ *error_num = NO_RECOVERY; ++ return NULL; ++ } ++ ++ if(want_4in6) { ++ /* Convert the ipv4 address in *addr to an IPv4 in IPv6 mapped ++ address. TODO: inet_ntoa() is thread-safe on Solaris but might ++ not be on other platforms. */ ++ strcpy(addr_convert_buf, "::FFFF:"); ++ strcpy(addr_convert_buf+7, inet_ntoa(pool_addr)); ++ if(inet_pton(AF_INET6, addr_convert_buf, he->h_addr_list[0]) != 1) { ++ show_msg(MSGERR, "getipnodebyname: inet_pton() failed!\n"); ++ free_hostent(he); ++ *error_num = NO_RECOVERY; ++ return NULL; ++ } ++ } else { ++ ((struct in_addr *) he->h_addr_list[0])->s_addr = pool_addr.s_addr; ++ } ++ he->h_name = strdup(name); ++ ++ return he; ++} ++ ++ +diff -rN -U 5 tsocks-1.8/dead_pool.h tsocks/dead_pool.h +--- tsocks-1.8/dead_pool.h 1970-01-01 12:00:00.000000000 +1200 ++++ tsocks/dead_pool.h 2005-10-01 18:28:53.000000000 +1200 +@@ -0,0 +1,44 @@ ++#ifndef _DEAD_POOL_H ++#define _DEAD_POOL_H ++ ++#include <config.h> ++ ++extern int (*realconnect)(CONNECT_SIGNATURE); ++extern int (*realclose)(CLOSE_SIGNATURE); ++extern int (*realgetaddrinfo)(GETADDRINFO_SIGNATURE); ++ ++struct struct_pool_ent { ++ unsigned int ip; ++ char name[256]; ++}; ++ ++typedef struct struct_pool_ent pool_ent; ++ ++struct struct_dead_pool { ++ pool_ent *entries; /* Points to array of pool entries */ ++ int n_entries; /* Number of entries in the deadpool */ ++ unsigned int deadrange_base; /* Deadrange start IP in host byte order */ ++ unsigned int deadrange_mask; /* Deadrange netmask in host byte order */ ++ unsigned int deadrange_size; /* Number of IPs in the deadrange */ ++ unsigned int write_pos; /* Next position to use in the pool array */ ++ unsigned int dead_pos; /* Next 'unused' deadpool IP */ ++ uint32_t sockshost; ++ uint16_t socksport; ++ char pad[2]; ++}; ++ ++typedef struct struct_dead_pool dead_pool; ++ ++dead_pool *init_pool(int deadpool_size, struct in_addr deadrange_base, ++ struct in_addr deadrange_mask, char *sockshost, uint16_t socksport); ++int is_dead_address(dead_pool *pool, uint32_t addr); ++char *get_pool_entry(dead_pool *pool, struct in_addr *addr); ++int search_pool_for_name(dead_pool *pool, const char *name); ++struct hostent *our_gethostbyname(dead_pool *pool, const char *name); ++int our_getaddrinfo(dead_pool *pool, const char *node, const char *service, ++ void *hints, void *res); ++struct hostent *our_getipnodebyname(dead_pool *pool, const char *name, ++ int af, int flags, int *error_num); ++ ++#endif /* _DEAD_POOL_H */ ++ +diff -rN -U 5 tsocks-1.8/INSTALL tsocks/INSTALL +--- tsocks-1.8/INSTALL 2002-05-18 14:12:30.000000000 +1200 ++++ tsocks/INSTALL 2005-10-02 15:49:59.000000000 +1300 +@@ -2,14 +2,19 @@ + ------------------------------- + + 1. Unpack the archive (though if you're reading this you've already + achieved that) + +- tar -zxvf tsocks-<version>.tar.gx ++ tar -zxvf tsocks-<version>.tar.gz ++ OR ++ tar -jxvf tsocks-<version>.tar.bz + + 2. Run ./configure, options which might be of interest (and that are + specific to tsocks include): ++ --disable-tordns This option disables tordns, which causes ++ names to be looked up in a way designed to ++ work well with Tor. + --enable-socksdns This option causes tsocks to intercept + DNS lookups and attempt to force them + to use TCP instead of UDP and thus + be proxied through the socks server. This + is not a very elegant thing to do and +@@ -24,14 +29,14 @@ + address of the connect() method tsocks + overrides, instead it loads a reference + to the libc shared library and then uses + dlsym(). Again this is not very elegant + and shouldn't be required. +- --disable-hostnames This disables DNS lookups on names ++ --enable-hostnames This enables DNS lookups on names + provided as socks servers in the config +- file. This option is necessary +- if socks dns is enabled since tsocks ++ file. This option is not compatible with ++ tordns or socks dns, since tsocks + can't send a socks dns request to resolve + the location of the socks server. + --with-conf=<filename> You can specify the location of the tsocks + configuration file using this option, it + defaults to '/etc/tsocks.conf' +diff -rN -U 5 tsocks-1.8/Makefile.in tsocks/Makefile.in +--- tsocks-1.8/Makefile.in 2002-03-16 23:12:40.000000000 +1300 ++++ tsocks/Makefile.in 2005-10-02 21:58:35.000000000 +1300 +@@ -17,15 +17,17 @@ + INSPECT = inspectsocks + SAVE = saveme + LIB_NAME = libtsocks + COMMON = common + PARSER = parser ++DEADPOOL = dead_pool + VALIDATECONF = validateconf + SCRIPT = tsocks + SHLIB_MAJOR = 1 + SHLIB_MINOR = 8 + SHLIB = ${LIB_NAME}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} ++DEADPOOL_O = @DEADPOOL_O@ + + INSTALL = @INSTALL@ + INSTALL_DATA = @INSTALL_DATA@ + CFLAGS = @CFLAGS@ + INCLUDES = -I. +@@ -47,12 +49,12 @@ + ${SHCC} ${CFLAGS} ${INCLUDES} -o ${INSPECT} ${INSPECT}.c ${COMMON}.o ${LIBS} + + ${SAVE}: ${SAVE}.c + ${SHCC} ${CFLAGS} ${INCLUDES} -static -o ${SAVE} ${SAVE}.c + +-${SHLIB}: ${OBJS} ${COMMON}.o ${PARSER}.o +- ${SHCC} ${CFLAGS} ${INCLUDES} -nostdlib -shared -o ${SHLIB} ${OBJS} ${COMMON}.o ${PARSER}.o ${DYNLIB_FLAGS} ${SPECIALLIBS} ${LIBS} ++${SHLIB}: ${OBJS} ${COMMON}.o ${PARSER}.o ${DEADPOOL_O} ++ ${SHCC} ${CFLAGS} ${INCLUDES} -nostdlib -shared -o ${SHLIB} ${OBJS} ${COMMON}.o ${PARSER}.o ${DEADPOOL_O} ${DYNLIB_FLAGS} ${SPECIALLIBS} ${LIBS} + ln -sf ${SHLIB} ${LIB_NAME}.so + + %.so: %.c + ${SHCC} ${CFLAGS} ${INCLUDES} -c ${CC_SWITCHES} $< -o $@ + +@@ -81,6 +83,9 @@ + + clean: + -rm -f *.so *.so.* *.o *~ ${TARGETS} + + distclean: clean +- -rm -f config.cache config.log config.h Makefile ++ -rm -f config.cache config.log config.h Makefile \ ++ aclocal.m4 config.status ++ -rm -rf autom4te.cache ++ +diff -rN -U 5 tsocks-1.8/parser.c tsocks/parser.c +--- tsocks-1.8/parser.c 2002-03-14 01:34:22.000000000 +1300 ++++ tsocks/parser.c 2005-10-01 21:56:10.000000000 +1200 +@@ -27,10 +27,13 @@ + static int handle_reaches(struct parsedfile *, int, char *); + static int handle_server(struct parsedfile *, int, char *); + static int handle_type(struct parsedfile *config, int, char *); + static int handle_port(struct parsedfile *config, int, char *); + static int handle_local(struct parsedfile *, int, char *); ++static int handle_tordns_enabled(struct parsedfile *, int, char *); ++static int handle_tordns_deadpool_range(struct parsedfile *, int, char *); ++static int handle_tordns_cache_size(struct parsedfile *, int, char *); + static int handle_defuser(struct parsedfile *, int, char *); + static int handle_defpass(struct parsedfile *, int, char *); + static int make_netent(char *value, struct netent **ent); + + int read_config (char *filename, struct parsedfile *config) { +@@ -41,13 +44,17 @@ + struct serverent *server; + + /* Clear out the structure */ + memset(config, 0x0, sizeof(*config)); + +- /* Initialization */ ++ /* Initialization */ + currentcontext = &(config->defaultserver); + ++ /* Tordns defaults */ ++ config->tordns_cache_size = 256; ++ config->tordns_enabled = 1; ++ + /* If a filename wasn't provided, use the default */ + if (filename == NULL) { + strncpy(line, CONF_FILE, sizeof(line) - 1); + /* Insure null termination */ + line[sizeof(line) - 1] = (char) 0; +@@ -56,11 +63,11 @@ + + /* Read the configuration file */ + if ((conf = fopen(filename, "r")) == NULL) { + show_msg(MSGERR, "Could not open socks configuration file " + "(%s), assuming all networks local\n", filename); +- handle_local(config, 0, "0.0.0.0/0.0.0.0"); ++ handle_local(config, 0, "0.0.0.0/0.0.0.0"); + rc = 1; /* Severe errors reading configuration */ + } + else { + memset(&(config->defaultserver), 0x0, sizeof(config->defaultserver)); + +@@ -82,13 +89,17 @@ + server = (config->paths); + while (server != NULL) { + check_server(server); + server = server->next; + } +- + } + ++ /* Initialize tordns deadpool_range if not supplied */ ++ if(config->tordns_deadpool_range == NULL) { ++ handle_tordns_deadpool_range(config, 0, "127.0.69.0/255.255.255.0"); ++ } ++ + return(rc); + } + + /* Check server entries (and establish defaults) */ + static int check_server(struct serverent *server) { +@@ -150,11 +161,17 @@ + handle_defuser(config, lineno, words[2]); + } else if (!strcmp(words[0], "default_pass")) { + handle_defpass(config, lineno, words[2]); + } else if (!strcmp(words[0], "local")) { + handle_local(config, lineno, words[2]); +- } else { ++ } else if (!strcmp(words[0], "tordns_enable")) { ++ handle_tordns_enabled(config, lineno, words[2]); ++ } else if (!strcmp(words[0], "tordns_deadpool_range")) { ++ handle_tordns_deadpool_range(config, lineno, words[2]); ++ } else if (!strcmp(words[0], "tordns_cache_size")) { ++ handle_tordns_cache_size(config, lineno, words[2]); ++ } else { + show_msg(MSGERR, "Invalid pair type (%s) specified " + "on line %d in configuration file, " + ""%s"\n", words[0], lineno, + savedline); + } +@@ -416,10 +433,130 @@ + } + + return(0); + } + ++static int handle_flag(char *value) ++{ ++ if(!strcasecmp(value, "true") || !strcasecmp(value, "yes") ++ || !strcmp(value, "1")) { ++ return 1; ++ } else if (!strcasecmp(value, "false") || !strcasecmp(value, "no") ++ || !strcmp(value, "0")) { ++ return 0; ++ } else { ++ return -1; ++ } ++} ++ ++static int handle_tordns_enabled(struct parsedfile *config, int lineno, ++ char *value) ++{ ++ int val = handle_flag(value); ++ if(val == -1) { ++ show_msg(MSGERR, "Invalid value %s supplied for tordns_enabled at " ++ "line %d in config file, IGNORED\n", value, lineno); ++ } else { ++ config->tordns_enabled = val; ++ } ++ return 0; ++} ++ ++static int handle_tordns_cache_size(struct parsedfile *config, int lineno, ++ char *value) ++{ ++ char *endptr; ++ long size = strtol(value, &endptr, 10); ++ if(*endptr != '\0') { ++ show_msg(MSGERR, "Error parsing integer value for " ++ "tordns_cache_size (%s), using default %d\n", ++ value, config->tordns_cache_size); ++ } else if(size < 128) { ++ show_msg(MSGERR, "The value supplied for tordns_cache_size (%d) " ++ "is too small (<128), using default %d\n", size, ++ config->tordns_cache_size); ++ } else if(size > 4096) { ++ show_msg(MSGERR, "The value supplied for tordns_cache_range (%d) " ++ "is too large (>4096), using default %d\n", size, ++ config->tordns_cache_size); ++ } else { ++ config->tordns_cache_size = size; ++ } ++ return 0; ++} ++ ++static int handle_tordns_deadpool_range(struct parsedfile *config, int lineno, ++ char *value) ++{ ++ int rc; ++ struct netent *ent; ++ ++ if (config->tordns_deadpool_range != NULL) { ++ show_msg(MSGERR, "Only one 'deadpool' entry permitted, found a " ++ "second at line %d in configuration file.\n"); ++ return(0); ++ } ++ ++ if (currentcontext != &(config->defaultserver)) { ++ show_msg(MSGERR, "Deadpool cannot be specified in path " ++ "block at like %d in configuration file. " ++ "(Path block started at line %d)\n", ++ lineno, currentcontext->lineno); ++ return(0); ++ } ++ ++ rc = make_netent(value, &ent); ++ /* This is copied from handle_local and should probably be folded into ++ a generic whinge() function or something */ ++ switch(rc) { ++ case 1: ++ show_msg(MSGERR, "The deadpool specification (%s) is not validly " ++ "constructed on line %d in configuration " ++ "file\n", value, lineno); ++ return(0); ++ break; ++ case 2: ++ show_msg(MSGERR, "IP for deadpool " ++ "network specification (%s) is not valid on line " ++ "%d in configuration file\n", value, lineno); ++ return(0); ++ break; ++ case 3: ++ show_msg(MSGERR, "SUBNET for " ++ "deadpool network specification (%s) is not valid on " ++ "line %d in configuration file\n", value, ++ lineno); ++ return(0); ++ break; ++ case 4: ++ show_msg(MSGERR, "IP (%s) & ", inet_ntoa(ent->localip)); ++ show_msg(MSGERR, "SUBNET (%s) != IP on line %d in " ++ "configuration file, ignored\n", ++ inet_ntoa(ent->localnet), lineno); ++ return(0); ++ case 5: ++ case 6: ++ case 7: ++ show_msg(MSGERR, "Port specification is invalid and " ++ "not allowed in deadpool specification " ++ "(%s) on line %d in configuration file\n", ++ value, lineno); ++ return(0); ++ break; ++ } ++ if (ent->startport || ent->endport) { ++ show_msg(MSGERR, "Port specification is " ++ "not allowed in deadpool specification " ++ "(%s) on line %d in configuration file\n", ++ value, lineno); ++ return(0); ++ } ++ ++ config->tordns_deadpool_range = ent; ++ return 0; ++} ++ + static int handle_local(struct parsedfile *config, int lineno, char *value) { + int rc; + struct netent *ent; + + if (currentcontext != &(config->defaultserver)) { +diff -rN -U 5 tsocks-1.8/parser.h tsocks/parser.h +--- tsocks-1.8/parser.h 2002-02-10 20:26:27.000000000 +1300 ++++ tsocks/parser.h 2005-10-01 18:40:35.000000000 +1200 +@@ -23,18 +23,22 @@ + struct netent { + struct in_addr localip; /* Base IP of the network */ + struct in_addr localnet; /* Mask for the network */ + unsigned long startport; /* Range of ports for the */ + unsigned long endport; /* network */ +- struct netent *next; /* Pointer to next network entry */ ++ struct netent *next; /* Pointer to next network entry */ + }; + + /* Structure representing a complete parsed file */ + struct parsedfile { + struct netent *localnets; + struct serverent defaultserver; + struct serverent *paths; ++ int tordns_enabled; ++ int tordns_failopen; ++ int tordns_cache_size; ++ struct netent *tordns_deadpool_range; + }; + + /* Functions provided by parser module */ + int read_config(char *, struct parsedfile *); + int is_local(struct parsedfile *, struct in_addr *); +diff -rN -U 5 tsocks-1.8/README.TORDNS tsocks/README.TORDNS +--- tsocks-1.8/README.TORDNS 1970-01-01 12:00:00.000000000 +1200 ++++ tsocks/README.TORDNS 2005-10-02 15:47:16.000000000 +1300 +@@ -0,0 +1,187 @@ ++ ++TORDNS ++====== ++ ++What is it? ++----------- ++ ++This patch modifies the tsocks library to use SOCKS for name resolution. ++ ++ ++Why should I use it? ++-------------------- ++ ++* It's easier. ++ ++When using this patch you don't (always..) need to run 'tor-resolve' when ++using 'torify' anymore. Also, 'torify' now works directly with SSH without ++the need for connect scripts or other fiddling. [As long as SSH is not ++installed suid root]. ++ ++* It allows you to use programs which are not SOCKS aware to connect to ++.onion sites. ++ ++For example, you can ssh directly to a .onion site, or use telnet / netcat ++without hassle. ++ ++ ++QUICK: what do I need to do to make it work? ++-------------------------------------------- ++ ++Configuration instructions: ++ ++1) Get the sources ++ ++wget http://ftp1.sourceforge.net/tsocks/tsocks-1.8beta5.tar.gz ++wget http://www.totalinfosecurity.com/patches/tor-tsocks/tordns-1.8b5.patch ++ ++2) Unpack and apply the tsocks patch ++ ++tar xzvf tsocks-1.8beta5.tar.gz ++cd tsocks-1.8 ++patch -p1 < ../tordns-1.8b5.patch ++ ++3) Configure, compile and install ++ ++NOTE: The default 'configure' settings for tsocks have been changed by ++this patch. The --disable-hostnames option (don't try to use DNS to look ++up SOCKS servers) is now enabled by default. Also, tordns is enabled ++by default. ++ ++./configure ++make ++make install ++ ++All the tordns config options have sane default values which you should ++not need to change. ++ ++ ++Why did I need to use 'tor-resolve' with 'torify' in the first place? ++--------------------------------------------------------------------- ++ ++Because if you run "torify telnet bar.foo.com 31337", for example, then ++you're leaking information about what sites you're visiting to DNS servers. ++ ++The tor-resolve utility resolves names through tor using SOCKS, in a way ++that shouldn't compromise your privacy. ++ ++ ++What won't work with this? ++-------------------------- ++ ++The 'tordns' feature for tsocks only works with applications using the ++standard c library name lookup mechanisms. ++ ++Some programs roll their own name lookup functions, for example, 'curl' ++uses the 'adns' library, not the standard c library name lookup calls. ++In this case, you'll still be leaking DNS requests. ++ ++However, it seems that most programs which go to the trouble of implementing ++asynchronous DNS requests or doing other tricky things have native SOCKS or ++HTTP proxy support. ++ ++Requests for reverse name lookups are not intercepted. ++ ++Finally, the tsocks library is NOT thread-safe, with or without this patch. ++You should not 'torify' multithreaded applications. ++ ++ ++How does it work? ++----------------- ++ ++This patch adds interceptors for common name resolution calls to tsocks. ++Specifically, the 'gethostbyname', 'getaddrinfo' and 'getipnodebyname' library ++functions. (gethostbyname_r is not supported). ++ ++When a call to one of these functions is intercepted, a SOCKS4A resolve ++request is used to retrieve the relevant information, and the results are ++cached. ++ ++When the application calls 'connect', the cache is consulted and instead ++of making a SOCKS5 request and supplying the IP address, we connect using ++the name. This prevents those messages in the tor logs which look like: ++ ++ Sep 23 10:12:20.901 [warn] fetch_from_buf_socks(): Your application (using s ++ ocks5 on port 80) is giving Tor only an IP address. Applications that do DNS ++ resolves themselves may leak information. Consider using Socks4A (e.g. via ++ privoxy or socat) instead. ++ ++There are special provisions for handling .onion sites. When a program asks ++to resolve a name ending in '.onion', no name lookup is performed. A bogus IP ++address is returned. The range of unused IP addresses to hand out is called the ++"deadpool". This IP address doesn't mean anything in particular, and could be ++considered a cookie associated with the name. When the application eventually ++calls 'connect' with this bogus IP, the cache is consulted and the result is a ++SOCKS5 request which includes the name of the .onion site. ++ ++The default deadpool range is '127.0.69.0/255.255.255.0'. NOTE: if a resolve ++request results in an IP from the deadpool range then the response is rejected, ++and it appears to the application that the lookup failed. ++ ++The lookup cache is kept in mmap'd memory and shared across fork() calls. ++This is because some programs perform name lookups in a child process and ++then invoke 'connect' in the parent as a kind of "poor man's async DNS". ++ ++ ++Advanced configuration options ++------------------------------ ++ ++The following options have been added to the tsocks configuration file: ++ ++tordns_enable ++ ++ The default value is 'true'. If you set it to 'false', tsocks should work ++ just like it did without the tordns patch. ++ ++ ++tordns_deadpool_range ++ ++ The default value is '127.0.69.0/255.255.255.0'. This specifies what range ++ of IP addresses will be handed to the application as "cookies" for .onion ++ names. Of course, you should pick a block of addresses which you aren't ++ going to ever need to actually connect to. ++ ++ ++tordns_cache_size ++ ++ This specifies the number of IP addresses looked up through socks to cache. ++ The default value is 256. The default value is 256. Each entry consumes 260 ++ bytes of memory, so the default adds 66,560 bytes of overhead to each ++ 'torified' process. NOTE: if the number of IP addresses in ++ tordns_deadpool_range is less than the value specified for tordns_cache_size, ++ then the cache will be shrunk to fit the deadpool range. This is to prevent ++ duplicate deadpool addresses from ever appearing in the cache. ++ ++ ++TODO ++---- ++ ++* Think about how local names get resolved. Is it important? For example, ++ if I 'telnet localhost' which using tordns, what should happen? Should ++ we search through /etc/hosts ourselves or what? ++ ++* What about the isc library calls like res_init and so on? How widely are ++ they use? Does this present a more elegant way to implement this stuff? ++ ++* Perhaps intercept res_query etc and try to do something appropriate. ++ ++* It should be possible to make this thread-safe with --enable-threads. ++ ++* validateconf needs to be updated to understand (and show information about) ++ the tordns configuration options. ++ ++* Perhaps intercept reverse name lookups? ++ ++* In fact, one could modify tsocks further to play nicely with tor. For ++ example, you could prevent nonlocal UDP traffic from being sent at all, ++ and so on. ++ ++ ++****************************************************** ++Questions or comments, please contact: ++Blair Strang (bls@totalinfosecurity.com) ++Caleb Anderson (caleb.anderson@totalinfosecurity.com) ++Carl Purvis (carl.purvis@totalinfosecurity.com) ++ ++Total Information Security Ltd. ++http://www.totalinfosecurity.com/ +diff -rN -U 5 tsocks-1.8/tsocks.c tsocks/tsocks.c +--- tsocks-1.8/tsocks.c 2002-07-16 10:50:52.000000000 +1200 ++++ tsocks/tsocks.c 2005-10-01 22:01:48.000000000 +1200 +@@ -51,19 +51,26 @@ + #ifdef USE_SOCKS_DNS + #include <resolv.h> + #endif + #include <parser.h> + #include <tsocks.h> ++#include "dead_pool.h" + + /* Global Declarations */ + #ifdef USE_SOCKS_DNS + static int (*realresinit)(void); + #endif +-static int (*realconnect)(CONNECT_SIGNATURE); ++#ifdef USE_TOR_DNS ++static dead_pool *pool = NULL; ++static struct hostent *(*realgethostbyname)(GETHOSTBYNAME_SIGNATURE); ++int (*realgetaddrinfo)(GETADDRINFO_SIGNATURE); ++static struct hostent *(*realgetipnodebyname)(GETIPNODEBYNAME_SIGNATURE); ++#endif ++int (*realconnect)(CONNECT_SIGNATURE); + static int (*realselect)(SELECT_SIGNATURE); + static int (*realpoll)(POLL_SIGNATURE); +-static int (*realclose)(CLOSE_SIGNATURE); ++int (*realclose)(CLOSE_SIGNATURE); + static struct parsedfile *config; + static struct connreq *requests = NULL; + static int suid = 0; + static char *conffile = NULL; + +@@ -74,10 +81,15 @@ + int poll(POLL_SIGNATURE); + int close(CLOSE_SIGNATURE); + #ifdef USE_SOCKS_DNS + int res_init(void); + #endif ++#ifdef USE_TOR_DNS ++struct hostent *gethostbyname(GETHOSTBYNAME_SIGNATURE); ++int getaddrinfo(GETADDRINFO_SIGNATURE); ++struct hostent *getipnodebyname(GETIPNODEBYNAME_SIGNATURE); ++#endif + + /* Private Function Prototypes */ + static int get_config(); + static int get_environment(); + static int connect_server(struct connreq *conn); +@@ -97,10 +109,14 @@ + static int recv_buffer(struct connreq *conn); + static int read_socksv5_method(struct connreq *conn); + static int read_socksv4_req(struct connreq *conn); + static int read_socksv5_connect(struct connreq *conn); + static int read_socksv5_auth(struct connreq *conn); ++#ifdef USE_TOR_DNS ++static int deadpool_init(); ++static int send_socksv4a_request(struct connreq *conn, const char *onion_host); ++#endif + + void _init(void) { + #ifdef USE_OLD_DLSYM + void *lib; + #endif +@@ -118,24 +134,38 @@ + realpoll = dlsym(RTLD_NEXT, "poll"); + realclose = dlsym(RTLD_NEXT, "close"); + #ifdef USE_SOCKS_DNS + realresinit = dlsym(RTLD_NEXT, "res_init"); + #endif ++ #ifdef USE_TOR_DNS ++ realgethostbyname = dlsym(RTLD_NEXT, "gethostbyname"); ++ realgetaddrinfo = dlsym(RTLD_NEXT, "getaddrinfo"); ++ realgetipnodebyname = dlsym(RTLD_NEXT, "getipnodebyname"); ++ #endif + #else + lib = dlopen(LIBCONNECT, RTLD_LAZY); + realconnect = dlsym(lib, "connect"); + realselect = dlsym(lib, "select"); + realpoll = dlsym(lib, "poll"); + #ifdef USE_SOCKS_DNS + realresinit = dlsym(lib, "res_init"); + #endif +- dlclose(lib); +- ++ #ifdef USE_TOR_DNS ++ realgethostbyname = dlsym(lib, "gethostbyname"); ++ realgetaddrinfo = dlsym(lib, "getaddrinfo"); ++ realgetipnodebyname = dlsym(RTLD_NEXT, "getipnodebyname"); ++ #endif ++ dlclose(lib); + lib = dlopen(LIBC, RTLD_LAZY); +- realclose = dlsym(lib, "close"); ++ realclose = dlsym(lib, "close"); + dlclose(lib); + #endif ++#ifdef USE_TOR_DNS ++ /* Unfortunately, we can't do this lazily because otherwise our mmap'd ++ area won't be shared across fork()s. */ ++ deadpool_init(); ++#endif + } + + static int get_environment() { + static int done = 0; + int loglevel = MSGERR; +@@ -181,12 +211,11 @@ + if (config->paths) + show_msg(MSGDEBUG, "First lineno for first path is %d\n", config->paths->lineno); + + done = 1; + +- return(0); +- ++ return(0); + } + + int connect(CONNECT_SIGNATURE) { + struct sockaddr_in *connaddr; + struct sockaddr_in peer_address; +@@ -271,16 +300,21 @@ + if (!getpeername(__fd, (struct sockaddr *) &peer_address, &namelen)) { + show_msg(MSGDEBUG, "Socket is already connected, defering to " + "real connect\n"); + return(realconnect(__fd, __addr, __len)); + } +- ++ + show_msg(MSGDEBUG, "Got connection request for socket %d to " + "%s\n", __fd, inet_ntoa(connaddr->sin_addr)); + + /* If the address is local call realconnect */ ++#ifdef USE_TOR_DNS ++ if (!(is_local(config, &(connaddr->sin_addr))) && ++ !is_dead_address(pool, connaddr->sin_addr.s_addr)) { ++#else + if (!(is_local(config, &(connaddr->sin_addr)))) { ++#endif + show_msg(MSGDEBUG, "Connection for socket %d is local\n", __fd); + return(realconnect(__fd, __addr, __len)); + } + + /* Ok, so its not local, we need a path to the net */ +@@ -869,19 +903,74 @@ + return((rc ? errno : 0)); + } + + static int send_socks_request(struct connreq *conn) { + int rc = 0; +- +- if (conn->path->type == 4) +- rc = send_socksv4_request(conn); +- else +- rc = send_socksv5_method(conn); + ++#ifdef USE_TOR_DNS ++ if (conn->path->type == 4) { ++ char *name = get_pool_entry(pool, &(conn->connaddr.sin_addr)); ++ if(name != NULL) { ++ rc = send_socksv4a_request(conn,name); ++ } else { ++ rc = send_socksv4_request(conn); ++ } ++#else ++ if (conn->path->type == 4) { ++ rc = send_socksv4_request(conn); ++#endif ++ } else { ++ rc = send_socksv5_method(conn); ++ } + return(rc); + } + ++#ifdef USE_TOR_DNS ++static int send_socksv4a_request(struct connreq *conn,const char *onion_host) ++{ ++ struct passwd *user; ++ struct sockreq *thisreq; ++ int endOfUser; ++ /* Determine the current username */ ++ user = getpwuid(getuid()); ++ ++ thisreq = (struct sockreq *) conn->buffer; ++ endOfUser=sizeof(struct sockreq) + ++ (user == NULL ? 0 : strlen(user->pw_name)) + 1; ++ ++ /* Check the buffer has enough space for the request */ ++ /* and the user name */ ++ conn->datalen = endOfUser+ ++ (onion_host == NULL ? 0 : strlen(onion_host)) + 1; ++ if (sizeof(conn->buffer) < conn->datalen) { ++ show_msg(MSGERR, "The SOCKS username is too long"); ++ conn->state = FAILED; ++ return(ECONNREFUSED); ++ } ++ ++ /* Create the request */ ++ thisreq->version = 4; ++ thisreq->command = 1; ++ thisreq->dstport = conn->connaddr.sin_port; ++ thisreq->dstip = htonl(1); ++ ++ /* Copy the username */ ++ strcpy((char *) thisreq + sizeof(struct sockreq), ++ (user == NULL ? "" : user->pw_name)); ++ ++ /* Copy the onion host */ ++ strcpy((char *) thisreq + endOfUser, ++ (onion_host == NULL ? "" : onion_host)); ++ ++ conn->datadone = 0; ++ conn->state = SENDING; ++ conn->nextstate = SENTV4REQ; ++ ++ return(0); ++} ++#endif /* USE_TOR_DNS */ ++ + static int send_socksv4_request(struct connreq *conn) { + struct passwd *user; + struct sockreq *thisreq; + + /* Determine the current username */ +@@ -931,10 +1020,14 @@ + + return(0); + } + + static int send_socksv5_connect(struct connreq *conn) { ++#ifdef USE_TOR_DNS ++ int namelen = 0; ++ char *name = NULL; ++#endif + char constring[] = { 0x05, /* Version 5 SOCKS */ + 0x01, /* Connect request */ + 0x00, /* Reserved */ + 0x01 }; /* IP Version 4 */ + +@@ -942,14 +1035,42 @@ + conn->datadone = 0; + conn->state = SENDING; + conn->nextstate = SENTV5CONNECT; + memcpy(conn->buffer, constring, sizeof(constring)); + conn->datalen = sizeof(constring); +- memcpy(&conn->buffer[conn->datalen], &(conn->connaddr.sin_addr.s_addr), +- sizeof(conn->connaddr.sin_addr.s_addr)); +- conn->datalen += sizeof(conn->connaddr.sin_addr.s_addr); +- memcpy(&conn->buffer[conn->datalen], &(conn->connaddr.sin_port), sizeof(conn->connaddr.sin_port)); ++ ++#ifdef USE_TOR_DNS ++ show_msg(MSGDEBUG, "send_socksv5_connect: looking for: %s\n", ++ inet_ntoa(conn->connaddr.sin_addr)); ++ ++ name = get_pool_entry(pool, &(conn->connaddr.sin_addr)); ++ if(name != NULL) { ++ namelen = strlen(name); ++ if(namelen > 255) { /* "Can't happen" */ ++ name = NULL; ++ } ++ } ++ if(name != NULL) { ++ show_msg(MSGDEBUG, "send_socksv5_connect: found it!\n"); ++ /* Substitute the domain name from the pool into the SOCKS request. */ ++ conn->buffer[3] = 0x03; /* Change the ATYP field */ ++ conn->buffer[4] = namelen; /* Length of name */ ++ conn->datalen++; ++ memcpy(&conn->buffer[conn->datalen], name, namelen); ++ conn->datalen += namelen; ++ } else { ++ show_msg(MSGDEBUG, "send_socksv5_connect: ip address not found\n"); ++#endif ++ /* Use the raw IP address */ ++ memcpy(&conn->buffer[conn->datalen], &(conn->connaddr.sin_addr.s_addr), ++ sizeof(conn->connaddr.sin_addr.s_addr)); ++ conn->datalen += sizeof(conn->connaddr.sin_addr.s_addr); ++#ifdef USE_TOR_DNS ++ } ++#endif ++ memcpy(&conn->buffer[conn->datalen], &(conn->connaddr.sin_port), ++ sizeof(conn->connaddr.sin_port)); + conn->datalen += sizeof(conn->connaddr.sin_port); + + return(0); + } + +@@ -1175,24 +1296,56 @@ + + return(rc); + } + #endif + +-#if 0 +- /* Get the flags of the socket, (incase its non blocking */ +- if ((sockflags = fcntl(sockid, F_GETFL)) == -1) { +- sockflags = 0; +- } ++#ifdef USE_TOR_DNS ++static int deadpool_init() ++{ ++ if(!pool) { ++ get_environment(); ++ get_config(); ++ if(config->tordns_enabled) { ++ pool = init_pool( ++ config->tordns_cache_size, ++ config->tordns_deadpool_range->localip, ++ config->tordns_deadpool_range->localnet, ++ config->defaultserver.address, ++ config->defaultserver.port ++ ); ++ if(!pool) { ++ show_msg(MSGERR, "failed to initialize deadpool: tordns disabled\n"); ++ } ++ } ++ } ++ return 0; ++} ++ ++struct hostent *gethostbyname(GETHOSTBYNAME_SIGNATURE) ++{ ++ if(pool) { ++ return our_gethostbyname(pool, name); ++ } else { ++ return realgethostbyname(name); ++ } ++} ++ ++int getaddrinfo(GETADDRINFO_SIGNATURE) ++{ ++ if(pool) { ++ return our_getaddrinfo(pool, node, service, hints, res); ++ } else { ++ return realgetaddrinfo(node, service, hints, res); ++ } ++} ++ ++struct hostent *getipnodebyname(GETIPNODEBYNAME_SIGNATURE) ++{ ++ if(pool) { ++ return our_getipnodebyname(pool, name, af, flags, error_num); ++ } else { ++ return realgetipnodebyname(name, af, flags, error_num); ++ } ++} + +- /* If the flags show the socket as blocking, set it to */ +- /* blocking for our connection to the socks server */ +- if ((sockflags & O_NONBLOCK) != 0) { +- fcntl(sockid, F_SETFL, sockflags & (~(O_NONBLOCK))); +- } + #endif +-#if 0 +- /* If the socket was in non blocking mode, restore that */ +- if ((sockflags & O_NONBLOCK) != 0) { +- fcntl(sockid, F_SETFL, sockflags); +- } +-#endif + +diff -rN -U 5 tsocks-1.8/tsocks.conf.5 tsocks/tsocks.conf.5 +--- tsocks-1.8/tsocks.conf.5 2002-05-18 14:13:08.000000000 +1200 ++++ tsocks/tsocks.conf.5 2005-10-01 21:41:50.000000000 +1200 +@@ -124,10 +124,33 @@ + 150.0.0.0:80-1024/255.0.0.0" indicates to tsocks that the SOCKS server + specified in the current path block should be used to access any IPs in the + range 150.0.0.0 to 150.255.255.255 when the connection request is for ports + 80-1024. + ++.TP ++.I tordns_enable ++This enables the use of the 'tordns' feature in tsocks, which overrides the ++standard C library name resolution calls to use SOCKS. The default value is ++'true'. ++ ++.TP ++.I tordns_deadpool_range ++Tor hidden sites do not have real IP addresses. This specifies what range of ++IP addresses will be handed to the application as "cookies" for .onion names. ++Of course, you should pick a block of addresses which you aren't going to ever ++need to actually connect to. The default value is '127.0.69.0/255.255.255.0'. ++ ++.TP ++.I tordns_cache_size ++This specifies the number of IP addresses looked up through SOCKS to cache. ++The default value is 256. Each entry consumes 260 bytes of memory, so the ++default adds 66,560 bytes of overhead to each 'torified' process. NOTE: if ++the number of IP addresses in tordns_deadpool_range is less than the value ++specified for tordns_cache_size, then the cache will be shrunk to fit the ++deadpool range. This is to prevent duplicate deadpool addresses from ever ++appearing in the cache. ++ + .SH UTILITIES + tsocks comes with two utilities that can be useful in creating and verifying + the tsocks configuration file. + + .TP +diff -rN -U 5 tsocks-1.8/tsocks.h tsocks/tsocks.h +--- tsocks-1.8/tsocks.h 2002-03-14 01:58:09.000000000 +1300 ++++ tsocks/tsocks.h 2005-09-24 01:38:12.000000000 +1200 +@@ -50,11 +50,11 @@ + int selectevents; + + /* Buffer for sending and receiving on the socket */ + int datalen; + int datadone; +- char buffer[1024]; ++ char buffer[2048]; + + struct connreq *next; + }; + + /* Connection statuses */ +diff -rN -U 5 tsocks-1.8/validateconf.c tsocks/validateconf.c +--- tsocks-1.8/validateconf.c 2002-02-07 23:49:59.000000000 +1300 ++++ tsocks/validateconf.c 2005-10-01 19:38:08.000000000 +1200 +@@ -161,11 +161,24 @@ + printf("\n"); + server = server->next; + } + } + +- return; ++#ifdef USE_TOR_DNS ++ /* Show tordns configuration options */ ++ printf("=== TorDNS Configuration Options ===\n"); ++ printf("Tor DNS enabled: %s\n", ++ config->tordns_enabled ? "yes" : "no"); ++ printf("Tor DNS deadpool range: %s/", ++ inet_ntoa(config->tordns_deadpool_range->localip)); ++ printf("%s\n", ++ inet_ntoa(config->tordns_deadpool_range->localnet)); ++ printf("Tor DNS cache size: %d\n", config->tordns_cache_size); ++ printf("\n"); ++#endif ++ ++ return; + } + + void show_server(struct parsedfile *config, struct serverent *server, int def) { + struct in_addr res; + struct netent *net; diff --git a/patches/README b/patches/README deleted file mode 100644 index 2f921a9..0000000 --- a/patches/README +++ /dev/null @@ -1,88 +0,0 @@ -This is a list of the patches applied to tsocks between it's last -official release and 15/06/08. All changes applied to the source after -that date are recorded in the Changelog. - -NB: These patches are stored for historical reasons only. I have not - confirmed that they all apply cleanly to the tsocks source. I do not - know in what order they should be applied. - -File: getaddrbyhost.patch (Robert Hogan) -Date: 18/06/08 -Description: -Add support for getaddrbyhost. - -File: compilewarnings.patch (Robert Hogan) -Date: 2007 -Description: - Suppresses a number of compile warnings. Also introduces reasonable defaults - for use of Tor. - - -File: getpeername.patch (Peter Palfrader weasel@debian.org) -Date: Sat, 27 Mar 2004 13:20:56 +0100 -Description: - "If we are not done setting up the connection yet, getpeername() should - return -1 and ENOTCONN. - - This is necessary since some applications, when using non-blocking connect, - (like ircII) use getpeername() to find out if they are connected already. - - This results in races sometimes, where the client sends data to the socket - before we are done with the socks connection setup. Another solution would - be to intercept send(). - - This could be extended to actually set the peername to the peer the - client application has requested, but not for now. - - this patch is almost the same, only it uses state != DONE instead of - state == CONNECTING to find out when to send ENOTCONN back. - - this patch tries to also do continue the socks setup in getpeername(), - if it isn't done yet." - - -File: infiniteloop.patch (Peter Palfrader weasel@debian.org) -Date: Sat, 20 Mar 2004 11:41:41 +0100 -Description: - "If the server just disconnects when tsocks expects a reply, tsocks - will get stuck in an infinite busy loop." - - -File: localaddresses.patch (Roger Dingledine) -Date: Sat, 01 Apr 2006 18:17:50 -0500 -Description: - "I just noticed that tsocks hard-codes the 127.0.0.0/8 subnet - as being "local", meaning it won't ever go through the socks - proxy. - - The Tor controller's mapaddress command can assign virtual addresses - in the 127/8 space: see section 3.8 of - http://tor.eff.org/cvs/tor/doc/control-spec.txt - - We think this behavior should be allowed. Here's a patch to tsocks to - make it not always hard-code its local network." - - -File: conffile.patch ( Roderick Schertler roderick@argon.org) -Date: Fri, 03 Jun 2005 08:43:59 -0400 -Description: tsocks(8) says TSOCKS_CONFFILE but should say TSOCKS_CONF_FILE -Details: - "The tsocks(8) man page says TSOCKS_CONFFILE but should say - TSOCKS_CONF_FILE. Though this is a documentation error I don't think - it qualifies as minor. For me the program didn't work at all because - I needed to run it with an alternative config file, and I needed to - download the source to figure out the problem." - - -File: tordns.patch (Total Information Security) -Date: 2005-10-XX (?) -Original Reference: http://www.totalinfosecurity.com/patches/tor.php -Description: - "Patch from Total Information Security to resolve the DNS leakage problem - and allow access to addresses with nonstandard hostnames (e.g. those ending - in .onion)." - -Notes: - 'Total Information Security' appears to be defunct so the original link for - the patch is now dead. The patch stored here was taken from : - https://bugs.gentoo.org/show_bug.cgi?id=148550 diff --git a/patches/README.TORDNS b/patches/README.TORDNS deleted file mode 100644 index 0b7dafd..0000000 --- a/patches/README.TORDNS +++ /dev/null @@ -1,187 +0,0 @@ - -TORDNS -====== - -What is it? ------------ - -This patch modifies the tsocks library to use SOCKS for name resolution. - - -Why should I use it? --------------------- - -* It's easier. - -When using this patch you don't (always..) need to run 'tor-resolve' when -using 'torify' anymore. Also, 'torify' now works directly with SSH without -the need for connect scripts or other fiddling. [As long as SSH is not -installed suid root]. - -* It allows you to use programs which are not SOCKS aware to connect to -.onion sites. - -For example, you can ssh directly to a .onion site, or use telnet / netcat -without hassle. - - -QUICK: what do I need to do to make it work? --------------------------------------------- - -Configuration instructions: - -1) Get the sources - -wget http://ftp1.sourceforge.net/tsocks/tsocks-1.8beta5.tar.gz -wget http://www.totalinfosecurity.com/patches/tor-tsocks/tordns-1.8b5.patch - -2) Unpack and apply the tsocks patch - -tar xzvf tsocks-1.8beta5.tar.gz -cd tsocks-1.8 -patch -p1 < ../tordns-1.8b5.patch - -3) Configure, compile and install - -NOTE: The default 'configure' settings for tsocks have been changed by -this patch. The --disable-hostnames option (don't try to use DNS to look -up SOCKS servers) is now enabled by default. Also, tordns is enabled -by default. - -./configure -make -make install - -All the tordns config options have sane default values which you should -not need to change. - - -Why did I need to use 'tor-resolve' with 'torify' in the first place? ---------------------------------------------------------------------- - -Because if you run "torify telnet bar.foo.com 31337", for example, then -you're leaking information about what sites you're visiting to DNS servers. - -The tor-resolve utility resolves names through tor using SOCKS, in a way -that shouldn't compromise your privacy. - - -What won't work with this? --------------------------- - -The 'tordns' feature for tsocks only works with applications using the -standard c library name lookup mechanisms. - -Some programs roll their own name lookup functions, for example, 'curl' -uses the 'adns' library, not the standard c library name lookup calls. -In this case, you'll still be leaking DNS requests. - -However, it seems that most programs which go to the trouble of implementing -asynchronous DNS requests or doing other tricky things have native SOCKS or -HTTP proxy support. - -Requests for reverse name lookups are not intercepted. - -Finally, the tsocks library is NOT thread-safe, with or without this patch. -You should not 'torify' multithreaded applications. - - -How does it work? ------------------ - -This patch adds interceptors for common name resolution calls to tsocks. -Specifically, the 'gethostbyname', 'getaddrinfo' and 'getipnodebyname' library -functions. (gethostbyname_r is not supported). - -When a call to one of these functions is intercepted, a SOCKS4A resolve -request is used to retrieve the relevant information, and the results are -cached. - -When the application calls 'connect', the cache is consulted and instead -of making a SOCKS5 request and supplying the IP address, we connect using -the name. This prevents those messages in the tor logs which look like: - - Sep 23 10:12:20.901 [warn] fetch_from_buf_socks(): Your application (using s - ocks5 on port 80) is giving Tor only an IP address. Applications that do DNS - resolves themselves may leak information. Consider using Socks4A (e.g. via - privoxy or socat) instead. - -There are special provisions for handling .onion sites. When a program asks -to resolve a name ending in '.onion', no name lookup is performed. A bogus IP -address is returned. The range of unused IP addresses to hand out is called the -"deadpool". This IP address doesn't mean anything in particular, and could be -considered a cookie associated with the name. When the application eventually -calls 'connect' with this bogus IP, the cache is consulted and the result is a -SOCKS5 request which includes the name of the .onion site. - -The default deadpool range is '127.0.69.0/255.255.255.0'. NOTE: if a resolve -request results in an IP from the deadpool range then the response is rejected, -and it appears to the application that the lookup failed. - -The lookup cache is kept in mmap'd memory and shared across fork() calls. -This is because some programs perform name lookups in a child process and -then invoke 'connect' in the parent as a kind of "poor man's async DNS". - - -Advanced configuration options ------------------------------- - -The following options have been added to the tsocks configuration file: - -tordns_enable - - The default value is 'true'. If you set it to 'false', tsocks should work - just like it did without the tordns patch. - - -tordns_deadpool_range - - The default value is '127.0.69.0/255.255.255.0'. This specifies what range - of IP addresses will be handed to the application as "cookies" for .onion - names. Of course, you should pick a block of addresses which you aren't - going to ever need to actually connect to. - - -tordns_cache_size - - This specifies the number of IP addresses looked up through socks to cache. - The default value is 256. The default value is 256. Each entry consumes 260 - bytes of memory, so the default adds 66,560 bytes of overhead to each - 'torified' process. NOTE: if the number of IP addresses in - tordns_deadpool_range is less than the value specified for tordns_cache_size, - then the cache will be shrunk to fit the deadpool range. This is to prevent - duplicate deadpool addresses from ever appearing in the cache. - - -TODO ----- - -* Think about how local names get resolved. Is it important? For example, - if I 'telnet localhost' which using tordns, what should happen? Should - we search through /etc/hosts ourselves or what? - -* What about the isc library calls like res_init and so on? How widely are - they use? Does this present a more elegant way to implement this stuff? - -* Perhaps intercept res_query etc and try to do something appropriate. - -* It should be possible to make this thread-safe with --enable-threads. - -* validateconf needs to be updated to understand (and show information about) - the tordns configuration options. - -* Perhaps intercept reverse name lookups? - -* In fact, one could modify tsocks further to play nicely with tor. For - example, you could prevent nonlocal UDP traffic from being sent at all, - and so on. - - -****************************************************** -Questions or comments, please contact: -Blair Strang (bls@totalinfosecurity.com) -Caleb Anderson (caleb.anderson@totalinfosecurity.com) -Carl Purvis (carl.purvis@totalinfosecurity.com) - -Total Information Security Ltd. -http://www.totalinfosecurity.com/ diff --git a/patches/compilewarnings.patch b/patches/compilewarnings.patch deleted file mode 100644 index 9c93be1..0000000 --- a/patches/compilewarnings.patch +++ /dev/null @@ -1,739 +0,0 @@ -Only in /home/robert/Development/tork/src/tsocks/: .#Makefile.in.1.12 -Only in /home/robert/Development/tork/src/tsocks/: .deps -Only in /home/robert/Development/tork/src/tsocks/: .libs -Common subdirectories: /backup/robert/Development/torsocks/CVS and /home/robert/Development/tork/src/tsocks/CVS -diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/ChangeLog /home/robert/Development/tork/src/tsocks/ChangeLog ---- /backup/robert/Development/torsocks/ChangeLog 2008-06-15 10:43:02.000000000 +0100 -+++ /home/robert/Development/tork/src/tsocks/ChangeLog 2007-09-30 16:13:34.000000000 +0100 -@@ -1,15 +1,5 @@ --version 1.81 - 2006.11.17 ruben@ugr.es -- Integrated and resolved the conflicts for the following -- patches: -- -DNS from totalinfosecurity mentioned below -- -Infinite Loop from weasel -- -Getpeername from weasel -- -Documentation patch from Roderick Schertler -- -Localhost patch from Roger Dingledine -- (patches 1, 3, 4, 5 and 7 from -- http://wiki.noreply.org/noreply/TheOnionRouter/TSocksPatches) -- Patches 2 and 6 were not applied because I don't have access to -- osx or bsd and can't test them. (And the bsd patch breaks linux) -+Renamed for TorK to avoid conflicts with existing tsocks installations. -+Robert Hogan - - version 1.80tordns - 2005.10.4 bls@totalinfosecurity.com - Intercept gethostbyname() and friends, added --tordns -Only in /home/robert/Development/tork/src/tsocks/: Makefile -Only in /home/robert/Development/tork/src/tsocks/: Makefile.am~ -Only in /home/robert/Development/tork/src/tsocks/: Makefile.in~ -Only in /home/robert/Development/tork/src/tsocks/: README -Only in /home/robert/Development/tork/src/tsocks/: TODO~ -Only in /backup/robert/Development/torsocks: acconfig.h -Only in /home/robert/Development/tork/src/tsocks/: aclocal -diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/common.c /home/robert/Development/tork/src/tsocks/common.c ---- /backup/robert/Development/torsocks/common.c 2008-06-15 10:43:02.000000000 +0100 -+++ /home/robert/Development/tork/src/tsocks/common.c 2008-04-05 22:36:40.000000000 +0100 -@@ -4,7 +4,7 @@ - - */ - --#include <config.h> -+#include <config.h> - #include <stdio.h> - #include <netdb.h> - #include <common.h> -@@ -15,6 +15,7 @@ - #include <time.h> - #include <unistd.h> - #include <arpa/inet.h> -+#include <sys/types.h> - #include <netinet/in.h> - - /* Globals */ -@@ -37,7 +38,7 @@ - #ifdef HAVE_GETHOSTBYNAME - if ((new = gethostbyname(host)) == (struct hostent *) 0) { - #endif -- return(-1); -+ return(0); - #ifdef HAVE_GETHOSTBYNAME - } else { - ip = ((struct in_addr *) * new->h_addr_list); -@@ -47,7 +48,7 @@ - } - #endif - } else -- return(-1); -+ return(0); - } - - return (hostaddr); -@@ -99,10 +100,10 @@ - return nbits; - } - --void show_msg(int level, char *fmt, ...) { -- va_list ap; -- int saveerr; -- extern char *progname; -+void show_msg(int level, const char *fmt, ...) { -+ va_list ap; -+ int saveerr; -+/* extern char *progname; */ - char timestring[20]; - time_t timestamp; - -@@ -128,7 +129,7 @@ - fprintf(logfile, "%s ", timestring); - } - -- // fputs(progname, logfile); -+ /* fputs(progname, logfile); */ - - if (logstamp) { - fprintf(logfile, "(%d)", getpid()); -Only in /home/robert/Development/tork/src/tsocks/: common.c~ -diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/common.h /home/robert/Development/tork/src/tsocks/common.h ---- /backup/robert/Development/torsocks/common.h 2008-06-15 10:43:02.000000000 +0100 -+++ /home/robert/Development/tork/src/tsocks/common.h 2007-11-02 20:23:55.000000000 +0000 -@@ -1,7 +1,7 @@ - /* Common functions provided in common.c */ - - void set_log_options(int, char *, int); --void show_msg(int level, char *, ...); -+void show_msg(int level, const char *, ...); - int count_netmask_bits(uint32_t mask); - unsigned int resolve_ip(char *, int, int); - -Only in /home/robert/Development/tork/src/tsocks/: common.lo -Only in /backup/robert/Development/torsocks: config.guess -Only in /backup/robert/Development/torsocks: config.h.in -Only in /backup/robert/Development/torsocks: config.status -Only in /backup/robert/Development/torsocks: config.sub -Only in /backup/robert/Development/torsocks: configure.in -diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/dead_pool.c /home/robert/Development/tork/src/tsocks/dead_pool.c ---- /backup/robert/Development/torsocks/dead_pool.c 2008-06-15 10:43:02.000000000 +0100 -+++ /home/robert/Development/tork/src/tsocks/dead_pool.c 2008-04-05 22:35:46.000000000 +0100 -@@ -1,5 +1,6 @@ - #include <stdio.h> - #include <sys/socket.h> -+#include <sys/types.h> - #include <netinet/in.h> - #include <arpa/inet.h> - #include <netdb.h> -@@ -29,10 +30,11 @@ - } - - dead_pool * --init_pool(int pool_size, struct in_addr deadrange_base, -+init_pool(unsigned int pool_size, struct in_addr deadrange_base, - struct in_addr deadrange_mask, char *sockshost, uint16_t socksport) - { -- int i, deadrange_bits, deadrange_width, deadrange_size; -+ unsigned int i, deadrange_size, deadrange_width; -+ int deadrange_bits; - struct in_addr socks_server; - dead_pool *newpool = NULL; - -@@ -182,7 +184,7 @@ - int - search_pool_for_name(dead_pool *pool, const char *name) - { -- int i; -+ unsigned int i; - for(i=0; i < pool->n_entries; i++){ - if(strcmp(name, pool->entries[i].name) == 0){ - return i; -@@ -194,7 +196,7 @@ - char * - get_pool_entry(dead_pool *pool, struct in_addr *addr) - { -- int i; -+ unsigned int i; - uint32_t intaddr = addr->s_addr; - - if(pool == NULL) { -Only in /home/robert/Development/tork/src/tsocks/: dead_pool.c~ -diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/dead_pool.h /home/robert/Development/tork/src/tsocks/dead_pool.h ---- /backup/robert/Development/torsocks/dead_pool.h 2008-06-15 10:43:02.000000000 +0100 -+++ /home/robert/Development/tork/src/tsocks/dead_pool.h 2007-11-02 20:59:58.000000000 +0000 -@@ -1,7 +1,7 @@ - #ifndef _DEAD_POOL_H - #define _DEAD_POOL_H - --#include <config.h> -+#include <config.h> - - extern int (*realconnect)(CONNECT_SIGNATURE); - extern int (*realclose)(CLOSE_SIGNATURE); -@@ -16,7 +16,7 @@ - - struct struct_dead_pool { - pool_ent *entries; /* Points to array of pool entries */ -- int n_entries; /* Number of entries in the deadpool */ -+ unsigned int n_entries; /* Number of entries in the deadpool */ - unsigned int deadrange_base; /* Deadrange start IP in host byte order */ - unsigned int deadrange_mask; /* Deadrange netmask in host byte order */ - unsigned int deadrange_size; /* Number of IPs in the deadrange */ -@@ -29,7 +29,7 @@ - - typedef struct struct_dead_pool dead_pool; - --dead_pool *init_pool(int deadpool_size, struct in_addr deadrange_base, -+dead_pool *init_pool(unsigned int deadpool_size, struct in_addr deadrange_base, - struct in_addr deadrange_mask, char *sockshost, uint16_t socksport); - int is_dead_address(dead_pool *pool, uint32_t addr); - char *get_pool_entry(dead_pool *pool, struct in_addr *addr); -Only in /home/robert/Development/tork/src/tsocks/: dead_pool.lo -Only in /home/robert/Development/tork/src/tsocks/: getpeername.patch -Only in /home/robert/Development/tork/src/tsocks/: infiniteloop.patch -diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/inspectsocks.c /home/robert/Development/tork/src/tsocks/inspectsocks.c ---- /backup/robert/Development/torsocks/inspectsocks.c 2008-06-15 10:43:02.000000000 +0100 -+++ /home/robert/Development/tork/src/tsocks/inspectsocks.c 2008-04-05 22:36:40.000000000 +0100 -@@ -23,11 +23,11 @@ - */ - - /* Global configuration variables */ --char *progname = "inspectsocks"; /* Name for error msgs */ -+const char *progname = "inspectsocks"; /* Name for error msgs */ - int defaultport = 1080; /* Default SOCKS port */ - - /* Header Files */ --#include <config.h> -+#include <config.h> - #include <stdio.h> - #include <stdlib.h> - #include <unistd.h> -@@ -35,6 +35,7 @@ - #include <sys/socket.h> - #include <string.h> - #include <strings.h> -+#include <sys/types.h> - #include <netinet/in.h> - #include <arpa/inet.h> - #include <errno.h> -@@ -44,7 +45,7 @@ - int reqlen, void *rep, int replen); - - int main(int argc, char *argv[]) { -- char *usage = "Usage: <socks server name/ip> [portno]"; -+ const char *usage = "Usage: <socks server name/ip> [portno]"; - char req[9]; - char resp[100]; - unsigned short int portno = defaultport; -@@ -68,7 +69,7 @@ - } - case 2: - if ((server.sin_addr.s_addr = resolve_ip(argv[1], 1,HOSTNAMES)) -- == -1) { -+ == 0) { - show_msg(MSGERR, "Invalid IP/host specified (%s)\n", argv[1]); - show_msg(MSGERR, "%s\n", usage); - exit(1); -Only in /home/robert/Development/tork/src/tsocks/: inspectsocks.c~ -Only in /home/robert/Development/tork/src/tsocks/: libtorksocks.la -diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/parser.c /home/robert/Development/tork/src/tsocks/parser.c ---- /backup/robert/Development/torsocks/parser.c 2008-06-15 10:43:02.000000000 +0100 -+++ /home/robert/Development/tork/src/tsocks/parser.c 2008-04-05 22:25:54.000000000 +0100 -@@ -12,7 +12,7 @@ - #include <stdio.h> - #include <stdlib.h> - #include <errno.h> --#include <config.h> -+#include <config.h> - #include "common.h" - #include "parser.h" - -@@ -24,15 +24,15 @@ - static int check_server(struct serverent *); - static int tokenize(char *, int, char *[]); - static int handle_path(struct parsedfile *, int, int, char *[]); --static int handle_endpath(struct parsedfile *, int, int, char *[]); --static int handle_reaches(struct parsedfile *, int, char *); -+static int handle_endpath(struct parsedfile *, int, int); -+static int handle_reaches(int, char *); - static int handle_server(struct parsedfile *, int, char *); - static int handle_type(struct parsedfile *config, int, char *); - static int handle_port(struct parsedfile *config, int, char *); --static int handle_local(struct parsedfile *, int, char *); -+static int handle_local(struct parsedfile *, int, const char *); - static int handle_tordns_enabled(struct parsedfile *, int, char *); --static int handle_tordns_deadpool_range(struct parsedfile *, int, char *); --static int handle_tordns_cache_size(struct parsedfile *, int, char *); -+static int handle_tordns_deadpool_range(struct parsedfile *, int, const char *); -+static int handle_tordns_cache_size(struct parsedfile *, char *); - static int handle_defuser(struct parsedfile *, int, char *); - static int handle_defpass(struct parsedfile *, int, char *); - static int make_netent(char *value, struct netent **ent); -@@ -54,6 +54,7 @@ - config->tordns_cache_size = 256; - config->tordns_enabled = 1; - -+ - /* If a filename wasn't provided, use the default */ - if (filename == NULL) { - strncpy(line, CONF_FILE, sizeof(line) - 1); -@@ -62,15 +63,19 @@ - filename = line; - } - -- /* Read the configuration file */ -+ /* If there is no configuration file use reasonable defaults for Tor */ - if ((conf = fopen(filename, "r")) == NULL) { - show_msg(MSGERR, "Could not open socks configuration file " - "(%s), assuming all networks local\n", filename); -- handle_local(config, 0, "0.0.0.0/0.0.0.0"); -+ memset(&(config->defaultserver), 0x0, sizeof(config->defaultserver)); -+ check_server(&(config->defaultserver)); -+ handle_local(config, 0, "127.0.0.0/255.0.0.0"); -+/* handle_local(config, 0, "0.0.0.0/0.0.0.0");*/ - rc = 1; /* Severe errors reading configuration */ - } - else { -- memset(&(config->defaultserver), 0x0, sizeof(config->defaultserver)); -+ -+ memset(&(config->defaultserver), 0x0, sizeof(config->defaultserver)); - - while (NULL != fgets(line, MAXLINE, conf)) { - /* This line _SHOULD_ end in \n so we */ -@@ -82,11 +87,8 @@ - } - fclose(conf); - -- if (!config->localnets) { -- /* Use 127.0.0.1/255.0.0.0 by default */ -- handle_local(config, 0, "127.0.0.0/255.0.0.0"); -- } -- -+ /* Always add the 127.0.0.1/255.0.0.0 subnet to local */ -+ handle_local(config, 0, "127.0.0.0/255.0.0.0"); - - /* Check default server */ - check_server(&(config->defaultserver)); -@@ -108,9 +110,14 @@ - /* Check server entries (and establish defaults) */ - static int check_server(struct serverent *server) { - -- /* Default to the default SOCKS port */ -+ /* Default to the default Tor Socks port */ - if (server->port == 0) { -- server->port = 1080; -+ server->port = 9050; -+ } -+ -+ /* Default to a presumably local installation of Tor */ -+ if (server->address == NULL) { -+ server->address = strdup("127.0.0.1"); - } - - /* Default to SOCKS V4 */ -@@ -137,7 +144,7 @@ - /* Set the spare slots to an empty string to simplify */ - /* processing */ - for (i = nowords; i < 10; i++) -- words[i] = ""; -+ words[i] = NULL; - - if (nowords > 0) { - /* Now this can either be a "path" block starter or */ -@@ -146,7 +153,7 @@ - if (!strcmp(words[0], "path")) { - handle_path(config, lineno, nowords, words); - } else if (!strcmp(words[0], "}")) { -- handle_endpath(config, lineno, nowords, words); -+ handle_endpath(config, lineno, nowords); - } else { - /* Has to be a pair */ - if ((nowords != 3) || (strcmp(words[1], "="))) { -@@ -154,7 +161,7 @@ - "on line %d in configuration " - "file, "%s"\n", lineno, savedline); - } else if (!strcmp(words[0], "reaches")) { -- handle_reaches(config, lineno, words[2]); -+ handle_reaches(lineno, words[2]); - } else if (!strcmp(words[0], "server")) { - handle_server(config, lineno, words[2]); - } else if (!strcmp(words[0], "server_port")) { -@@ -172,7 +179,7 @@ - } else if (!strcmp(words[0], "tordns_deadpool_range")) { - handle_tordns_deadpool_range(config, lineno, words[2]); - } else if (!strcmp(words[0], "tordns_cache_size")) { -- handle_tordns_cache_size(config, lineno, words[2]); -+ handle_tordns_cache_size(config, words[2]); - } else { - show_msg(MSGERR, "Invalid pair type (%s) specified " - "on line %d in configuration file, " -@@ -244,7 +251,7 @@ - return(0); - } - --static int handle_endpath(struct parsedfile *config, int lineno, int nowords, char *words[]) { -+static int handle_endpath(struct parsedfile *config, int lineno, int nowords) { - - if (nowords != 1) { - show_msg(MSGERR, "Badly formed path close statement on line " -@@ -261,7 +268,7 @@ - return(0); - } - --static int handle_reaches(struct parsedfile *config, int lineno, char *value) { -+static int handle_reaches(int lineno, char *value) { - int rc; - struct netent *ent; - -@@ -465,7 +472,7 @@ - return 0; - } - --static int handle_tordns_cache_size(struct parsedfile *config, int lineno, -+static int handle_tordns_cache_size(struct parsedfile *config, - char *value) - { - char *endptr; -@@ -489,7 +496,7 @@ - } - - static int handle_tordns_deadpool_range(struct parsedfile *config, int lineno, -- char *value) -+ const char *value) - { - int rc; - struct netent *ent; -@@ -508,7 +515,7 @@ - return(0); - } - -- rc = make_netent(value, &ent); -+ rc = make_netent((char *)value, &ent); - /* This is copied from handle_local and should probably be folded into - a generic whinge() function or something */ - switch(rc) { -@@ -559,7 +566,7 @@ - return 0; - } - --static int handle_local(struct parsedfile *config, int lineno, char *value) { -+static int handle_local(struct parsedfile *config, int lineno, const char *value) { - int rc; - struct netent *ent; - -@@ -571,7 +578,7 @@ - return(0); - } - -- rc = make_netent(value, &ent); -+ rc = make_netent((char *)value, &ent); - switch(rc) { - case 1: - show_msg(MSGERR, "Local network specification (%s) is not validly " -@@ -777,7 +784,7 @@ - /* standard strsep and this function is that this one will */ - /* set *separator to the character separator found if it isn't null */ - char *strsplit(char *separator, char **text, const char *search) { -- int len; -+ unsigned int len; - char *ret; - - ret = *text; -Only in /home/robert/Development/tork/src/tsocks/: parser.c~ -diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/parser.h /home/robert/Development/tork/src/tsocks/parser.h ---- /backup/robert/Development/torsocks/parser.h 2008-06-15 10:43:02.000000000 +0100 -+++ /home/robert/Development/tork/src/tsocks/parser.h 2007-11-02 21:00:20.000000000 +0000 -@@ -35,7 +35,7 @@ - struct serverent *paths; - int tordns_enabled; - int tordns_failopen; -- int tordns_cache_size; -+ unsigned int tordns_cache_size; - struct netent *tordns_deadpool_range; - }; - -Only in /home/robert/Development/tork/src/tsocks/: parser.lo -Only in /home/robert/Development/tork/src/tsocks/: soname.diff -Only in /home/robert/Development/tork/src/tsocks/: stamp-h2 -Only in /home/robert/Development/tork/src/tsocks/: tork-tsocks.conf -Only in /home/robert/Development/tork/src/tsocks/: torkify -Only in /home/robert/Development/tork/src/tsocks/: torkify.1 -Only in /home/robert/Development/tork/src/tsocks/: torkify.in -Only in /backup/robert/Development/torsocks: torksock.diff -Only in /home/robert/Development/tork/src/tsocks/: torksocks -Only in /home/robert/Development/tork/src/tsocks/: torksocks.1 -Only in /home/robert/Development/tork/src/tsocks/: torksocks.8 -Only in /home/robert/Development/tork/src/tsocks/: torksocks.announce -Only in /home/robert/Development/tork/src/tsocks/: torksocks.conf.5 -Only in /backup/robert/Development/torsocks: torksocks.diff -Only in /home/robert/Development/tork/src/tsocks/: torksocks.in -Only in /home/robert/Development/tork/src/tsocks/: torksocks.in~ -Only in /backup/robert/Development/torsocks: torksocks2.diff -Only in /backup/robert/Development/torsocks: torksockscols.diff -Only in /backup/robert/Development/torsocks: tsocks -Only in /backup/robert/Development/torsocks: tsocks.1 -Only in /backup/robert/Development/torsocks: tsocks.8 -Only in /backup/robert/Development/torsocks: tsocks.announce -diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/tsocks.c /home/robert/Development/tork/src/tsocks/tsocks.c ---- /backup/robert/Development/torsocks/tsocks.c 2008-06-15 10:43:01.000000000 +0100 -+++ /home/robert/Development/tork/src/tsocks/tsocks.c 2008-06-14 20:11:26.000000000 +0100 -@@ -21,14 +21,14 @@ - */ - - /* PreProcessor Defines */ --#include <config.h> -+#include <config.h> - - #ifdef USE_GNU_SOURCE - #define _GNU_SOURCE - #endif - - /* Global configuration variables */ --char *progname = "libtsocks"; /* Name used in err msgs */ -+const char *progname = "libtsocks"; /* Name used in err msgs */ - - /* Header Files */ - #include <stdio.h> -@@ -39,6 +39,7 @@ - #include <sys/socket.h> - #include <string.h> - #include <strings.h> -+#include <sys/types.h> - #include <netinet/in.h> - #include <arpa/inet.h> - #include <sys/poll.h> -@@ -76,7 +77,7 @@ - static char *conffile = NULL; - - /* Exported Function Prototypes */ --void _init(void); -+void __attribute__ ((constructor)) tsocks_init(void); - int connect(CONNECT_SIGNATURE); - int select(SELECT_SIGNATURE); - int poll(POLL_SIGNATURE); -@@ -114,11 +115,11 @@ - static int read_socksv5_connect(struct connreq *conn); - static int read_socksv5_auth(struct connreq *conn); - #ifdef USE_TOR_DNS --static int deadpool_init(); -+static int deadpool_init(void); - static int send_socksv4a_request(struct connreq *conn, const char *onion_host); - #endif - --void _init(void) { -+void tsocks_init(void) { - #ifdef USE_OLD_DLSYM - void *lib; - #endif -@@ -139,50 +140,49 @@ - #ifdef USE_SOCKS_DNS - realresinit = dlsym(RTLD_NEXT, "res_init"); - #endif -- #ifdef USE_TOR_DNS -- realgethostbyname = dlsym(RTLD_NEXT, "gethostbyname"); -- realgetaddrinfo = dlsym(RTLD_NEXT, "getaddrinfo"); -- realgetipnodebyname = dlsym(RTLD_NEXT, "getipnodebyname"); -- #endif -+ #ifdef USE_TOR_DNS -+ realgethostbyname = dlsym(RTLD_NEXT, "gethostbyname"); -+ realgetaddrinfo = dlsym(RTLD_NEXT, "getaddrinfo"); -+ realgetipnodebyname = dlsym(RTLD_NEXT, "getipnodebyname"); -+ #endif - #else - lib = dlopen(LIBCONNECT, RTLD_LAZY); - realconnect = dlsym(lib, "connect"); - realselect = dlsym(lib, "select"); - realpoll = dlsym(lib, "poll"); -- realgetpeername = dlsym(lib, "getpeername"); - #ifdef USE_SOCKS_DNS - realresinit = dlsym(lib, "res_init"); - #endif -- #ifdef USE_TOR_DNS -- realgethostbyname = dlsym(lib, "gethostbyname"); -- realgetaddrinfo = dlsym(lib, "getaddrinfo"); -- realgetipnodebyname = dlsym(RTLD_NEXT, "getipnodebyname"); -- #endif -- dlclose(lib); -+ #ifdef USE_TOR_DNS -+ realgethostbyname = dlsym(lib, "gethostbyname"); -+ realgetaddrinfo = dlsym(lib, "getaddrinfo"); -+ realgetipnodebyname = dlsym(RTLD_NEXT, "getipnodebyname"); -+ #endif -+ dlclose(lib); - lib = dlopen(LIBC, RTLD_LAZY); - realclose = dlsym(lib, "close"); -- dlclose(lib); -+ dlclose(lib); - #endif - #ifdef USE_TOR_DNS -- /* Unfortunately, we can't do this lazily because otherwise our mmap'd -- area won't be shared across fork()s. */ -- deadpool_init(); --#endif -- -+ /* Unfortunately, we can't do this lazily because otherwise our mmap'd -+ area won't be shared across fork()s. */ -+ deadpool_init(); -+#endif - } - - static int get_environment() { - static int done = 0; -+#ifdef ALLOW_MSG_OUTPUT - int loglevel = MSGERR; - char *logfile = NULL; - char *env; -- -+#endif - if (done) - return(0); - - /* Determine the logging level */ - #ifndef ALLOW_MSG_OUTPUT -- set_log_options(-1, stderr, 0); -+ set_log_options(-1, (char *)stderr, 0); - #else - if ((env = getenv("TSOCKS_DEBUG"))) - loglevel = atoi(env); -@@ -212,7 +212,7 @@ - config = malloc(sizeof(*config)); - if (!config) - return(0); -- read_config(conffile, config); -+ read_config(conffile, config); - if (config->paths) - show_msg(MSGDEBUG, "First lineno for first path is %d\n", config->paths->lineno); - -@@ -222,14 +222,15 @@ - } - - int connect(CONNECT_SIGNATURE) { -- struct sockaddr_in *connaddr; -- struct sockaddr_in peer_address; -- struct sockaddr_in server_address; -- int gotvalidserver = 0, rc, namelen = sizeof(peer_address); -- int sock_type = -1; -- int sock_type_len = sizeof(sock_type); -- unsigned int res = -1; -- struct serverent *path; -+ struct sockaddr_in *connaddr; -+ struct sockaddr_in peer_address; -+ struct sockaddr_in server_address; -+ int gotvalidserver = 0, rc; -+ unsigned int namelen = sizeof(peer_address); -+ int sock_type = -1; -+ unsigned int sock_type_len = sizeof(sock_type); -+ int res = -1; -+ struct serverent *path; - struct connreq *newconn; - - get_environment(); -@@ -248,6 +249,14 @@ - getsockopt(__fd, SOL_SOCKET, SO_TYPE, - (void *) &sock_type, &sock_type_len); - -+ show_msg(MSGDEBUG, "sin_family: %i " -+ "\n", -+ connaddr->sin_family); -+ -+ show_msg(MSGDEBUG, "sockopt: %i " -+ "\n", -+ sock_type); -+ - /* If this isn't an INET socket for a TCP stream we can't */ - /* handle it, just call the real connect now */ - if ((connaddr->sin_family != AF_INET) || -@@ -564,7 +573,8 @@ - - int poll(POLL_SIGNATURE) { - int nevents = 0; -- int rc = 0, i; -+ int rc = 0; -+ unsigned int i; - int setevents = 0; - int monitoring = 0; - struct connreq *conn, *nextconn; -@@ -1354,7 +1364,7 @@ - #endif - - #ifdef USE_TOR_DNS --static int deadpool_init() -+static int deadpool_init(void) - { - if(!pool) { - get_environment(); -Only in /home/robert/Development/tork/src/tsocks/: tsocks.c.rej -Only in /backup/robert/Development/torsocks: tsocks.conf.5 -Only in /home/robert/Development/tork/src/tsocks/: tsocks.c~ -diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/tsocks.h /home/robert/Development/tork/src/tsocks/tsocks.h ---- /backup/robert/Development/torsocks/tsocks.h 2008-06-15 10:43:01.000000000 +0100 -+++ /home/robert/Development/tork/src/tsocks/tsocks.h 2007-11-02 20:35:02.000000000 +0000 -@@ -50,8 +50,8 @@ - int selectevents; - - /* Buffer for sending and receiving on the socket */ -- int datalen; -- int datadone; -+ unsigned int datalen; -+ unsigned int datadone; - char buffer[2048]; - - struct connreq *next; -Only in /backup/robert/Development/torsocks: tsocks.kdevelop -Only in /backup/robert/Development/torsocks: tsocks.kdevelop.pcs -Only in /backup/robert/Development/torsocks: tsocks.kdevses -Only in /home/robert/Development/tork/src/tsocks/: tsocks.lo -diff -u -x Makefile.am -x Makefile.in -x configure -x INSTALL -x README.TORDNS -x COPYING -x Changelog -x Doxyfile -x FAQ -x TODO /backup/robert/Development/torsocks/validateconf.c /home/robert/Development/tork/src/tsocks/validateconf.c ---- /backup/robert/Development/torsocks/validateconf.c 2008-06-15 10:43:01.000000000 +0100 -+++ /home/robert/Development/tork/src/tsocks/validateconf.c 2008-04-05 22:36:40.000000000 +0100 -@@ -23,16 +23,17 @@ - */ - - /* Global configuration variables */ --char *progname = "validateconf"; /* Name for error msgs */ -+const char *progname = "validateconf"; /* Name for error msgs */ - - /* Header Files */ --#include <config.h> -+#include <config.h> - #include <stdio.h> - #include <stdlib.h> - #include <unistd.h> - #include <sys/types.h> - #include <sys/socket.h> - #include <string.h> -+#include <sys/types.h> - #include <netinet/in.h> - #include <arpa/inet.h> - #include <errno.h> -@@ -44,7 +45,7 @@ - void test_host(struct parsedfile *config, char *); - - int main(int argc, char *argv[]) { -- char *usage = "Usage: [-f conf file] [-t hostname/ip[:port]]"; -+ const char *usage = "Usage: [-f conf file] [-t hostname/ip[:port]]"; - char *filename = NULL; - char *testhost = NULL; - struct parsedfile config; -@@ -103,7 +104,7 @@ - } - - /* First resolve the host to an ip */ -- if ((hostaddr.s_addr = resolve_ip(hostname, 0, 1)) == -1) { -+ if ((hostaddr.s_addr = resolve_ip(hostname, 0, 1)) == 0) { - fprintf(stderr, "Error: Cannot resolve %s\n", host); - return; - } else { -@@ -187,13 +188,13 @@ - if (server->address != NULL) - printf("Server: %s (%s)\n", server->address, - ((res.s_addr = resolve_ip(server->address, 0, -- HOSTNAMES)) == -1 -+ HOSTNAMES)) == 0 - ? "Invalid!" : inet_ntoa(res))); - else - printf("Server: ERROR! None specified\n"); - - /* Check the server is on a local net */ -- if ((server->address != NULL) && (res.s_addr != -1) && -+ if ((server->address != NULL) && (res.s_addr != 0) && - (is_local(config, &res))) - fprintf(stderr, "Error: Server is not on a network " - "specified as local\n"); -Only in /home/robert/Development/tork/src/tsocks/: validateconf.c~ diff --git a/patches/conffile.patch b/patches/conffile.patch deleted file mode 100644 index 1dd6491..0000000 --- a/patches/conffile.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- tsocks.8.~1~ 2002-03-16 05:20:51.000000000 -0500 -+++ tsocks.8 2005-06-03 08:37:39.000000000 -0400 -@@ -59,7 +59,7 @@ - variables as follows: - - .TP --.I TSOCKS_CONFFILE -+.I TSOCKS_CONF_FILE - This environment variable overrides the default location of the tsocks - configuration file. This variable is not honored if the program tsocks - is embedded in is setuid. In addition this environment variable can diff --git a/patches/getaddrbyhost.patch b/patches/getaddrbyhost.patch deleted file mode 100644 index 29b2234..0000000 --- a/patches/getaddrbyhost.patch +++ /dev/null @@ -1,696 +0,0 @@ -Index: common.c -=================================================================== -RCS file: /cvsroot/tork/torsocks/common.c,v -retrieving revision 1.2 -diff -p -U3 -r1.2 common.c ---- common.c 15 Jun 2008 10:01:03 -0000 1.2 -+++ common.c 18 Jun 2008 21:21:34 -0000 -@@ -26,6 +26,52 @@ char logfilename[256]; /* Name of fil - FILE *logfile = NULL; /* File to which messages should be logged */ - int logstamp = 0; /* Timestamp (and pid stamp) messages */ - -+ -+/** -+ * Read a 16-bit value beginning at <b>cp</b>. Equivalent to -+ * *(uint16_t*)(cp), but will not cause segfaults on platforms that forbid -+ * unaligned memory access. -+ */ -+uint16_t -+get_uint16(const char *cp) -+{ -+ uint16_t v; -+ memcpy(&v,cp,2); -+ return v; -+} -+/** -+ * Read a 32-bit value beginning at <b>cp</b>. Equivalent to -+ * *(uint32_t*)(cp), but will not cause segfaults on platforms that forbid -+ * unaligned memory access. -+ */ -+uint32_t -+get_uint32(const char *cp) -+{ -+ uint32_t v; -+ memcpy(&v,cp,4); -+ return v; -+} -+/** -+ * Set a 16-bit value beginning at <b>cp</b> to <b>v</b>. Equivalent to -+ * *(uint16_t)(cp) = v, but will not cause segfaults on platforms that forbid -+ * unaligned memory access. */ -+void -+set_uint16(char *cp, uint16_t v) -+{ -+ memcpy(cp,&v,2); -+} -+/** -+ * Set a 32-bit value beginning at <b>cp</b> to <b>v</b>. Equivalent to -+ * *(uint32_t)(cp) = v, but will not cause segfaults on platforms that forbid -+ * unaligned memory access. */ -+void -+set_uint32(char *cp, uint32_t v) -+{ -+ memcpy(cp,&v,4); -+} -+ -+ -+ - unsigned int resolve_ip(char *host, int showmsg, int allownames) { - struct hostent *new; - unsigned int hostaddr; -Index: dead_pool.c -=================================================================== -RCS file: /cvsroot/tork/torsocks/dead_pool.c,v -retrieving revision 1.2 -diff -p -U3 -r1.2 dead_pool.c ---- dead_pool.c 15 Jun 2008 10:02:41 -0000 1.2 -+++ dead_pool.c 18 Jun 2008 21:21:35 -0000 -@@ -15,7 +15,8 @@ void get_next_dead_address(dead_pool *po - - static int - do_resolve(const char *hostname, uint32_t sockshost, uint16_t socksport, -- uint32_t *result_addr); -+ uint32_t *result_addr, const void *addr, -+ int version, int reverse, char **result_hostname); - - /* Compares the last strlen(s2) characters of s1 with s2. Returns as for - strcasecmp. */ -@@ -77,6 +78,8 @@ init_pool(unsigned int pool_size, struct - return NULL; - } - -+ show_msg(MSGWARN, "init_pool: sockshost %s ", sockshost); -+ - /* Initialize the dead_pool structure */ - #ifdef HAVE_INET_ATON - inet_aton(sockshost, &socks_server); -@@ -139,6 +142,7 @@ store_pool_entry(dead_pool *pool, char * - int oldpos; - int rc; - uint32_t intaddr; -+ char *result_hostname; - - show_msg(MSGDEBUG, "store_pool_entry: storing '%s'\n", hostname); - show_msg(MSGDEBUG, "store_pool_entry: write pos is: %d\n", pool->write_pos); -@@ -156,7 +160,9 @@ store_pool_entry(dead_pool *pool, char * - if(strcasecmpend(hostname, ".onion") == 0) { - get_next_dead_address(pool, &pool->entries[position].ip); - } else { -- rc = do_resolve(hostname, pool->sockshost, pool->socksport, &intaddr); -+ rc = do_resolve(hostname, pool->sockshost, pool->socksport, &intaddr, 0, -+ 4 /*SOCKS5*/, 0 /*Reverse*/, &result_hostname); -+ - if(rc != 0) { - show_msg(MSGWARN, "failed to resolve: %s\n", hostname); - return -1; -@@ -237,7 +243,32 @@ build_socks4a_resolve_request(char **out - return len; - } - -+static int -+build_socks5_resolve_ptr_request(char **out, const void *_addr) -+{ -+ size_t len; -+ const struct in_addr *addr=_addr; -+ -+ len = 12; -+ *out = malloc(len); -+ (*out)[0] = 5; /* SOCKS version 5 */ -+ (*out)[1] = '\xF1'; /* Command: reverse resolve. -+ see doc/socks-extensions.txt*/ -+ (*out)[2] = '\x00'; /* RSV */ -+ (*out)[3] = '\x01'; /* ATYP: IP V4 address: X'01' */ -+ -+ set_uint32((*out)+4, addr->s_addr);/*IP*/ -+ set_uint16((*out)+4+4, 0); /* port */ -+ -+// memcpy((*out)+4, &addr.s_addr,4); /*IP*/ -+// memcpy((*out)+4+4, *(uint32_t)0, 2); /* port */ -+ -+ return len; -+} -+ - #define RESPONSE_LEN 8 -+#define SOCKS5_LEN 4 -+#define METHODRESPONSE_LEN 2 - - static int - parse_socks4a_resolve_response(const char *response, size_t len, -@@ -272,43 +303,188 @@ parse_socks4a_resolve_response(const cha - } - - static int -+parse_socks5_resolve_ptr_response(int s,const char *response, size_t len, -+ uint32_t *result_addr, char ***result_hostname) -+{ -+ char reply_buf[4]; -+ int r; -+ -+ len=0; -+ while (len < SOCKS5_LEN) { -+ r = recv(s, reply_buf+len, SOCKS5_LEN-len, 0); -+ if (r==0) { -+ show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS5 response\n"); -+ return -1; -+ } -+ if (r<0) { -+ show_msg(MSGWARN, "do_resolve: error reading SOCKS5 response\n"); -+ return -1; -+ } -+ len += r; -+ } -+ -+ if (reply_buf[0] != 5) { -+ show_msg(MSGWARN, "Bad SOCKS5 reply version."); -+ return -1; -+ } -+ if (reply_buf[1] != 0) { -+ show_msg(MSGWARN,"Got status response '%u': SOCKS5 request failed.", -+ (unsigned)reply_buf[1]); -+ return -1; -+ } -+ if (reply_buf[3] == 1) { -+ /* IPv4 address */ -+ len=0; -+ while (len < SOCKS5_LEN) { -+ r = recv(s, reply_buf+len, SOCKS5_LEN-len, 0); -+ if (r==0) { -+ show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS5 response\n"); -+ return -1; -+ } -+ if (r<0) { -+ show_msg(MSGWARN, "do_resolve: error reading address in SOCKS5 response\n"); -+ return -1; -+ } -+ len += r; -+ } -+ *result_addr = ntohl(get_uint32(reply_buf)); -+ } else if (reply_buf[3] == 3) { -+ size_t result_len; -+ len=0; -+ while (len < 1) { -+ r = recv(s, reply_buf+len, 1-len, 0); -+ if (r==0) { -+ show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS5 response\n"); -+ return -1; -+ } -+ if (r<0) { -+ show_msg(MSGWARN, "do_resolve: error reading address length in SOCKS5 response\n"); -+ return -1; -+ } -+ len += r; -+ } -+ result_len = *(uint8_t*)(reply_buf); -+ **result_hostname = malloc(result_len+1); -+ len=0; -+ while (len < (int) result_len) { -+ r = recv(s, **result_hostname+len, result_len-len, 0); -+ if (r==0) { -+ show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS5 response\n"); -+ return -1; -+ } -+ if (r<0) { -+ show_msg(MSGWARN, "do_resolve: error reading hostname in SOCKS5 response\n"); -+ return -1; -+ } -+ len += r; -+ } -+ -+ (**result_hostname)[result_len] = '\0'; -+ } -+ -+ return 0; -+} -+ -+static int - do_resolve(const char *hostname, uint32_t sockshost, uint16_t socksport, -- uint32_t *result_addr) -+ uint32_t *result_addr, const void *addr, -+ int version, int reverse, char **result_hostname) - { - int s; - struct sockaddr_in socksaddr; -- char *req, *cp; -- int r, len; -+ char *req, *cp=NULL; -+ int r, len, hslen; - char response_buf[RESPONSE_LEN]; -+ const char *handshake="\x05\x01\x00"; - - show_msg(MSGDEBUG, "do_resolve: resolving %s\n", hostname); - -+ /* Create SOCKS connection */ - s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); - if (s<0) { - show_msg(MSGWARN, "do_resolve: problem creating socket\n"); - return -1; - } - -+ /* Connect to SOCKS server */ - memset(&socksaddr, 0, sizeof(socksaddr)); - socksaddr.sin_family = AF_INET; - socksaddr.sin_port = htons(socksport); - socksaddr.sin_addr.s_addr = htonl(sockshost); - if (realconnect(s, (struct sockaddr*)&socksaddr, sizeof(socksaddr))) { - show_msg(MSGWARN, "do_resolve: error connecting to SOCKS server\n"); -+ realclose(s); - return -1; - } - -- if ((len = build_socks4a_resolve_request(&req, "", hostname))<0) { -- show_msg(MSGWARN, "do_resolve: error generating SOCKS request\n"); -- return -1; -+ /* If a SOCKS5 connection, perform handshake */ -+ if (version == 5) { -+ char method_buf[2]; -+ hslen=3; -+ while (hslen) { -+ r = send(s, handshake, hslen, 0); -+ if (r<0) { -+ show_msg(MSGWARN, "do_resolve: error sending SOCKS5 method list.\n"); -+ realclose(s); -+ return -1; -+ } -+ hslen -= r; -+ handshake += r; -+ } -+ -+ len = 0; -+ while (len < METHODRESPONSE_LEN) { -+ r = recv(s, method_buf+len, METHODRESPONSE_LEN-len, 0); -+ if (r==0) { -+ show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS response\n"); -+ realclose(s); -+ return -1; -+ } -+ if (r<0) { -+ show_msg(MSGWARN, "do_resolve: error reading SOCKS response\n"); -+ realclose(s); -+ return -1; -+ } -+ len += r; -+ } -+ -+ if (method_buf[0] != '\x05') { -+ show_msg(MSGWARN, "Unrecognized socks version: %u", -+ (unsigned)method_buf[0]); -+ realclose(s); -+ return -1; -+ } -+ if (method_buf[1] != '\x00') { -+ show_msg(MSGWARN, "Unrecognized socks authentication method: %u", -+ (unsigned)method_buf[1]); -+ realclose(s); -+ return -1; -+ } -+ } -+ -+ /* Create SOCKS request */ -+ if (reverse) { -+ if ((len = build_socks5_resolve_ptr_request(&req, addr))<0) { -+ show_msg(MSGWARN, "do_resolve: error generating reverse SOCKS request\n"); -+ realclose(s); -+ return -1; -+ } -+ }else{ -+ if ((len = build_socks4a_resolve_request(&req, "", hostname))<0) { -+ show_msg(MSGWARN, "do_resolve: error generating SOCKS request\n"); -+ realclose(s); -+ return -1; -+ } - } - -+ /* Send SOCKS request */ - cp = req; - while (len) { - r = send(s, cp, len, 0); - if (r<0) { - show_msg(MSGWARN, "do_resolve: error sending SOCKS request\n"); - free(req); -+ realclose(s); - return -1; - } - len -= r; -@@ -316,26 +492,40 @@ do_resolve(const char *hostname, uint32_ - } - free(req); - -- len = 0; -- while (len < RESPONSE_LEN) { -- r = recv(s, response_buf+len, RESPONSE_LEN-len, 0); -- if (r==0) { -- show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS response\n"); -+ /* Handle SOCKS Response */ -+ if (reverse) { -+ if (parse_socks5_resolve_ptr_response(s, response_buf, RESPONSE_LEN, -+ result_addr, &result_hostname) < 0){ -+ show_msg(MSGWARN, "do_resolve: error parsing SOCKS response\n"); -+ realclose(s); - return -1; - } -- if (r<0) { -- show_msg(MSGWARN, "do_resolve: error reading SOCKS response\n"); -+ }else{ -+ /* Process SOCKS response */ -+ len = 0; -+ while (len < RESPONSE_LEN) { -+ r = recv(s, response_buf+len, RESPONSE_LEN-len, 0); -+ if (r==0) { -+ show_msg(MSGWARN, "do_resolve: EOF while reading SOCKS response\n"); -+ realclose(s); -+ return -1; -+ } -+ if (r<0) { -+ show_msg(MSGWARN, "do_resolve: error reading SOCKS response\n"); -+ realclose(s); -+ return -1; -+ } -+ len += r; -+ } -+ realclose(s); -+ -+ /* Parse SOCKS response */ -+ if (parse_socks4a_resolve_response(response_buf, RESPONSE_LEN, result_addr) < 0){ -+ show_msg(MSGWARN, "do_resolve: error parsing SOCKS response\n"); - return -1; - } -- len += r; - } - -- realclose(s); -- -- if (parse_socks4a_resolve_response(response_buf, RESPONSE_LEN, result_addr) < 0){ -- show_msg(MSGWARN, "do_resolve: error parsing SOCKS response\n"); -- return -1; -- } - - show_msg(MSGDEBUG, "do_resolve: success\n"); - -@@ -343,6 +533,53 @@ do_resolve(const char *hostname, uint32_ - } - - struct hostent * -+our_gethostbyaddr(dead_pool *pool, const void *_addr, socklen_t len, int type) -+{ -+ const struct in_addr *addr=_addr; -+ static struct hostent he; -+ uint32_t intaddr=0; -+ char *result_hostname=NULL; -+ int rc=0; -+ static char *addrs[2]; -+ static char *aliases[2]; -+ -+ rc = do_resolve("", pool->sockshost, pool->socksport, &intaddr, addr, -+ 5 /*SOCKS5*/, 1 /*Reverse*/, &result_hostname); -+ -+ -+ if(rc != 0) { -+ show_msg(MSGWARN, "failed to reverse resolve: %s\n", -+ inet_ntoa(*((struct in_addr *)addr))); -+ result_hostname=NULL; -+ addrs[0] = NULL; -+ addrs[1] = NULL; -+ }else{ -+ addrs[0] = (char *)addr; -+ addrs[1] = NULL; -+ } -+ -+ if (result_hostname) -+ he.h_name = result_hostname; -+ else -+ he.h_name = inet_ntoa(*((struct in_addr *)addr)); -+ -+// aliases = malloc(sizeof(char *)); -+ aliases[0] = NULL; -+ aliases[1] = NULL; -+ -+ he.h_aliases = aliases; -+ he.h_length = len; -+ he.h_addrtype = type; -+ he.h_addr_list = addrs; -+ -+ show_msg(MSGDEBUG, "our_gethostbyaddr: resolved '%s' to: '%s'\n", -+ inet_ntoa(*((struct in_addr *)he.h_addr)), result_hostname); -+ -+ return &he; -+ -+} -+ -+struct hostent * - our_gethostbyname(dead_pool *pool, const char *name) - { - int pos; -Index: inspectsocks.c -=================================================================== -RCS file: /cvsroot/tork/torsocks/inspectsocks.c,v -retrieving revision 1.1.1.1 -diff -p -U3 -r1.1.1.1 inspectsocks.c ---- inspectsocks.c 15 Jun 2008 09:43:02 -0000 1.1.1.1 -+++ inspectsocks.c 18 Jun 2008 21:21:35 -0000 -@@ -23,7 +23,7 @@ - */ - - /* Global configuration variables */ --char *progname = "inspectsocks"; /* Name for error msgs */ -+const char *progname = "inspectsocks"; /* Name for error msgs */ - int defaultport = 1080; /* Default SOCKS port */ - - /* Header Files */ -@@ -35,6 +35,7 @@ int defaultport = 1080; /* Default - #include <sys/socket.h> - #include <string.h> - #include <strings.h> -+#include <sys/types.h> - #include <netinet/in.h> - #include <arpa/inet.h> - #include <errno.h> -@@ -44,7 +45,7 @@ int send_request(struct sockaddr_in *ser - int reqlen, void *rep, int replen); - - int main(int argc, char *argv[]) { -- char *usage = "Usage: <socks server name/ip> [portno]"; -+ const char *usage = "Usage: <socks server name/ip> [portno]"; - char req[9]; - char resp[100]; - unsigned short int portno = defaultport; -@@ -68,7 +69,7 @@ int main(int argc, char *argv[]) { - } - case 2: - if ((server.sin_addr.s_addr = resolve_ip(argv[1], 1,HOSTNAMES)) -- == -1) { -+ == 0) { - show_msg(MSGERR, "Invalid IP/host specified (%s)\n", argv[1]); - show_msg(MSGERR, "%s\n", usage); - exit(1); -Index: tsocks.c -=================================================================== -RCS file: /cvsroot/tork/torsocks/tsocks.c,v -retrieving revision 1.2 -diff -p -U3 -r1.2 tsocks.c ---- tsocks.c 15 Jun 2008 10:06:03 -0000 1.2 -+++ tsocks.c 18 Jun 2008 21:21:37 -0000 -@@ -63,6 +63,7 @@ static int (*realresinit)(void); - #ifdef USE_TOR_DNS - static dead_pool *pool = NULL; - static struct hostent *(*realgethostbyname)(GETHOSTBYNAME_SIGNATURE); -+static struct hostent *(*realgethostbyaddr)(GETHOSTBYADDR_SIGNATURE); - int (*realgetaddrinfo)(GETADDRINFO_SIGNATURE); - static struct hostent *(*realgetipnodebyname)(GETIPNODEBYNAME_SIGNATURE); - #endif -@@ -77,7 +78,7 @@ static int suid = 0; - static char *conffile = NULL; - - /* Exported Function Prototypes */ --void __attribute__ ((constructor)) tsocks_init(void); -+void __attribute__ ((constructor)) _init(void); - int connect(CONNECT_SIGNATURE); - int select(SELECT_SIGNATURE); - int poll(POLL_SIGNATURE); -@@ -88,6 +89,7 @@ int res_init(void); - #endif - #ifdef USE_TOR_DNS - struct hostent *gethostbyname(GETHOSTBYNAME_SIGNATURE); -+struct hostent *gethostbyaddr(GETHOSTBYADDR_SIGNATURE); - int getaddrinfo(GETADDRINFO_SIGNATURE); - struct hostent *getipnodebyname(GETIPNODEBYNAME_SIGNATURE); - #endif -@@ -119,11 +121,12 @@ static int deadpool_init(void); - static int send_socksv4a_request(struct connreq *conn, const char *onion_host); - #endif - --void tsocks_init(void) { -+void _init(void) { - #ifdef USE_OLD_DLSYM - void *lib; - #endif - -+ show_msg(MSGWARN, "In tsocks_init \n"); - /* We could do all our initialization here, but to be honest */ - /* most programs that are run won't use our services, so */ - /* we do our general initialization on first call */ -@@ -142,6 +145,7 @@ void tsocks_init(void) { - #endif - #ifdef USE_TOR_DNS - realgethostbyname = dlsym(RTLD_NEXT, "gethostbyname"); -+ //realgethostbyaddr = dlsym(RTLD_NEXT, "gethostbyaddr"); - realgetaddrinfo = dlsym(RTLD_NEXT, "getaddrinfo"); - realgetipnodebyname = dlsym(RTLD_NEXT, "getipnodebyname"); - #endif -@@ -155,6 +159,7 @@ void tsocks_init(void) { - #endif - #ifdef USE_TOR_DNS - realgethostbyname = dlsym(lib, "gethostbyname"); -+ realgethostbyaddr = dlsym(lib, "gethostbyaddr"); - realgetaddrinfo = dlsym(lib, "getaddrinfo"); - realgetipnodebyname = dlsym(RTLD_NEXT, "getipnodebyname"); - #endif -@@ -1100,6 +1105,7 @@ static int send_socksv5_connect(struct c - conn->datalen = sizeof(constring); - - #ifdef USE_TOR_DNS -+ - show_msg(MSGDEBUG, "send_socksv5_connect: looking for: %s\n", - inet_ntoa(conn->connaddr.sin_addr)); - -@@ -1394,6 +1400,15 @@ struct hostent *gethostbyname(GETHOSTBYN - } - } - -+struct hostent *gethostbyaddr(GETHOSTBYADDR_SIGNATURE) -+{ -+ if(pool) { -+ return our_gethostbyaddr(pool, addr, len, type); -+ } else { -+ return realgethostbyaddr(addr, len, type); -+ } -+} -+ - int getaddrinfo(GETADDRINFO_SIGNATURE) - { - if(pool) { -Index: common.h -=================================================================== -RCS file: /cvsroot/tork/torsocks/common.h,v -retrieving revision 1.2 -diff -p -U3 -r1.2 common.h ---- common.h 15 Jun 2008 10:01:41 -0000 1.2 -+++ common.h 18 Jun 2008 21:21:37 -0000 -@@ -1,4 +1,33 @@ - /* Common functions provided in common.c */ -+/* GCC has several useful attributes. */ -+#if defined(__GNUC__) && __GNUC__ >= 3 -+#define ATTR_NORETURN __attribute__((noreturn)) -+#define ATTR_PURE __attribute__((pure)) -+#define ATTR_CONST __attribute__((const)) -+#define ATTR_MALLOC __attribute__((malloc)) -+#define ATTR_NORETURN __attribute__((noreturn)) -+#define ATTR_NONNULL(x) __attribute__((nonnull x)) -+/** Macro: Evaluates to <b>exp</b> and hints the compiler that the value -+ * of <b>exp</b> will probably be true. */ -+#define PREDICT_LIKELY(exp) __builtin_expect((exp), 1) -+/** Macro: Evaluates to <b>exp</b> and hints the compiler that the value -+ * of <b>exp</b> will probably be false. */ -+#define PREDICT_UNLIKELY(exp) __builtin_expect((exp), 0) -+#else -+#define ATTR_NORETURN -+#define ATTR_PURE -+#define ATTR_CONST -+#define ATTR_MALLOC -+#define ATTR_NORETURN -+#define ATTR_NONNULL(x) -+#define PREDICT_LIKELY(exp) (exp) -+#define PREDICT_UNLIKELY(exp) (exp) -+#endif -+ -+uint16_t get_uint16(const char *cp) ATTR_PURE ATTR_NONNULL((1)); -+uint32_t get_uint32(const char *cp) ATTR_PURE ATTR_NONNULL((1)); -+void set_uint16(char *cp, uint16_t v) ATTR_NONNULL((1)); -+void set_uint32(char *cp, uint32_t v) ATTR_NONNULL((1)); - - void set_log_options(int, char *, int); - void show_msg(int level, const char *, ...); -Index: dead_pool.h -=================================================================== -RCS file: /cvsroot/tork/torsocks/dead_pool.h,v -retrieving revision 1.2 -diff -p -U3 -r1.2 dead_pool.h ---- dead_pool.h 15 Jun 2008 10:02:53 -0000 1.2 -+++ dead_pool.h 18 Jun 2008 21:21:38 -0000 -@@ -35,6 +35,8 @@ int is_dead_address(dead_pool *pool, uin - char *get_pool_entry(dead_pool *pool, struct in_addr *addr); - int search_pool_for_name(dead_pool *pool, const char *name); - struct hostent *our_gethostbyname(dead_pool *pool, const char *name); -+struct hostent *our_gethostbyaddr(dead_pool *pool, const void *addr, -+ socklen_t len, int type); - int our_getaddrinfo(dead_pool *pool, const char *node, const char *service, - void *hints, void *res); - struct hostent *our_getipnodebyname(dead_pool *pool, const char *name, -Index: parser.h -=================================================================== -RCS file: /cvsroot/tork/torsocks/parser.h,v -retrieving revision 1.1.1.1 -diff -p -U3 -r1.1.1.1 parser.h ---- parser.h 15 Jun 2008 09:43:02 -0000 1.1.1.1 -+++ parser.h 18 Jun 2008 21:21:38 -0000 -@@ -35,7 +35,7 @@ struct parsedfile { - struct serverent *paths; - int tordns_enabled; - int tordns_failopen; -- int tordns_cache_size; -+ unsigned int tordns_cache_size; - struct netent *tordns_deadpool_range; - }; - -Index: tsocks.h -=================================================================== -RCS file: /cvsroot/tork/torsocks/tsocks.h,v -retrieving revision 1.1.1.1 -diff -p -U3 -r1.1.1.1 tsocks.h ---- tsocks.h 15 Jun 2008 09:43:01 -0000 1.1.1.1 -+++ tsocks.h 18 Jun 2008 21:21:38 -0000 -@@ -50,8 +50,8 @@ struct connreq { - int selectevents; - - /* Buffer for sending and receiving on the socket */ -- int datalen; -- int datadone; -+ unsigned int datalen; -+ unsigned int datadone; - char buffer[2048]; - - struct connreq *next; -Index: config.h.in -=================================================================== -RCS file: /cvsroot/tork/torsocks/config.h.in,v -retrieving revision 1.1.1.1 -diff -p -U3 -r1.1.1.1 config.h.in ---- config.h.in 15 Jun 2008 09:43:02 -0000 1.1.1.1 -+++ config.h.in 18 Jun 2008 21:21:38 -0000 -@@ -83,6 +83,9 @@ in inspectsocks */ - #undef GETIPNODEBYNAME_SIGNATURE - - -+/* Description */ -+#undef GETHOSTBYADDR_SIGNATURE -+ - /* Define to 1 if you have the <inttypes.h> header file. */ - #undef HAVE_INTTYPES_H - -Index: configure.in -=================================================================== -RCS file: /cvsroot/tork/torsocks/configure.in,v -retrieving revision 1.1.1.1 -diff -p -U3 -r1.1.1.1 configure.in ---- configure.in 15 Jun 2008 09:43:00 -0000 1.1.1.1 -+++ configure.in 18 Jun 2008 21:21:38 -0000 -@@ -384,6 +384,10 @@ dnl Emit signature for gethostbyname - PROTO="const char *name" - AC_DEFINE_UNQUOTED(GETHOSTBYNAME_SIGNATURE, [${PROTO}]) - -+dnl Emit signature for gethostbyaddr -+PROTO="const void *addr, socklen_t len, int type" -+AC_DEFINE_UNQUOTED(GETHOSTBYADDR_SIGNATURE, [${PROTO}], [Description]) -+ - dnl Emit signature for getaddrinfo - PROTO="const char *node, const char *service, void *hints, void *res" - AC_DEFINE_UNQUOTED(GETADDRINFO_SIGNATURE, [${PROTO}]) diff --git a/patches/getpeername.patch b/patches/getpeername.patch deleted file mode 100644 index f66d133..0000000 --- a/patches/getpeername.patch +++ /dev/null @@ -1,350 +0,0 @@ -diff -ur tsocks-1.8beta5.orig/acconfig.h tsocks-1.8beta5.clean/acconfig.h ---- tsocks-1.8beta5.orig/acconfig.h Sat May 18 06:59:38 2002 -+++ tsocks-1.8beta5.clean/acconfig.h Sat Mar 27 11:12:03 2004 -@@ -43,6 +43,9 @@ - /* Prototype and function header for close function */ - #undef CLOSE_SIGNATURE - -+/* Prototype and function header for getpeername function */ -+#undef GETPEERNAME_SIGNATURE -+ - /* Work out which function we have for conversion from string IPs to - numerical ones */ - #undef HAVE_INET_ADDR -diff -ur tsocks-1.8beta5.orig/config.h.in tsocks-1.8beta5.clean/config.h.in ---- tsocks-1.8beta5.orig/config.h.in Sat May 18 06:59:42 2002 -+++ tsocks-1.8beta5.clean/config.h.in Sat Mar 27 11:21:58 2004 -@@ -46,6 +46,9 @@ - /* Prototype and function header for close function */ - #undef CLOSE_SIGNATURE - -+/* Prototype and function header for close function */ -+#undef GETPEERNAME_SIGNATURE -+ - /* Work out which function we have for conversion from string IPs to - numerical ones */ - #undef HAVE_INET_ADDR -diff -ur tsocks-1.8beta5.orig/config.status tsocks-1.8beta5.clean/config.status ---- tsocks-1.8beta5.orig/config.status Sat Mar 27 11:25:17 2004 -+++ tsocks-1.8beta5.clean/config.status Sat Mar 27 11:22:01 2004 -@@ -2,9 +2,9 @@ - # Generated automatically by configure. - # Run this file to recreate the current configuration. - # This directory was configured as follows, --# on host inky: -+# on host seppia: - # --# ./configure --prefix=/usr --libdir=/usr/lib --mandir=/usr/share/man --with-conf=/etc/tsocks.conf --enable-socksdns --enable-hostnames -+# ./configure - # - # Compiler output produced by configure, useful for debugging - # configure, is in ./config.log if it exists. -@@ -14,8 +14,8 @@ - do - case "$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) -- echo "running ${CONFIG_SHELL-/bin/sh} ./configure --prefix=/usr --libdir=/usr/lib --mandir=/usr/share/man --with-conf=/etc/tsocks.conf --enable-socksdns --enable-hostnames --no-create --no-recursion" -- exec ${CONFIG_SHELL-/bin/sh} ./configure --prefix=/usr --libdir=/usr/lib --mandir=/usr/share/man --with-conf=/etc/tsocks.conf --enable-socksdns --enable-hostnames --no-create --no-recursion ;; -+ echo "running ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion" -+ exec ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "./config.status generated by autoconf version 2.13" - exit 0 ;; -@@ -53,11 +53,11 @@ - s%@sysconfdir@%${prefix}/etc%g - s%@sharedstatedir@%${prefix}/com%g - s%@localstatedir@%${prefix}/var%g --s%@libdir@%/usr/lib%g -+s%@libdir@%/lib%g - s%@includedir@%${prefix}/include%g - s%@oldincludedir@%/usr/include%g - s%@infodir@%${prefix}/info%g --s%@mandir@%/usr/share/man%g -+s%@mandir@%${prefix}/man%g - s%@host@%i686-pc-linux-gnu%g - s%@host_alias@%i686-pc-linux-gnu%g - s%@host_cpu@%i686%g -@@ -255,15 +255,15 @@ - mv conftest.out conftest.in - - cat > conftest.frag <<CEOF --${ac_dA}USE_SOCKS_DNS${ac_dB}USE_SOCKS_DNS${ac_dC}1${ac_dD} --${ac_uA}USE_SOCKS_DNS${ac_uB}USE_SOCKS_DNS${ac_uC}1${ac_uD} --${ac_eA}USE_SOCKS_DNS${ac_eB}USE_SOCKS_DNS${ac_eC}1${ac_eD} - ${ac_dA}ALLOW_ENV_CONFIG${ac_dB}ALLOW_ENV_CONFIG${ac_dC}1${ac_dD} - ${ac_uA}ALLOW_ENV_CONFIG${ac_uB}ALLOW_ENV_CONFIG${ac_uC}1${ac_uD} - ${ac_eA}ALLOW_ENV_CONFIG${ac_eB}ALLOW_ENV_CONFIG${ac_eC}1${ac_eD} - ${ac_dA}ALLOW_MSG_OUTPUT${ac_dB}ALLOW_MSG_OUTPUT${ac_dC}1${ac_dD} - ${ac_uA}ALLOW_MSG_OUTPUT${ac_uB}ALLOW_MSG_OUTPUT${ac_uC}1${ac_uD} - ${ac_eA}ALLOW_MSG_OUTPUT${ac_eB}ALLOW_MSG_OUTPUT${ac_eC}1${ac_eD} -+${ac_dA}HOSTNAMES${ac_dB}HOSTNAMES${ac_dC}1${ac_dD} -+${ac_uA}HOSTNAMES${ac_uB}HOSTNAMES${ac_uC}1${ac_uD} -+${ac_eA}HOSTNAMES${ac_eB}HOSTNAMES${ac_eC}1${ac_eD} - ${ac_dA}SELECT_SIGNATURE${ac_dB}SELECT_SIGNATURE${ac_dC}int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout${ac_dD} - ${ac_uA}SELECT_SIGNATURE${ac_uB}SELECT_SIGNATURE${ac_uC}int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout${ac_uD} - ${ac_eA}SELECT_SIGNATURE${ac_eB}SELECT_SIGNATURE${ac_eC}int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout${ac_eD} -@@ -282,15 +282,18 @@ - ${ac_dA}CLOSE_SIGNATURE${ac_dB}CLOSE_SIGNATURE${ac_dC}int fd${ac_dD} - ${ac_uA}CLOSE_SIGNATURE${ac_uB}CLOSE_SIGNATURE${ac_uC}int fd${ac_uD} - ${ac_eA}CLOSE_SIGNATURE${ac_eB}CLOSE_SIGNATURE${ac_eC}int fd${ac_eD} --${ac_dA}POLL_SIGNATURE${ac_dB}POLL_SIGNATURE${ac_dC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_dD} --${ac_uA}POLL_SIGNATURE${ac_uB}POLL_SIGNATURE${ac_uC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_uD} --${ac_eA}POLL_SIGNATURE${ac_eB}POLL_SIGNATURE${ac_eC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_eD} -+${ac_dA}GETPEERNAME_SIGNATURE${ac_dB}GETPEERNAME_SIGNATURE${ac_dC}int __fd, struct sockaddr * __name, socklen_t *__namelen${ac_dD} -+${ac_uA}GETPEERNAME_SIGNATURE${ac_uB}GETPEERNAME_SIGNATURE${ac_uC}int __fd, struct sockaddr * __name, socklen_t *__namelen${ac_uD} -+${ac_eA}GETPEERNAME_SIGNATURE${ac_eB}GETPEERNAME_SIGNATURE${ac_eC}int __fd, struct sockaddr * __name, socklen_t *__namelen${ac_eD} - CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in - - cat > conftest.frag <<CEOF -+${ac_dA}POLL_SIGNATURE${ac_dB}POLL_SIGNATURE${ac_dC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_dD} -+${ac_uA}POLL_SIGNATURE${ac_uB}POLL_SIGNATURE${ac_uC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_uD} -+${ac_eA}POLL_SIGNATURE${ac_eB}POLL_SIGNATURE${ac_eC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_eD} - s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% - CEOF - sed -f conftest.frag conftest.in > conftest.out -diff -ur tsocks-1.8beta5.orig/configure tsocks-1.8beta5.clean/configure ---- tsocks-1.8beta5.orig/configure Tue Jul 16 00:51:08 2002 -+++ tsocks-1.8beta5.clean/configure Sat Mar 27 11:12:05 2004 -@@ -2225,14 +2225,60 @@ - EOF - - -+ -+echo $ac_n "checking for correct getpeername prototype""... $ac_c" 1>&6 -+echo "configure:2231: checking for correct getpeername prototype" >&5 -+PROTO= -+PROTO1='int __fd, const struct sockaddr * __name, int *__namelen' -+PROTO2='int __fd, const struct sockaddr_in * __name, socklen_t *__namelen' -+PROTO3='int __fd, struct sockaddr * __name, socklen_t *__namelen' -+PROTO4='int __fd, const struct sockaddr * __name, socklen_t *__namelen' -+for testproto in "${PROTO1}" \ -+ "${PROTO2}" \ -+ "${PROTO3}" \ -+ "${PROTO4}" -+do -+ if test "${PROTO}" = ""; then -+ cat > conftest.$ac_ext <<EOF -+#line 2244 "configure" -+#include "confdefs.h" -+ -+ #include <sys/socket.h> -+ int getpeername($testproto); -+ -+int main() { -+ -+; return 0; } -+EOF -+if { (eval echo configure:2254: "$ac_compile") 1>&5; (eval $ac_compile) 2>&5; }; then -+ rm -rf conftest* -+ PROTO="$testproto"; -+else -+ echo "configure: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+fi -+rm -f conftest* -+ fi -+done -+if test "${PROTO}" = ""; then -+ { echo "configure: error: "no match found!"" 1>&2; exit 1; } -+fi -+echo "$ac_t""getpeername(${PROTO})" 1>&6 -+cat >> confdefs.h <<EOF -+#define GETPEERNAME_SIGNATURE ${PROTO} -+EOF -+ -+ -+ -+ - echo $ac_n "checking for correct poll prototype""... $ac_c" 1>&6 --echo "configure:2230: checking for correct poll prototype" >&5 -+echo "configure:2276: checking for correct poll prototype" >&5 - PROTO= - for testproto in 'struct pollfd *ufds, unsigned long nfds, int timeout' - do - if test "${PROTO}" = ""; then - cat > conftest.$ac_ext <<EOF --#line 2236 "configure" -+#line 2282 "configure" - #include "confdefs.h" - - #include <sys/poll.h> -@@ -2242,7 +2288,7 @@ - - ; return 0; } - EOF --if { (eval echo configure:2246: "$ac_compile") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:2292: "$ac_compile") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - PROTO="$testproto"; - else -diff -ur tsocks-1.8beta5.orig/configure.in tsocks-1.8beta5.clean/configure.in ---- tsocks-1.8beta5.orig/configure.in Tue Jul 16 00:51:03 2002 -+++ tsocks-1.8beta5.clean/configure.in Sat Mar 27 11:11:02 2004 -@@ -309,6 +309,34 @@ - AC_MSG_RESULT([close(${PROTO})]) - AC_DEFINE_UNQUOTED(CLOSE_SIGNATURE, [${PROTO}]) - -+ -+dnl Find the correct getpeername prototype on this machine -+AC_MSG_CHECKING(for correct getpeername prototype) -+PROTO= -+PROTO1='int __fd, const struct sockaddr * __name, int *__namelen' -+PROTO2='int __fd, const struct sockaddr_in * __name, socklen_t *__namelen' -+PROTO3='int __fd, struct sockaddr * __name, socklen_t *__namelen' -+PROTO4='int __fd, const struct sockaddr * __name, socklen_t *__namelen' -+for testproto in "${PROTO1}" \ -+ "${PROTO2}" \ -+ "${PROTO3}" \ -+ "${PROTO4}" -+do -+ if test "${PROTO}" = ""; then -+ AC_TRY_COMPILE([ -+ #include <sys/socket.h> -+ int getpeername($testproto); -+ ],,[PROTO="$testproto";],) -+ fi -+done -+if test "${PROTO}" = ""; then -+ AC_MSG_ERROR("no match found!") -+fi -+AC_MSG_RESULT([getpeername(${PROTO})]) -+AC_DEFINE_UNQUOTED(GETPEERNAME_SIGNATURE, [${PROTO}]) -+ -+ -+ - dnl Find the correct poll prototype on this machine - AC_MSG_CHECKING(for correct poll prototype) - PROTO= -Only in tsocks-1.8beta5.clean: ld-pre -Only in tsocks-1.8beta5.clean: sel -diff -ur tsocks-1.8beta5.orig/tsocks.c tsocks-1.8beta5.clean/tsocks.c ---- tsocks-1.8beta5.orig/tsocks.c Tue Jul 16 00:50:52 2002 -+++ tsocks-1.8beta5.clean/tsocks.c Sat Mar 27 13:17:58 2004 -@@ -62,6 +62,7 @@ - static int (*realselect)(SELECT_SIGNATURE); - static int (*realpoll)(POLL_SIGNATURE); - static int (*realclose)(CLOSE_SIGNATURE); -+static int (*realgetpeername)(GETPEERNAME_SIGNATURE); - static struct parsedfile *config; - static struct connreq *requests = NULL; - static int suid = 0; -@@ -73,6 +74,7 @@ - int select(SELECT_SIGNATURE); - int poll(POLL_SIGNATURE); - int close(CLOSE_SIGNATURE); -+int getpeername(GETPEERNAME_SIGNATURE); - #ifdef USE_SOCKS_DNS - int res_init(void); - #endif -@@ -109,14 +111,15 @@ - /* most programs that are run won't use our services, so */ - /* we do our general initialization on first call */ - -- /* Determine the logging level */ -- suid = (getuid() != geteuid()); -+ /* Determine the logging level */ -+ suid = (getuid() != geteuid()); - - #ifndef USE_OLD_DLSYM - realconnect = dlsym(RTLD_NEXT, "connect"); - realselect = dlsym(RTLD_NEXT, "select"); - realpoll = dlsym(RTLD_NEXT, "poll"); - realclose = dlsym(RTLD_NEXT, "close"); -+ realgetpeername = dlsym(RTLD_NEXT, "getpeername"); - #ifdef USE_SOCKS_DNS - realresinit = dlsym(RTLD_NEXT, "res_init"); - #endif -@@ -125,14 +128,15 @@ - realconnect = dlsym(lib, "connect"); - realselect = dlsym(lib, "select"); - realpoll = dlsym(lib, "poll"); -+ realgetpeername = dlsym(lib, "getpeername"); - #ifdef USE_SOCKS_DNS - realresinit = dlsym(lib, "res_init"); - #endif -- dlclose(lib); -+ dlclose(lib); - - lib = dlopen(LIBC, RTLD_LAZY); -- realclose = dlsym(lib, "close"); -- dlclose(lib); -+ realclose = dlsym(lib, "close"); -+ dlclose(lib); - #endif - } - -@@ -348,8 +352,10 @@ - - /* If we're not currently managing any requests we can just - * leave here */ -- if (!requests) -+ if (!requests) { -+ show_msg(MSGDEBUG, "No requests waiting, calling real select\n"); - return(realselect(n, readfds, writefds, exceptfds, timeout)); -+ } - - get_environment(); - -@@ -703,6 +709,50 @@ - return(rc); - } - -+/* If we are not done setting up the connection yet, return -+ * -1 and ENOTCONN, otherwise call getpeername -+ * -+ * This is necessary since some applications, when using non-blocking connect, -+ * (like ircII) use getpeername() to find out if they are connected already. -+ * -+ * This results in races sometimes, where the client sends data to the socket -+ * before we are done with the socks connection setup. Another solution would -+ * be to intercept send(). -+ * -+ * This could be extended to actually set the peername to the peer the -+ * client application has requested, but not for now. -+ * -+ * PP, Sat, 27 Mar 2004 11:30:23 +0100 -+ */ -+int getpeername(GETPEERNAME_SIGNATURE) { -+ struct connreq *conn; -+ int rc; -+ -+ if (realgetpeername == NULL) { -+ show_msg(MSGERR, "Unresolved symbol: getpeername\n"); -+ return(-1); -+ } -+ -+ show_msg(MSGDEBUG, "Call to getpeername for fd %d\n", __fd); -+ -+ -+ rc = realgetpeername(__fd, __name, __namelen); -+ if (rc == -1) -+ return rc; -+ -+ /* Are we handling this connect? */ -+ if ((conn = find_socks_request(__fd, 1))) { -+ /* While we are at it, we might was well try to do something useful */ -+ handle_request(conn); -+ -+ if (conn->state != DONE) { -+ errno = ENOTCONN; -+ return(-1); -+ } -+ } -+ return rc; -+} -+ - static struct connreq *new_socks_request(int sockid, struct sockaddr_in *connaddr, - struct sockaddr_in *serveraddr, - struct serverent *path) { -@@ -852,7 +902,7 @@ - sizeof(conn->serveraddr)); - - show_msg(MSGDEBUG, "Connect returned %d, errno is %d\n", rc, errno); -- if (rc) { -+ if (rc) { - if (errno != EINPROGRESS) { - show_msg(MSGERR, "Error %d attempting to connect to SOCKS " - "server (%s)\n", errno, strerror(errno)); diff --git a/patches/infiniteloop.patch b/patches/infiniteloop.patch deleted file mode 100644 index 4b0deb9..0000000 --- a/patches/infiniteloop.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- tsocks-1.8.orig/tsocks.c 2002-03-13 14:02:04.000000000 +0100 -+++ tsocks-1.8/tsocks.c 2004-03-20 11:30:57.000000000 +0100 -@@ -951,14 +951,18 @@ - show_msg(MSGDEBUG, "Reading from server (expecting %d bytes)\n", conn->datalen); - while ((rc == 0) && (conn->datadone != conn->datalen)) { - rc = recv(conn->sockid, conn->buffer + conn->datadone, - conn->datalen - conn->datadone, 0); - if (rc > 0) { - conn->datadone += rc; - rc = 0; -+ } else if (rc == 0) { -+ show_msg(MSGDEBUG, "Peer has shutdown but we only read %d of %d bytes.\n", -+ conn->datadone, conn->datalen); -+ rc = ENOTCONN; /* ENOTCONN seems like the most fitting error message */ - } else { - if (errno != EWOULDBLOCK) - show_msg(MSGDEBUG, "Read failed, %s\n", strerror(errno)); - rc = errno; - } - } diff --git a/patches/localaddresses.patch b/patches/localaddresses.patch deleted file mode 100644 index d69c7e8..0000000 --- a/patches/localaddresses.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- parser.c.old 2006-04-01 17:54:46.687832056 -0500 -+++ parser.c 2006-04-01 17:55:47.552579208 -0500 -@@ -74,8 +74,10 @@ - } - fclose(conf); - -- /* Always add the 127.0.0.1/255.0.0.0 subnet to local */ -- handle_local(config, 0, "127.0.0.0/255.0.0.0"); -+ if (!config->localnets) { -+ /* Use 127.0.0.1/255.0.0.0 by default */ -+ handle_local(config, 0, "127.0.0.0/255.0.0.0"); -+ } - - /* Check default server */ - check_server(&(config->defaultserver)); diff --git a/patches/tordns.patch b/patches/tordns.patch deleted file mode 100644 index bf8d79b..0000000 --- a/patches/tordns.patch +++ /dev/null @@ -1,11004 +0,0 @@ -diff -rN -U 5 tsocks-1.8/acconfig.h tsocks/acconfig.h ---- tsocks-1.8/acconfig.h 2002-05-18 16:59:38.000000000 +1200 -+++ tsocks/acconfig.h 2005-10-01 17:22:09.000000000 +1200 -@@ -51,10 +51,13 @@ - /* We use strsep which isn't on all machines, but we provide our own - definition of it for those which don't have it, this causes us to define - our version */ - #undef DEFINE_STRSEP - -+/* Should we resolve DNS entries in a way which works well with tor? */ -+#undef USE_TOR_DNS -+ - /* Allow the use of DNS names in the socks configuration file for socks - servers. This doesn't work if socksified DNS is enabled for obvious - reasons, it also introduces overhead, but people seem to want it */ - #define HOSTNAMES 0 - -@@ -62,5 +65,16 @@ - in inspectsocks */ - #undef HAVE_GETHOSTBYNAME - - /* Location of configuration file (typically /etc/tsocks.conf) */ - #undef CONF_FILE -+ -+/* Define to indicate the correct signature for gethostbyname_r */ -+#undef HAVE_FUNC_GETHOSTBYNAME_R_6 -+#undef HAVE_FUNC_GETHOSTBYNAME_R_5 -+#undef HAVE_FUNC_GETHOSTBYNAME_R_3 -+ -+/* Signatures for name resolution stuff */ -+#undef GETHOSTBYNAME_SIGNATURE -+#undef GETADDRINFO_SIGNATURE -+#undef GETIPNODEBYNAME_SIGNATURE -+ -diff -rN -U 5 tsocks-1.8/aclocal/ac_c_gethostbyname_r.m4 tsocks/aclocal/ac_c_gethostbyname_r.m4 ---- tsocks-1.8/aclocal/ac_c_gethostbyname_r.m4 1970-01-01 12:00:00.000000000 +1200 -+++ tsocks/aclocal/ac_c_gethostbyname_r.m4 2005-09-27 05:55:58.000000000 +1200 -@@ -0,0 +1,132 @@ -+dnl http://autoconf-archive.cryp.to/ax_func_which_gethostbyname_r.html -+ -+AC_DEFUN([AX_FUNC_WHICH_GETHOSTBYNAME_R], [ -+ -+ AC_LANG_PUSH(C) -+ AC_MSG_CHECKING([how many arguments gethostbyname_r() takes]) -+ -+ AC_CACHE_VAL(ac_cv_func_which_gethostbyname_r, [ -+ -+################################################################ -+ -+ac_cv_func_which_gethostbyname_r=unknown -+ -+# -+# ONE ARGUMENT (sanity check) -+# -+ -+# This should fail, as there is no variant of gethostbyname_r() that takes -+# a single argument. If it actually compiles, then we can assume that -+# netdb.h is not declaring the function, and the compiler is thereby -+# assuming an implicit prototype. In which case, we're out of luck. -+# -+AC_COMPILE_IFELSE( -+ AC_LANG_PROGRAM( -+ [[#include <netdb.h>]], -+ [[ -+ char *name = "www.gnu.org"; -+ (void)gethostbyname_r(name) /* ; */ -+ ]]), -+ ac_cv_func_which_gethostbyname_r=no) -+ -+# -+# SIX ARGUMENTS -+# (e.g. Linux) -+# -+ -+if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then -+ -+AC_COMPILE_IFELSE( -+ AC_LANG_PROGRAM( -+ [[#include <netdb.h>]], -+ [[ -+ char *name = "www.gnu.org"; -+ struct hostent ret, *retp; -+ char buf@<:@1024@:>@; -+ int buflen = 1024; -+ int my_h_errno; -+ (void)gethostbyname_r(name, &ret, buf, buflen, &retp, &my_h_errno) /* ; */ -+ ]]), -+ ac_cv_func_which_gethostbyname_r=six) -+ -+fi -+ -+# -+# FIVE ARGUMENTS -+# (e.g. Solaris) -+# -+ -+if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then -+ -+AC_COMPILE_IFELSE( -+ AC_LANG_PROGRAM( -+ [[#include <netdb.h>]], -+ [[ -+ char *name = "www.gnu.org"; -+ struct hostent ret; -+ char buf@<:@1024@:>@; -+ int buflen = 1024; -+ int my_h_errno; -+ (void)gethostbyname_r(name, &ret, buf, buflen, &my_h_errno) /* ; */ -+ ]]), -+ ac_cv_func_which_gethostbyname_r=five) -+ -+fi -+ -+# -+# THREE ARGUMENTS -+# (e.g. AIX, HP-UX, Tru64) -+# -+ -+if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then -+ -+AC_COMPILE_IFELSE( -+ AC_LANG_PROGRAM( -+ [[#include <netdb.h>]], -+ [[ -+ char *name = "www.gnu.org"; -+ struct hostent ret; -+ struct hostent_data data; -+ (void)gethostbyname_r(name, &ret, &data) /* ; */ -+ ]]), -+ ac_cv_func_which_gethostbyname_r=three) -+ -+fi -+ -+################################################################ -+ -+]) dnl end AC_CACHE_VAL -+ -+case "$ac_cv_func_which_gethostbyname_r" in -+ three) -+ AC_MSG_RESULT([three]) -+ AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_3) -+ ;; -+ -+ five) -+ AC_MSG_RESULT([five]) -+ AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_5) -+ ;; -+ -+ six) -+ AC_MSG_RESULT([six]) -+ AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_6) -+ ;; -+ -+ no) -+ AC_MSG_RESULT([cannot find function declaration in netdb.h]) -+ ;; -+ -+ unknown) -+ AC_MSG_RESULT([can't tell]) -+ ;; -+ -+ *) -+ AC_MSG_ERROR([internal error]) -+ ;; -+esac -+ -+AC_LANG_POP(C) -+ -+]) dnl end AC_DEFUN -+ -diff -rN -U 5 tsocks-1.8/autogen.sh tsocks/autogen.sh ---- tsocks-1.8/autogen.sh 1970-01-01 12:00:00.000000000 +1200 -+++ tsocks/autogen.sh 2005-10-01 17:54:45.000000000 +1200 -@@ -0,0 +1,6 @@ -+#!/bin/sh -+ -+aclocal -I aclocal -+autoconf -+autoheader -+ -diff -rN -U 5 tsocks-1.8/ChangeLog tsocks/ChangeLog ---- tsocks-1.8/ChangeLog 2002-05-18 17:22:26.000000000 +1200 -+++ tsocks/ChangeLog 2005-10-02 16:03:18.000000000 +1300 -@@ -1,5 +1,9 @@ -+version 1.80tordns - 2005.10.4 bls@totalinfosecurity.com -+ Intercept gethostbyname() and friends, added --tordns -+ option for better name resolution with Tor. -+ - version 1.80Beta5 - 2002.?.?? delius@progsoc.uts.edu.au - Intercept close() to fix problems with tsocks and - kmail - Add FAQ to distribution - -diff -rN -U 5 tsocks-1.8/common.c tsocks/common.c ---- tsocks-1.8/common.c 2002-07-16 10:35:06.000000000 +1200 -+++ tsocks/common.c 2005-10-01 21:37:00.000000000 +1200 -@@ -76,10 +76,31 @@ - } - - logstamp = timestamp; - } - -+/* Count the bits in a netmask. This is a little bit buggy; it assumes -+ all the zeroes are on the right... */ -+ -+int count_netmask_bits(uint32_t mask) -+{ -+ int i; -+ int nbits = 0; -+ -+ for(i=0; i<32; i++) { -+ if((mask >> i) & 1) { -+ nbits++; -+ } -+ } -+ mask = ~mask; -+ mask = ntohl(mask); -+ if(mask & (mask+1)) { -+ return -1; /* Noncontiguous */ -+ } -+ return nbits; -+} -+ - void show_msg(int level, char *fmt, ...) { - va_list ap; - int saveerr; - extern char *progname; - char timestring[20]; -@@ -105,11 +126,11 @@ - strftime(timestring, sizeof(timestring), "%H:%M:%S", - localtime(×tamp)); - fprintf(logfile, "%s ", timestring); - } - -- fputs(progname, logfile); -+ // fputs(progname, logfile); - - if (logstamp) { - fprintf(logfile, "(%d)", getpid()); - } - -diff -rN -U 5 tsocks-1.8/common.h tsocks/common.h ---- tsocks-1.8/common.h 2002-07-16 10:27:00.000000000 +1200 -+++ tsocks/common.h 2005-09-27 10:48:20.000000000 +1200 -@@ -1,9 +1,10 @@ - /* Common functions provided in common.c */ - - void set_log_options(int, char *, int); - void show_msg(int level, char *, ...); -+int count_netmask_bits(uint32_t mask); - unsigned int resolve_ip(char *, int, int); - - #define MSGNONE -1 - #define MSGERR 0 - #define MSGWARN 1 -diff -rN -U 5 tsocks-1.8/config.h.in tsocks/config.h.in ---- tsocks-1.8/config.h.in 2002-05-18 16:59:42.000000000 +1200 -+++ tsocks/config.h.in 2005-10-01 17:23:20.000000000 +1200 -@@ -1,9 +1,7 @@ --/* config.h.in. Generated automatically from configure.in by autoheader. */ -- --/* Define if you have the ANSI C header files. */ --#undef STDC_HEADERS -+/* config.h.in. Generated from configure.in by autoheader. */ -+/* accconfig.h -- `autoheader' will generate config.h.in for tsocks . */ - - /* Allow tsocks to generate messages to stderr when errors are - encountered, this is really important and should only be disabled if - you're REALLY sure. It can also be turned off at run time, see the man - page for details */ -@@ -49,10 +47,18 @@ - /* Work out which function we have for conversion from string IPs to - numerical ones */ - #undef HAVE_INET_ADDR - #undef HAVE_INET_ATON - -+/* We use strsep which isn't on all machines, but we provide our own -+definition of it for those which don't have it, this causes us to define -+our version */ -+#undef DEFINE_STRSEP -+ -+/* Should we resolve DNS entries in a way which works well with tor? */ -+#undef USE_TOR_DNS -+ - /* Allow the use of DNS names in the socks configuration file for socks - servers. This doesn't work if socksified DNS is enabled for obvious - reasons, it also introduces overhead, but people seem to want it */ - #define HOSTNAMES 0 - -@@ -61,28 +67,90 @@ - #undef HAVE_GETHOSTBYNAME - - /* Location of configuration file (typically /etc/tsocks.conf) */ - #undef CONF_FILE - --/* Define if you have the strcspn function. */ -+/* Define to indicate the correct signature for gethostbyname_r */ -+#undef HAVE_FUNC_GETHOSTBYNAME_R_6 -+#undef HAVE_FUNC_GETHOSTBYNAME_R_5 -+#undef HAVE_FUNC_GETHOSTBYNAME_R_3 -+ -+/* Signatures for name resolution stuff */ -+#undef GETHOSTBYNAME_SIGNATURE -+#undef GETADDRINFO_SIGNATURE -+#undef GETIPNODEBYNAME_SIGNATURE -+ -+ -+/* Define to 1 if you have the <inttypes.h> header file. */ -+#undef HAVE_INTTYPES_H -+ -+/* Define to 1 if you have the `dl' library (-ldl). */ -+#undef HAVE_LIBDL -+ -+/* Define to 1 if you have the `socket' library (-lsocket). */ -+#undef HAVE_LIBSOCKET -+ -+/* Define to 1 if you have the <memory.h> header file. */ -+#undef HAVE_MEMORY_H -+ -+/* Define to 1 if you have the `mmap' function. */ -+#undef HAVE_MMAP -+ -+/* 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 `strcspn' function. */ - #undef HAVE_STRCSPN - --/* Define if you have the strdup function. */ -+/* 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 strspn 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 `strncasecmp' function. */ -+#undef HAVE_STRNCASECMP -+ -+/* Define to 1 if you have the `strspn' function. */ - #undef HAVE_STRSPN - --/* Define if you have the strtol function. */ -+/* Define to 1 if you have the `strtol' function. */ - #undef HAVE_STRTOL - --/* Define if you have the <unistd.h> header file. */ -+/* 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/types.h> header file. */ -+#undef HAVE_SYS_TYPES_H -+ -+/* Define to 1 if you have the <unistd.h> header file. */ - #undef HAVE_UNISTD_H - --/* Define if you have the dl library (-ldl). */ --#undef HAVE_LIBDL -+/* Define to the address where bug reports for this package should be sent. */ -+#undef PACKAGE_BUGREPORT - --/* Define if you have the socket library (-lsocket). */ --#undef HAVE_LIBSOCKET -+/* Define to the full name of this package. */ -+#undef PACKAGE_NAME -+ -+/* Define to the full name and version of this package. */ -+#undef PACKAGE_STRING -+ -+/* Define to the one symbol short name of this package. */ -+#undef PACKAGE_TARNAME -+ -+/* Define to the version of this package. */ -+#undef PACKAGE_VERSION -+ -+/* Define to 1 if you have the ANSI C header files. */ -+#undef STDC_HEADERS -diff -rN -U 5 tsocks-1.8/config.status tsocks/config.status ---- tsocks-1.8/config.status 2002-07-16 10:51:14.000000000 +1200 -+++ tsocks/config.status 1970-01-01 12:00:00.000000000 +1200 -@@ -1,312 +0,0 @@ --#! /bin/sh --# Generated automatically by configure. --# Run this file to recreate the current configuration. --# This directory was configured as follows, --# on host cardini.homenet: --# --# ./configure --# --# Compiler output produced by configure, useful for debugging --# configure, is in ./config.log if it exists. -- --ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]" --for ac_option --do -- case "$ac_option" in -- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) -- echo "running ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion" -- exec ${CONFIG_SHELL-/bin/sh} ./configure --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 --done -- --ac_given_srcdir=. --ac_given_INSTALL="/usr/bin/install -c" -- --trap 'rm -fr Makefile config.h conftest*; exit 1' 1 2 15 -- --# 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 --/^[ ]*VPATH[ ]*=[^:]*$/d -- --s%@SHELL@%/bin/sh%g --s%@CFLAGS@%-g -O2 -Wall%g --s%@CPPFLAGS@%%g --s%@CXXFLAGS@%%g --s%@FFLAGS@%%g --s%@DEFS@%-DHAVE_CONFIG_H%g --s%@LDFLAGS@%%g --s%@LIBS@% -lc%g --s%@exec_prefix@%${prefix}%g --s%@prefix@%/usr%g --s%@program_transform_name@%s,x,x,%g --s%@bindir@%${exec_prefix}/bin%g --s%@sbindir@%${exec_prefix}/sbin%g --s%@libexecdir@%${exec_prefix}/libexec%g --s%@datadir@%${prefix}/share%g --s%@sysconfdir@%${prefix}/etc%g --s%@sharedstatedir@%${prefix}/com%g --s%@localstatedir@%${prefix}/var%g --s%@libdir@%/lib%g --s%@includedir@%${prefix}/include%g --s%@oldincludedir@%/usr/include%g --s%@infodir@%${prefix}/info%g --s%@mandir@%${prefix}/man%g --s%@host@%i586-pc-linux-gnu%g --s%@host_alias@%i586-pc-linux-gnu%g --s%@host_cpu@%i586%g --s%@host_vendor@%pc%g --s%@host_os@%linux-gnu%g --s%@CC@%gcc%g --s%@INSTALL_PROGRAM@%${INSTALL}%g --s%@INSTALL_SCRIPT@%${INSTALL_PROGRAM}%g --s%@INSTALL_DATA@%${INSTALL} -m 644%g --s%@LN_S@%ln -s%g --s%@CPP@%gcc -E%g --s%@FIND@%%g --s%@TAIL@%%g --s%@SPECIALLIBS@%-ldl %g -- --CEOF -- --# 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 -- else -- sed "${ac_end}q" conftest.subs > conftest.s$ac_file -- fi -- if test ! -s conftest.s$ac_file; then -- ac_more_lines=false -- rm -f conftest.s$ac_file -- 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` -- fi --done --if test -z "$ac_sed_cmds"; then -- ac_sed_cmds=cat --fi -- --CONFIG_FILES=${CONFIG_FILES-"Makefile"} --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" ;; -- esac -- -- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. -- -- # 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'` -- else -- ac_dir_suffix= ac_dots= -- fi -- -- 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 -- -- case "$ac_given_INSTALL" in -- [/$]*) INSTALL="$ac_given_INSTALL" ;; -- *) INSTALL="$ac_dots$ac_given_INSTALL" ;; -- esac -- -- 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= ;; -- 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 -- CONFIG_HEADERS="config.h" --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" ;; -- esac -- -- 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 -- -- cat > conftest.frag <<CEOF --${ac_dA}CONF_FILE${ac_dB}CONF_FILE${ac_dC}"/etc/tsocks.conf"${ac_dD} --${ac_uA}CONF_FILE${ac_uB}CONF_FILE${ac_uC}"/etc/tsocks.conf"${ac_uD} --${ac_eA}CONF_FILE${ac_eB}CONF_FILE${ac_eC}"/etc/tsocks.conf"${ac_eD} --${ac_dA}STDC_HEADERS${ac_dB}STDC_HEADERS${ac_dC}1${ac_dD} --${ac_uA}STDC_HEADERS${ac_uB}STDC_HEADERS${ac_uC}1${ac_uD} --${ac_eA}STDC_HEADERS${ac_eB}STDC_HEADERS${ac_eC}1${ac_eD} --${ac_dA}HAVE_UNISTD_H${ac_dB}HAVE_UNISTD_H${ac_dC}1${ac_dD} --${ac_uA}HAVE_UNISTD_H${ac_uB}HAVE_UNISTD_H${ac_uC}1${ac_uD} --${ac_eA}HAVE_UNISTD_H${ac_eB}HAVE_UNISTD_H${ac_eC}1${ac_eD} --${ac_dA}HAVE_STRCSPN${ac_dB}HAVE_STRCSPN${ac_dC}1${ac_dD} --${ac_uA}HAVE_STRCSPN${ac_uB}HAVE_STRCSPN${ac_uC}1${ac_uD} --${ac_eA}HAVE_STRCSPN${ac_eB}HAVE_STRCSPN${ac_eC}1${ac_eD} --CEOF -- sed -f conftest.frag conftest.in > conftest.out -- rm -f conftest.in -- mv conftest.out conftest.in -- -- cat > conftest.frag <<CEOF --${ac_dA}HAVE_STRDUP${ac_dB}HAVE_STRDUP${ac_dC}1${ac_dD} --${ac_uA}HAVE_STRDUP${ac_uB}HAVE_STRDUP${ac_uC}1${ac_uD} --${ac_eA}HAVE_STRDUP${ac_eB}HAVE_STRDUP${ac_eC}1${ac_eD} --${ac_dA}HAVE_STRERROR${ac_dB}HAVE_STRERROR${ac_dC}1${ac_dD} --${ac_uA}HAVE_STRERROR${ac_uB}HAVE_STRERROR${ac_uC}1${ac_uD} --${ac_eA}HAVE_STRERROR${ac_eB}HAVE_STRERROR${ac_eC}1${ac_eD} --${ac_dA}HAVE_STRSPN${ac_dB}HAVE_STRSPN${ac_dC}1${ac_dD} --${ac_uA}HAVE_STRSPN${ac_uB}HAVE_STRSPN${ac_uC}1${ac_uD} --${ac_eA}HAVE_STRSPN${ac_eB}HAVE_STRSPN${ac_eC}1${ac_eD} --${ac_dA}HAVE_STRTOL${ac_dB}HAVE_STRTOL${ac_dC}1${ac_dD} --${ac_uA}HAVE_STRTOL${ac_uB}HAVE_STRTOL${ac_uC}1${ac_uD} --${ac_eA}HAVE_STRTOL${ac_eB}HAVE_STRTOL${ac_eC}1${ac_eD} --CEOF -- sed -f conftest.frag conftest.in > conftest.out -- rm -f conftest.in -- mv conftest.out conftest.in -- -- cat > conftest.frag <<CEOF --${ac_dA}HAVE_INET_ATON${ac_dB}HAVE_INET_ATON${ac_dC}1${ac_dD} --${ac_uA}HAVE_INET_ATON${ac_uB}HAVE_INET_ATON${ac_uC}1${ac_uD} --${ac_eA}HAVE_INET_ATON${ac_eB}HAVE_INET_ATON${ac_eC}1${ac_eD} --${ac_dA}HAVE_GETHOSTBYNAME${ac_dB}HAVE_GETHOSTBYNAME${ac_dC}1${ac_dD} --${ac_uA}HAVE_GETHOSTBYNAME${ac_uB}HAVE_GETHOSTBYNAME${ac_uC}1${ac_uD} --${ac_eA}HAVE_GETHOSTBYNAME${ac_eB}HAVE_GETHOSTBYNAME${ac_eC}1${ac_eD} --${ac_dA}HAVE_LIBDL${ac_dB}HAVE_LIBDL${ac_dC}1${ac_dD} --${ac_uA}HAVE_LIBDL${ac_uB}HAVE_LIBDL${ac_uC}1${ac_uD} --${ac_eA}HAVE_LIBDL${ac_eB}HAVE_LIBDL${ac_eC}1${ac_eD} --${ac_dA}ALLOW_ENV_CONFIG${ac_dB}ALLOW_ENV_CONFIG${ac_dC}1${ac_dD} --${ac_uA}ALLOW_ENV_CONFIG${ac_uB}ALLOW_ENV_CONFIG${ac_uC}1${ac_uD} --${ac_eA}ALLOW_ENV_CONFIG${ac_eB}ALLOW_ENV_CONFIG${ac_eC}1${ac_eD} --CEOF -- sed -f conftest.frag conftest.in > conftest.out -- rm -f conftest.in -- mv conftest.out conftest.in -- -- cat > conftest.frag <<CEOF --${ac_dA}ALLOW_MSG_OUTPUT${ac_dB}ALLOW_MSG_OUTPUT${ac_dC}1${ac_dD} --${ac_uA}ALLOW_MSG_OUTPUT${ac_uB}ALLOW_MSG_OUTPUT${ac_uC}1${ac_uD} --${ac_eA}ALLOW_MSG_OUTPUT${ac_eB}ALLOW_MSG_OUTPUT${ac_eC}1${ac_eD} --${ac_dA}HOSTNAMES${ac_dB}HOSTNAMES${ac_dC}1${ac_dD} --${ac_uA}HOSTNAMES${ac_uB}HOSTNAMES${ac_uC}1${ac_uD} --${ac_eA}HOSTNAMES${ac_eB}HOSTNAMES${ac_eC}1${ac_eD} --${ac_dA}SELECT_SIGNATURE${ac_dB}SELECT_SIGNATURE${ac_dC}int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout${ac_dD} --${ac_uA}SELECT_SIGNATURE${ac_uB}SELECT_SIGNATURE${ac_uC}int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout${ac_uD} --${ac_eA}SELECT_SIGNATURE${ac_eB}SELECT_SIGNATURE${ac_eC}int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout${ac_eD} --${ac_dA}CONNECT_SIGNATURE${ac_dB}CONNECT_SIGNATURE${ac_dC}int __fd, const struct sockaddr_in * __addr, socklen_t __len${ac_dD} --${ac_uA}CONNECT_SIGNATURE${ac_uB}CONNECT_SIGNATURE${ac_uC}int __fd, const struct sockaddr_in * __addr, socklen_t __len${ac_uD} --${ac_eA}CONNECT_SIGNATURE${ac_eB}CONNECT_SIGNATURE${ac_eC}int __fd, const struct sockaddr_in * __addr, socklen_t __len${ac_eD} --CEOF -- sed -f conftest.frag conftest.in > conftest.out -- rm -f conftest.in -- mv conftest.out conftest.in -- -- cat > conftest.frag <<CEOF --${ac_dA}CONNECT_SOCKARG${ac_dB}CONNECT_SOCKARG${ac_dC}struct sockaddr_in *${ac_dD} --${ac_uA}CONNECT_SOCKARG${ac_uB}CONNECT_SOCKARG${ac_uC}struct sockaddr_in *${ac_uD} --${ac_eA}CONNECT_SOCKARG${ac_eB}CONNECT_SOCKARG${ac_eC}struct sockaddr_in *${ac_eD} --${ac_dA}CLOSE_SIGNATURE${ac_dB}CLOSE_SIGNATURE${ac_dC}int fd${ac_dD} --${ac_uA}CLOSE_SIGNATURE${ac_uB}CLOSE_SIGNATURE${ac_uC}int fd${ac_uD} --${ac_eA}CLOSE_SIGNATURE${ac_eB}CLOSE_SIGNATURE${ac_eC}int fd${ac_eD} --${ac_dA}POLL_SIGNATURE${ac_dB}POLL_SIGNATURE${ac_dC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_dD} --${ac_uA}POLL_SIGNATURE${ac_uB}POLL_SIGNATURE${ac_uC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_uD} --${ac_eA}POLL_SIGNATURE${ac_eB}POLL_SIGNATURE${ac_eC}struct pollfd *ufds, unsigned long nfds, int timeout${ac_eD} --s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% --CEOF -- sed -f conftest.frag conftest.in > conftest.out -- rm -f conftest.in -- mv conftest.out conftest.in -- -- 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" -- fi -- rm -f $ac_file -- mv conftest.h $ac_file -- fi --fi; done -- -- -- --exit 0 -diff -rN -U 5 tsocks-1.8/configure tsocks/configure ---- tsocks-1.8/configure 2002-07-16 10:51:08.000000000 +1200 -+++ tsocks/configure 2005-10-02 21:57:17.000000000 +1300 -@@ -1,53 +1,345 @@ - #! /bin/sh -- - # 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. -+# Generated by GNU Autoconf 2.59. - # -+# Copyright (C) 2003 Free Software Foundation, Inc. - # This configure script is free software; the Free Software Foundation - # gives unlimited permission to copy, distribute and modify it. -+## --------------------- ## -+## M4sh Initialization. ## -+## --------------------- ## -+ -+# Be Bourne compatible -+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then -+ emulate sh -+ NULLCMD=: -+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which -+ # is contrary to our usage. Disable this feature. -+ alias -g '${1+"$@"}'='"$@"' -+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then -+ set -o posix -+fi -+DUALCASE=1; export DUALCASE # for MKS sh -+ -+# Support unset when possible. -+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then -+ as_unset=unset -+else -+ as_unset=false -+fi -+ -+ -+# Work around bugs in pre-3.0 UWIN ksh. -+$as_unset ENV MAIL MAILPATH -+PS1='$ ' -+PS2='> ' -+PS4='+ ' -+ -+# NLS nuisances. -+for as_var in \ -+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ -+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ -+ LC_TELEPHONE LC_TIME -+do -+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then -+ eval $as_var=C; export $as_var -+ else -+ $as_unset $as_var -+ fi -+done -+ -+# Required to use basename. -+if expr a : '(a)' >/dev/null 2>&1; then -+ as_expr=expr -+else -+ as_expr=false -+fi -+ -+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then -+ as_basename=basename -+else -+ as_basename=false -+fi -+ -+ -+# Name of the executable. -+as_me=`$as_basename "$0" || -+$as_expr X/"$0" : '.*/([^/][^/]*)/*$' | \ -+ X"$0" : 'X(//)$' | \ -+ X"$0" : 'X(/)$' | \ -+ . : '(.)' 2>/dev/null || -+echo X/"$0" | -+ sed '/^.*/([^/][^/]*)/*$/{ s//\1/; q; } -+ /^X/(//)$/{ s//\1/; q; } -+ /^X/(/).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ -+ -+# PATH needs CR, and LINENO needs CR and PATH. -+# Avoid depending upon Character Ranges. -+as_cr_letters='abcdefghijklmnopqrstuvwxyz' -+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -+as_cr_Letters=$as_cr_letters$as_cr_LETTERS -+as_cr_digits='0123456789' -+as_cr_alnum=$as_cr_Letters$as_cr_digits -+ -+# The user is always right. -+if test "${PATH_SEPARATOR+set}" != set; then -+ echo "#! /bin/sh" >conf$$.sh -+ echo "exit 0" >>conf$$.sh -+ chmod +x conf$$.sh -+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then -+ PATH_SEPARATOR=';' -+ else -+ PATH_SEPARATOR=: -+ fi -+ rm -f conf$$.sh -+fi -+ -+ -+ as_lineno_1=$LINENO -+ as_lineno_2=$LINENO -+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` -+ test "x$as_lineno_1" != "x$as_lineno_2" && -+ test "x$as_lineno_3" = "x$as_lineno_2" || { -+ # Find who we are. Look in the path if we contain no path at all -+ # relative or not. -+ case $0 in -+ *[\/]* ) as_myself=$0 ;; -+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -+done -+ -+ ;; -+ esac -+ # We did not find ourselves, most probably we were run as `sh COMMAND' -+ # in which case we are not to be found in the path. -+ if test "x$as_myself" = x; then -+ as_myself=$0 -+ fi -+ if test ! -f "$as_myself"; then -+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 -+ { (exit 1); exit 1; }; } -+ fi -+ case $CONFIG_SHELL in -+ '') -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for as_base in sh bash ksh sh5; do -+ case $as_dir in -+ /*) -+ if ("$as_dir/$as_base" -c ' -+ as_lineno_1=$LINENO -+ as_lineno_2=$LINENO -+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` -+ test "x$as_lineno_1" != "x$as_lineno_2" && -+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then -+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } -+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } -+ CONFIG_SHELL=$as_dir/$as_base -+ export CONFIG_SHELL -+ exec "$CONFIG_SHELL" "$0" ${1+"$@"} -+ fi;; -+ esac -+ done -+done -+;; -+ esac -+ -+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO -+ # uniformly replaced by the line number. The first 'sed' inserts a -+ # line-number line before each line; the second 'sed' does the real -+ # work. The second script uses 'N' to pair each line-number line -+ # with the numbered line, and appends trailing '-' during -+ # substitution so that $LINENO is not a special case at line end. -+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the -+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) -+ sed '=' <$as_myself | -+ sed ' -+ N -+ s,$,-, -+ : loop -+ s,^(['$as_cr_digits']*)(.*)[$]LINENO([^'$as_cr_alnum'_]),\1\2\1\3, -+ t loop -+ s,-$,, -+ s,^['$as_cr_digits']*\n,, -+ ' >$as_me.lineno && -+ chmod +x $as_me.lineno || -+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 -+ { (exit 1); exit 1; }; } -+ -+ # Don't try to exec as it changes $[0], causing all sort of problems -+ # (the dirname of $[0] is not the place where we might find the -+ # original and so on. Autoconf is especially sensible to this). -+ . ./$as_me.lineno -+ # Exit status is that of the last command. -+ exit -+} -+ -+ -+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in -+ *c*,-n*) ECHO_N= ECHO_C=' -+' ECHO_T=' ' ;; -+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; -+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -+esac -+ -+if expr a : '(a)' >/dev/null 2>&1; then -+ as_expr=expr -+else -+ as_expr=false -+fi -+ -+rm -f conf$$ conf$$.exe conf$$.file -+echo >conf$$.file -+if ln -s conf$$.file conf$$ 2>/dev/null; then -+ # We could just check for DJGPP; but this test a) works b) is more generic -+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). -+ if test -f conf$$.exe; then -+ # Don't use ln at all; we don't have any links -+ as_ln_s='cp -p' -+ else -+ as_ln_s='ln -s' -+ fi -+elif ln conf$$.file conf$$ 2>/dev/null; then -+ as_ln_s=ln -+else -+ as_ln_s='cp -p' -+fi -+rm -f conf$$ conf$$.exe conf$$.file -+ -+if mkdir -p . 2>/dev/null; then -+ as_mkdir_p=: -+else -+ test -d ./-p && rmdir ./-p -+ as_mkdir_p=false -+fi -+ -+as_executable_p="test -f" -+ -+# Sed expression to map a string onto a valid CPP name. -+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" -+ -+# Sed expression to map a string onto a valid variable name. -+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -+ -+ -+# IFS -+# We need space, tab and new line, in precisely that order. -+as_nl=' -+' -+IFS=" $as_nl" -+ -+# CDPATH. -+$as_unset CDPATH -+ - --# Defaults: --ac_help= -+# Name of the host. -+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -+# so uname gets run too. -+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -+ -+exec 6>&1 -+ -+# -+# Initializations. -+# - ac_default_prefix=/usr/local --# Any additions from configure.in: -+ac_config_libobj_dir=. -+cross_compiling=no -+subdirs= -+MFLAGS= -+MAKEFLAGS= -+SHELL=${CONFIG_SHELL-/bin/sh} -+ -+# Maximum number of lines to put in a shell here document. -+# This variable seems obsolete. It should probably be removed, and -+# only ac_max_sed_lines should be used. -+: ${ac_max_here_lines=38} -+ -+# Identity of this package. -+PACKAGE_NAME= -+PACKAGE_TARNAME= -+PACKAGE_VERSION= -+PACKAGE_STRING= -+PACKAGE_BUGREPORT= -+ -+ac_unique_file="saveme.c" - ac_default_prefix=/usr --ac_help="$ac_help -- --enable-socksdns force dns lookups to use tcp " --ac_help="$ac_help -- --disable-debug disable ALL error messages from tsocks " --ac_help="$ac_help -- --enable-oldmethod use the old method to override connect " --ac_help="$ac_help -- --disable-hostnames disable hostname lookups for socks servers " --ac_help="$ac_help -- --disable-envconf do not allow TSOCKS_CONF_FILE to specify configuration file " --ac_help="$ac_help -- --with-conf=<file> location of configuration file (/etc/tsocks.conf default)" -+# Factoring default headers for most tests. -+ac_includes_default="\ -+#include <stdio.h> -+#if HAVE_SYS_TYPES_H -+# include <sys/types.h> -+#endif -+#if HAVE_SYS_STAT_H -+# include <sys/stat.h> -+#endif -+#if STDC_HEADERS -+# include <stdlib.h> -+# include <stddef.h> -+#else -+# if HAVE_STDLIB_H -+# include <stdlib.h> -+# endif -+#endif -+#if HAVE_STRING_H -+# if !STDC_HEADERS && HAVE_MEMORY_H -+# include <memory.h> -+# endif -+# include <string.h> -+#endif -+#if HAVE_STRINGS_H -+# include <strings.h> -+#endif -+#if HAVE_INTTYPES_H -+# include <inttypes.h> -+#else -+# if HAVE_STDINT_H -+# include <stdint.h> -+# endif -+#endif -+#if 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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CPP EGREP DEADPOOL_O FIND TAIL SPECIALLIBS LIBOBJS LTLIBOBJS' -+ac_subst_files='' - - # Initialize some variables set by options. -+ac_init_help= -+ac_init_version=false - # The variables have the same names as the options, with - # dashes changed to underlines. --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 - program_suffix=NONE - 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. - bindir='${exec_prefix}/bin' - sbindir='${exec_prefix}/sbin' - libexecdir='${exec_prefix}/libexec' - datadir='${prefix}/share' - sysconfdir='${prefix}/etc' -@@ -57,199 +349,143 @@ - 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 -- - ac_prev= - for ac_option - do -- - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=$ac_option" - ac_prev= - continue - fi - -- case "$ac_option" in -- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; -- *) ac_optarg= ;; -- esac -+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=(.*)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - -- case "$ac_option" in -+ case $ac_option in - - -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 ;; -+ -+ --config-cache | -C) -+ cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) -- datadir="$ac_optarg" ;; -+ datadir=$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" ;; - - -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 -- *=*) ;; -+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && -+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2 -+ { (exit 1); exit 1; }; } -+ ac_feature=`echo $ac_feature | sed 's/-/_/g'` -+ case $ac_option in -+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\''/g"`;; - *) ac_optarg=yes ;; - esac -- eval "enable_${ac_feature}='$ac_optarg'" ;; -+ eval "enable_$ac_feature='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) -- exec_prefix="$ac_optarg" ;; -+ 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 ;; - - -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 ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) -- localstatedir="$ac_optarg" ;; -+ 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 \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; -@@ -259,30 +495,30 @@ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) -- oldincludedir="$ac_optarg" ;; -+ 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 \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ -@@ -295,305 +531,842 @@ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) -- program_transform_name="$ac_optarg" ;; -+ program_transform_name=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) -- sbindir="$ac_optarg" ;; -+ sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) -- sharedstatedir="$ac_optarg" ;; -+ 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 -+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && -+ { echo "$as_me: error: invalid package name: $ac_package" >&2 -+ { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` -- case "$ac_option" in -- *=*) ;; -+ case $ac_option in -+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\''/g"`;; - *) ac_optarg=yes ;; - esac -- eval "with_${ac_package}='$ac_optarg'" ;; -+ 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. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) -- x_includes="$ac_optarg" ;; -+ x_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; }; } -+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\''/g"` -+ 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; } --fi -- --trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 -- --# 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 -+ ac_option=--`echo $ac_prev | sed 's/_/-/g'` -+ { echo "$as_me: error: missing argument to $ac_option" >&2 -+ { (exit 1); exit 1; }; } - 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 -+# Be sure to have absolute paths. -+for ac_var in exec_prefix prefix -+do -+ eval ac_val=$`echo $ac_var` -+ case $ac_val in -+ [\/$]* | ?:[\/]* | NONE | '' ) ;; -+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 -+ { (exit 1); exit 1; }; };; -+ esac -+done - --# 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 -+# Be sure to have absolute paths. -+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ -+ localstatedir libdir includedir oldincludedir infodir mandir - 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" ;; -+ eval ac_val=$`echo $ac_var` -+ case $ac_val in -+ [\/$]* | ?:[\/]* ) ;; -+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 -+ { (exit 1); exit 1; }; };; - esac - done - --# 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 -+# 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 - --# 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_tool_prefix= -+test -n "$host_alias" && ac_tool_prefix=$host_alias- -+ -+test "$silent" = yes && exec 6>/dev/null - --# 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=saveme.c - - # 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=. -+ ac_confdir=`(dirname "$0") 2>/dev/null || -+$as_expr X"$0" : 'X(.*[^/])//*[^/][^/]*/*$' | \ -+ X"$0" : 'X(//)[^/]' | \ -+ X"$0" : 'X(//)$' | \ -+ X"$0" : 'X(/)' | \ -+ . : '(.)' 2>/dev/null || -+echo X"$0" | -+ sed '/^X(.*[^/])//*[^/][^/]*/*$/{ s//\1/; q; } -+ /^X(//)[^/].*/{ s//\1/; q; } -+ /^X(//)$/{ s//\1/; q; } -+ /^X(/).*/{ s//\1/; q; } -+ s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi - else - ac_srcdir_defaulted=no - fi - if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then -- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } -+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 -+ { (exit 1); exit 1; }; } - else -- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } -+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 -+ { (exit 1); exit 1; }; } - fi - fi --srcdir=`echo "${srcdir}" | sed 's%([^/])/*$%\1%'` -+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || -+ { echo "$as_me: error: sources are in $srcdir, but `cd $srcdir' does not work" >&2 -+ { (exit 1); exit 1; }; } -+srcdir=`echo "$srcdir" | sed 's%([^\/])[\/]*$%\1%'` -+ac_env_build_alias_set=${build_alias+set} -+ac_env_build_alias_value=$build_alias -+ac_cv_env_build_alias_set=${build_alias+set} -+ac_cv_env_build_alias_value=$build_alias -+ac_env_host_alias_set=${host_alias+set} -+ac_env_host_alias_value=$host_alias -+ac_cv_env_host_alias_set=${host_alias+set} -+ac_cv_env_host_alias_value=$host_alias -+ac_env_target_alias_set=${target_alias+set} -+ac_env_target_alias_value=$target_alias -+ac_cv_env_target_alias_set=${target_alias+set} -+ac_cv_env_target_alias_value=$target_alias -+ac_env_CC_set=${CC+set} -+ac_env_CC_value=$CC -+ac_cv_env_CC_set=${CC+set} -+ac_cv_env_CC_value=$CC -+ac_env_CFLAGS_set=${CFLAGS+set} -+ac_env_CFLAGS_value=$CFLAGS -+ac_cv_env_CFLAGS_set=${CFLAGS+set} -+ac_cv_env_CFLAGS_value=$CFLAGS -+ac_env_LDFLAGS_set=${LDFLAGS+set} -+ac_env_LDFLAGS_value=$LDFLAGS -+ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -+ac_cv_env_LDFLAGS_value=$LDFLAGS -+ac_env_CPPFLAGS_set=${CPPFLAGS+set} -+ac_env_CPPFLAGS_value=$CPPFLAGS -+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -+ac_cv_env_CPPFLAGS_value=$CPPFLAGS -+ac_env_CPP_set=${CPP+set} -+ac_env_CPP_value=$CPP -+ac_cv_env_CPP_set=${CPP+set} -+ac_cv_env_CPP_value=$CPP -+ -+# -+# Report the --help message. -+# -+if test "$ac_init_help" = "long"; then -+ # Omit some internal or obsolete options to make the list less imposing. -+ # This message is too long to be a string in the A/UX 3.1 sh. -+ cat <<_ACEOF -+`configure' configures this package to adapt to many kinds of systems. -+ -+Usage: $0 [OPTION]... [VAR=VALUE]... -+ -+To assign environment variables (e.g., CC, CFLAGS...), specify them as -+VAR=VALUE. See below for descriptions of some of the useful variables. -+ -+Defaults for the options are specified in brackets. -+ -+Configuration: -+ -h, --help display this help and exit -+ --help=short display options specific to this package -+ --help=recursive display the short help of all the included packages -+ -V, --version display version information and exit -+ -q, --quiet, --silent do not print `checking...' messages -+ --cache-file=FILE cache test results in FILE [disabled] -+ -C, --config-cache alias for `--cache-file=config.cache' -+ -n, --no-create do not create output files -+ --srcdir=DIR find the sources in DIR [configure dir or `..'] -+ -+_ACEOF -+ -+ cat <<_ACEOF -+Installation directories: -+ --prefix=PREFIX install architecture-independent files in PREFIX -+ [$ac_default_prefix] -+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX -+ [PREFIX] -+ -+By default, `make install' will install all the files in -+`$ac_default_prefix/bin', `$ac_default_prefix/lib' etc. You can specify -+an installation prefix other than `$ac_default_prefix' using `--prefix', -+for instance `--prefix=$HOME'. -+ -+For better control, use the options below. -+ -+Fine tuning of the installation directories: -+ --bindir=DIR user executables [EPREFIX/bin] -+ --sbindir=DIR system admin executables [EPREFIX/sbin] -+ --libexecdir=DIR program executables [EPREFIX/libexec] -+ --datadir=DIR read-only architecture-independent data [PREFIX/share] -+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] -+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] -+ --localstatedir=DIR modifiable single-machine data [PREFIX/var] -+ --libdir=DIR object code libraries [EPREFIX/lib] -+ --includedir=DIR C header files [PREFIX/include] -+ --oldincludedir=DIR C header files for non-gcc [/usr/include] -+ --infodir=DIR info documentation [PREFIX/info] -+ --mandir=DIR man documentation [PREFIX/man] -+_ACEOF -+ -+ cat <<_ACEOF -+ -+System types: -+ --build=BUILD configure for building on BUILD [guessed] -+ --host=HOST cross-compile to build programs to run on HOST [BUILD] -+_ACEOF -+fi -+ -+if test -n "$ac_init_help"; then -+ -+ cat <<_ACEOF -+ -+Optional Features: -+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) -+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] -+ --enable-socksdns force dns lookups to use tcp -+ --disable-tordns don't override name lookup calls to use SOCKS -+ --disable-debug disable ALL error messages from tsocks -+ --enable-oldmethod use the old method to override connect -+ --enable-hostnames enable hostname lookups for socks servers -+ --disable-envconf do not allow TSOCKS_CONF_FILE to specify configuration file -+ -+Optional Packages: -+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] -+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) -+ --with-conf=<file> location of configuration file (/etc/tsocks.conf default) -+ -+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> -+ CPPFLAGS C/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. -+ -+_ACEOF -+fi -+ -+if test "$ac_init_help" = "recursive"; then -+ # If there are subdirs, report their specific --help. -+ ac_popdir=`pwd` -+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue -+ test -d $ac_dir || continue -+ ac_builddir=. -+ -+if test "$ac_dir" != .; then -+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^.[\/],,'` -+ # A "../" for each directory in $ac_dir_suffix. -+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\/]*,../,g'` -+else -+ ac_dir_suffix= ac_top_builddir= -+fi -+ -+case $srcdir in -+ .) # No --srcdir option. We are building in place. -+ ac_srcdir=. -+ if test -z "$ac_top_builddir"; then -+ ac_top_srcdir=. -+ else -+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` -+ fi ;; -+ [\/]* | ?:[\/]* ) # Absolute path. -+ ac_srcdir=$srcdir$ac_dir_suffix; -+ ac_top_srcdir=$srcdir ;; -+ *) # Relative path. -+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix -+ ac_top_srcdir=$ac_top_builddir$srcdir ;; -+esac -+ -+# Do not use `cd foo && pwd` to compute absolute paths, because -+# the directories may not exist. -+case `pwd` in -+.) ac_abs_builddir="$ac_dir";; -+*) -+ case "$ac_dir" in -+ .) ac_abs_builddir=`pwd`;; -+ [\/]* | ?:[\/]* ) ac_abs_builddir="$ac_dir";; -+ *) ac_abs_builddir=`pwd`/"$ac_dir";; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_top_builddir=${ac_top_builddir}.;; -+*) -+ case ${ac_top_builddir}. in -+ .) ac_abs_top_builddir=$ac_abs_builddir;; -+ [\/]* | ?:[\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; -+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_srcdir=$ac_srcdir;; -+*) -+ case $ac_srcdir in -+ .) ac_abs_srcdir=$ac_abs_builddir;; -+ [\/]* | ?:[\/]* ) ac_abs_srcdir=$ac_srcdir;; -+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_top_srcdir=$ac_top_srcdir;; -+*) -+ case $ac_top_srcdir in -+ .) ac_abs_top_srcdir=$ac_abs_builddir;; -+ [\/]* | ?:[\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; -+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; -+ esac;; -+esac -+ -+ cd $ac_dir -+ # Check for guested configure; otherwise get Cygnus style configure. -+ if test -f $ac_srcdir/configure.gnu; then -+ echo -+ $SHELL $ac_srcdir/configure.gnu --help=recursive -+ elif test -f $ac_srcdir/configure; then -+ echo -+ $SHELL $ac_srcdir/configure --help=recursive -+ elif test -f $ac_srcdir/configure.ac || -+ test -f $ac_srcdir/configure.in; then -+ echo -+ $ac_configure --help -+ else -+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 -+ fi -+ cd "$ac_popdir" -+ done -+fi -+ -+test -n "$ac_init_help" && exit 0 -+if $ac_init_version; then -+ cat <<_ACEOF -+ -+Copyright (C) 2003 Free Software Foundation, Inc. -+This configure script is free software; the Free Software Foundation -+gives unlimited permission to copy, distribute and modify it. -+_ACEOF -+ exit 0 -+fi -+exec 5>config.log -+cat >&5 <<_ACEOF -+This file contains any messages produced by compilers while -+running configure, to aid debugging if configure makes a mistake. -+ -+It was created by $as_me, which was -+generated by GNU Autoconf 2.59. Invocation command line was -+ -+ $ $0 $@ -+ -+_ACEOF -+{ -+cat <<_ASUNAME -+## --------- ## -+## Platform. ## -+## --------- ## -+ -+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -+uname -m = `(uname -m) 2>/dev/null || echo unknown` -+uname -r = `(uname -r) 2>/dev/null || echo unknown` -+uname -s = `(uname -s) 2>/dev/null || echo unknown` -+uname -v = `(uname -v) 2>/dev/null || echo unknown` -+ -+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` -+ -+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -+hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` -+ -+_ASUNAME -+ -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ echo "PATH: $as_dir" -+done -+ -+} >&5 -+ -+cat >&5 <<_ACEOF -+ -+ -+## ----------- ## -+## Core tests. ## -+## ----------- ## -+ -+_ACEOF -+ -+ -+# Keep a trace of the command line. -+# Strip out --no-create and --no-recursion so they do not pile up. -+# Strip out --silent because we don't want to record it for future runs. -+# Also quote any args containing shell meta-characters. -+# Make two passes to allow for proper duplicate-argument suppression. -+ac_configure_args= -+ac_configure_args0= -+ac_configure_args1= -+ac_sep= -+ac_must_keep_next=false -+for ac_pass in 1 2 -+do -+ for ac_arg -+ do -+ case $ac_arg in -+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ -+ | -silent | --silent | --silen | --sile | --sil) -+ continue ;; -+ *" "*|*" "*|*[[]~#$^&*(){}\|;<>?"']*) -+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\''/g"` ;; -+ esac -+ case $ac_pass in -+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; -+ 2) -+ ac_configure_args1="$ac_configure_args1 '$ac_arg'" -+ if test $ac_must_keep_next = true; then -+ ac_must_keep_next=false # Got value, back to normal. -+ else -+ case $ac_arg in -+ *=* | --config-cache | -C | -disable-* | --disable-* \ -+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ -+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ -+ | -with-* | --with-* | -without-* | --without-* | --x) -+ case "$ac_configure_args0 " in -+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; -+ esac -+ ;; -+ -* ) ac_must_keep_next=true ;; -+ esac -+ fi -+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" -+ # Get rid of the leading space. -+ ac_sep=" " -+ ;; -+ esac -+ done -+done -+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } -+ -+# When interrupted or exit'd, cleanup temporary files, and complete -+# config.log. We remove comments because anyway the quotes in there -+# would cause problems or look ugly. -+# WARNING: Be sure not to use single quotes in there, as some shells, -+# such as our DU 5.0 friend, will then `close' the trap. -+trap 'exit_status=$? -+ # Save into config.log some information that might help in debugging. -+ { -+ echo -+ -+ cat <<_ASBOX -+## ---------------- ## -+## Cache variables. ## -+## ---------------- ## -+_ASBOX -+ echo -+ # The following way of writing the cache mishandles newlines in values, -+{ -+ (set) 2>&1 | -+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in -+ *ac_space=\ *) -+ sed -n \ -+ "s/'"'"'/'"'"'\\'"'"''"'"'/g; -+ s/^\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\)=\(.*\)/\1='"'"'\2'"'"'/p" -+ ;; -+ *) -+ sed -n \ -+ "s/^\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\)=\(.*\)/\1=\2/p" -+ ;; -+ esac; -+} -+ echo -+ -+ cat <<_ASBOX -+## ----------------- ## -+## Output variables. ## -+## ----------------- ## -+_ASBOX -+ echo -+ for ac_var in $ac_subst_vars -+ do -+ eval ac_val=$`echo $ac_var` -+ echo "$ac_var='"'"'$ac_val'"'"'" -+ done | sort -+ echo -+ -+ if test -n "$ac_subst_files"; then -+ cat <<_ASBOX -+## ------------- ## -+## Output files. ## -+## ------------- ## -+_ASBOX -+ echo -+ for ac_var in $ac_subst_files -+ do -+ eval ac_val=$`echo $ac_var` -+ echo "$ac_var='"'"'$ac_val'"'"'" -+ done | sort -+ echo -+ fi -+ -+ if test -s confdefs.h; then -+ cat <<_ASBOX -+## ----------- ## -+## confdefs.h. ## -+## ----------- ## -+_ASBOX -+ echo -+ sed "/^$/d" confdefs.h | sort -+ echo -+ fi -+ test "$ac_signal" != 0 && -+ echo "$as_me: caught signal $ac_signal" -+ echo "$as_me: exit $exit_status" -+ } >&5 -+ rm -f core *.core && -+ rm -rf conftest* confdefs* conf$$* $ac_clean_files && -+ exit $exit_status -+ ' 0 -+for ac_signal in 1 2 13 15; do -+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -+done -+ac_signal=0 -+ -+# confdefs.h avoids OS command line length limits that DEFS can exceed. -+rm -rf conftest* confdefs.h -+# AIX cpp loses on an empty file, so make sure it contains at least a newline. -+echo >confdefs.h -+ -+# Predefined preprocessor variables. -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_NAME "$PACKAGE_NAME" -+_ACEOF -+ -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -+_ACEOF - -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_VERSION "$PACKAGE_VERSION" -+_ACEOF -+ -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_STRING "$PACKAGE_STRING" -+_ACEOF -+ -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -+_ACEOF -+ -+ -+# Let the site file select an alternate cache file if it wants to. - # Prefer explicitly selected file to automatically selected ones. - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi - fi - for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then -- echo "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 `(set) 2>&1 | -+ sed -n 's/^ac_env_([a-zA-Z_0-9]*)_set=.*/\1/p'`; do -+ eval ac_old_set=$ac_cv_env_${ac_var}_set -+ eval ac_new_set=$ac_env_${ac_var}_set -+ eval ac_old_val="$ac_cv_env_${ac_var}_value" -+ eval ac_new_val="$ac_env_${ac_var}_value" -+ case $ac_old_set,$ac_new_set in -+ set,) -+ { echo "$as_me:$LINENO: error: `$ac_var' was set to `$ac_old_val' in the previous run" >&5 -+echo "$as_me: error: `$ac_var' was set to `$ac_old_val' in the previous run" >&2;} -+ ac_cache_corrupted=: ;; -+ ,set) -+ { echo "$as_me:$LINENO: error: `$ac_var' was not set in the previous run" >&5 -+echo "$as_me: error: `$ac_var' was not set in the previous run" >&2;} -+ ac_cache_corrupted=: ;; -+ ,);; -+ *) -+ if test "x$ac_old_val" != "x$ac_new_val"; then -+ { echo "$as_me:$LINENO: error: `$ac_var' has changed since the previous run:" >&5 -+echo "$as_me: error: `$ac_var' has changed since the previous run:" >&2;} -+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -+echo "$as_me: former value: $ac_old_val" >&2;} -+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -+echo "$as_me: current value: $ac_new_val" >&2;} -+ ac_cache_corrupted=: -+ fi;; -+ esac -+ # Pass precious variables to config.status. -+ if test "$ac_new_set" = set; then -+ case $ac_new_val in -+ *" "*|*" "*|*[[]~#$^&*(){}\|;<>?"']*) -+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\''/g"` ;; -+ *) ac_arg=$ac_var=$ac_new_val ;; -+ esac -+ case " $ac_configure_args " in -+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. -+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; -+ esac -+ fi -+done -+if $ac_cache_corrupted; then -+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -+echo "$as_me: error: changes in the environment can compromise the build" >&2;} -+ { { echo "$as_me:$LINENO: error: run `make distclean' and/or `rm $cache_file' and start over" >&5 -+echo "$as_me: error: run `make distclean' and/or `rm $cache_file' and start over" >&2;} -+ { (exit 1); exit 1; }; } - fi - - ac_ext=c --# 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=' ' -- else -- ac_n=-n ac_c= ac_t= -- fi --else -- ac_n= ac_c='\c' ac_t= --fi -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - - - - -+ ac_config_headers="$ac_config_headers config.h" -+ -+ -+ -+ - test "$libdir" = "${exec_prefix}/lib" && libdir="/lib" - - # Check whether --enable-socksdns or --disable-socksdns was given. - if test "${enable_socksdns+set}" = set; then - enableval="$enable_socksdns" -- : --fi - -+fi; -+# Check whether --enable-tordns or --disable-tordns was given. -+if test "${enable_tordns+set}" = set; then -+ enableval="$enable_tordns" -+ -+fi; - # Check whether --enable-debug or --disable-debug was given. - if test "${enable_debug+set}" = set; then - enableval="$enable_debug" -- : --fi - -+fi; - # Check whether --enable-oldmethod or --disable-oldmethod was given. - if test "${enable_oldmethod+set}" = set; then - enableval="$enable_oldmethod" -- : --fi - -+fi; - # Check whether --enable-hostnames or --disable-hostnames was given. - if test "${enable_hostnames+set}" = set; then - enableval="$enable_hostnames" -- : --fi - -+fi; - # Check whether --enable-envconf or --disable-envconf was given. - if test "${enable_envconf+set}" = set; then - enableval="$enable_envconf" -- : --fi -+ -+fi; - - # Check whether --with-conf or --without-conf was given. - if test "${with_conf+set}" = set; then - withval="$with_conf" -- -+ - if test "${withval}" = "yes" ; then -- { echo "configure: error: "--with-conf requires the location of the configuration file as an argument"" 1>&2; exit 1; } -+ { { echo "$as_me:$LINENO: error: "--with-conf requires the location of the configuration file as an argument"" >&5 -+echo "$as_me: error: "--with-conf requires the location of the configuration file as an argument"" >&2;} -+ { (exit 1); exit 1; }; } - else -- cat >> confdefs.h <<EOF -+ cat >>confdefs.h <<_ACEOF - #define CONF_FILE "${withval}" --EOF -+_ACEOF - - fi - - else -- -- cat >> confdefs.h <<EOF --#define CONF_FILE "/etc/tsocks.conf" --EOF - -+ cat >>confdefs.h <<_ACEOF -+#define CONF_FILE "/etc/tsocks.conf" -+_ACEOF - --fi - -+fi; - - - ac_aux_dir= - for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then -@@ -602,255 +1375,731 @@ - 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 "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. -- -+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+ac_config_guess="$SHELL $ac_aux_dir/config.guess" -+ac_config_sub="$SHELL $ac_aux_dir/config.sub" -+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - - # Make sure we can run config.sub. --if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : --else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } --fi -- --echo $ac_n "checking host system type""... $ac_c" 1>&6 --echo "configure:624: checking host system type" >&5 -- --host_alias=$host --case "$host_alias" in --NONE) -- case $nonopt in -- NONE) -- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : -- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } -- fi ;; -- *) host_alias=$nonopt ;; -- esac ;; --esac -+$ac_config_sub sun4 >/dev/null 2>&1 || -+ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -+echo "$as_me: error: cannot run $ac_config_sub" >&2;} -+ { (exit 1); exit 1; }; } -+ -+echo "$as_me:$LINENO: checking build system type" >&5 -+echo $ECHO_N "checking build system type... $ECHO_C" >&6 -+if test "${ac_cv_build+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_cv_build_alias=$build_alias -+test -z "$ac_cv_build_alias" && -+ ac_cv_build_alias=`$ac_config_guess` -+test -z "$ac_cv_build_alias" && -+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -+echo "$as_me: error: cannot guess build type; you must specify one" >&2;} -+ { (exit 1); exit 1; }; } -+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || -+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} -+ { (exit 1); exit 1; }; } -+ -+fi -+echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -+echo "${ECHO_T}$ac_cv_build" >&6 -+build=$ac_cv_build -+build_cpu=`echo $ac_cv_build | sed 's/^([^-]*)-([^-]*)-(.*)$/\1/'` -+build_vendor=`echo $ac_cv_build | sed 's/^([^-]*)-([^-]*)-(.*)$/\2/'` -+build_os=`echo $ac_cv_build | sed 's/^([^-]*)-([^-]*)-(.*)$/\3/'` -+ -+ -+echo "$as_me:$LINENO: checking host system type" >&5 -+echo $ECHO_N "checking host system type... $ECHO_C" >&6 -+if test "${ac_cv_host+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_cv_host_alias=$host_alias -+test -z "$ac_cv_host_alias" && -+ ac_cv_host_alias=$ac_cv_build_alias -+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || -+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} -+ { (exit 1); exit 1; }; } -+ -+fi -+echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -+echo "${ECHO_T}$ac_cv_host" >&6 -+host=$ac_cv_host -+host_cpu=`echo $ac_cv_host | sed 's/^([^-]*)-([^-]*)-(.*)$/\1/'` -+host_vendor=`echo $ac_cv_host | sed 's/^([^-]*)-([^-]*)-(.*)$/\2/'` -+host_os=`echo $ac_cv_host | sed 's/^([^-]*)-([^-]*)-(.*)$/\3/'` - --host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` --host_cpu=`echo $host | sed 's/^([^-]*)-([^-]*)-(.*)$/\1/'` --host_vendor=`echo $host | sed 's/^([^-]*)-([^-]*)-(.*)$/\2/'` --host_os=`echo $host | sed 's/^([^-]*)-([^-]*)-(.*)$/\3/'` --echo "$ac_t""$host" 1>&6 - - --# 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:648: checking for $ac_word" >&5 --if eval "test "`echo '$''{'ac_cv_prog_CC'+set}'`" = set"; then -- echo $ac_n "(cached) $ac_c" 1>&6 -+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 -- 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_CC="${ac_tool_prefix}gcc" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ -+fi -+fi -+CC=$ac_cv_prog_CC -+if test -n "$CC"; then -+ echo "$as_me:$LINENO: result: $CC" >&5 -+echo "${ECHO_T}$CC" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+fi -+if test -z "$ac_cv_prog_CC"; then -+ ac_ct_CC=$CC -+ # Extract the first word of "gcc", so it can be a program name with args. -+set dummy gcc; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -n "$ac_ct_CC"; then -+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_ac_ct_CC="gcc" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ -+fi -+fi -+ac_ct_CC=$ac_cv_prog_ac_ct_CC -+if test -n "$ac_ct_CC"; then -+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -+echo "${ECHO_T}$ac_ct_CC" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+ CC=$ac_ct_CC -+else -+ CC="$ac_cv_prog_CC" -+fi -+ -+if test -z "$CC"; then -+ if test -n "$ac_tool_prefix"; then -+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -+set dummy ${ac_tool_prefix}cc; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_CC+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -n "$CC"; then -+ ac_cv_prog_CC="$CC" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_CC="${ac_tool_prefix}cc" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ - fi - fi --CC="$ac_cv_prog_CC" -+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 "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+fi -+if test -z "$ac_cv_prog_CC"; then -+ ac_ct_CC=$CC -+ # Extract the first word of "cc", so it can be a program name with args. -+set dummy cc; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -n "$ac_ct_CC"; then -+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_ac_ct_CC="cc" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ -+fi -+fi -+ac_ct_CC=$ac_cv_prog_ac_ct_CC -+if test -n "$ac_ct_CC"; then -+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -+echo "${ECHO_T}$ac_ct_CC" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+ CC=$ac_ct_CC - else -- echo "$ac_t""no" 1>&6 -+ CC="$ac_cv_prog_CC" - fi - -+fi - if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. - set dummy cc; ac_word=$2 --echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:678: 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then -+ ac_prog_rejected=yes -+ continue -+ fi -+ ac_cv_prog_CC="cc" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ - if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift -- if test $# -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:729: 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 -+ 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ - fi - fi --CC="$ac_cv_prog_CC" -+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 -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -n "$ac_ct_CC"; then -+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_ac_ct_CC="$ac_prog" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 - fi -- test -z "$CC" && { echo "configure: error: no acceptable cc found in $PATH" 1>&2; exit 1; } -+done -+done -+ -+fi -+fi -+ac_ct_CC=$ac_cv_prog_ac_ct_CC -+if test -n "$ac_ct_CC"; then -+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -+echo "${ECHO_T}$ac_ct_CC" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 - fi - --echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 --echo "configure:761: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 -+ test -n "$ac_ct_CC" && break -+done - --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 -+ CC=$ac_ct_CC -+fi - --cat > conftest.$ac_ext << EOF -+fi - --#line 772 "configure" --#include "confdefs.h" - --main(){return(0);} --EOF --if { (eval echo configure:777: "$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 -- else -- ac_cv_prog_cc_cross=yes -- fi -+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in $PATH -+See `config.log' for more details." >&5 -+echo "$as_me: error: no acceptable C compiler found in $PATH -+See `config.log' for more details." >&2;} -+ { (exit 1); exit 1; }; } -+ -+# Provide some information about the compiler. -+echo "$as_me:$LINENO:" \ -+ "checking for C compiler version" >&5 -+ac_compiler=`set X $ac_compile; echo $2` -+{ (eval echo "$as_me:$LINENO: "$ac_compiler --version </dev/null >&5"") >&5 -+ (eval $ac_compiler --version </dev/null >&5) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } -+{ (eval echo "$as_me:$LINENO: "$ac_compiler -v </dev/null >&5"") >&5 -+ (eval $ac_compiler -v </dev/null >&5) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } -+{ (eval echo "$as_me:$LINENO: "$ac_compiler -V </dev/null >&5"") >&5 -+ (eval $ac_compiler -V </dev/null >&5) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } -+ -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+ac_clean_files_save=$ac_clean_files -+ac_clean_files="$ac_clean_files a.out a.exe b.out" -+# Try to create an executable without -o first, disregard a.out. -+# It will help us diagnose broken compilers, and finding out an intuition -+# of exeext. -+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 -+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -+if { (eval echo "$as_me:$LINENO: "$ac_link_default"") >&5 -+ (eval $ac_link_default) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; then -+ # Find the output, starting from the most likely. This scheme is -+# not robust to junk in `.', hence go to wildcards (a.*) only as a last -+# resort. -+ -+# Be careful to initialize this variable, since it used to be cached. -+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -+ac_cv_exeext= -+# b.out is created by i960 compilers. -+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -+do -+ test -f "$ac_file" || continue -+ case $ac_file in -+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) -+ ;; -+ conftest.$ac_ext ) -+ # This is the source file. -+ ;; -+ [ab].out ) -+ # We found the default executable, but exeext='' is most -+ # certainly right. -+ break;; -+ *.* ) -+ ac_cv_exeext=`expr "$ac_file" : '[^.]*(..*)'` -+ # FIXME: I believe we export ac_cv_exeext for Libtool, -+ # but it would be cool to find out if it's true. Does anybody -+ # maintain Libtool? --akim. -+ export ac_cv_exeext -+ break;; -+ * ) -+ break;; -+ esac -+done - else -- echo "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 "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --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; } -+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -+See `config.log' for more details." >&5 -+echo "$as_me: error: C compiler cannot create executables -+See `config.log' for more details." >&2;} -+ { (exit 77); exit 77; }; } -+fi -+ -+ac_exeext=$ac_cv_exeext -+echo "$as_me:$LINENO: result: $ac_file" >&5 -+echo "${ECHO_T}$ac_file" >&6 -+ -+# Check the compiler produces executables we can run. If not, either -+# the compiler is broken, or we cross compile. -+echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -+# If not cross compiling, check that we can run a simple program. -+if test "$cross_compiling" != yes; then -+ if { ac_try='./$ac_file' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ cross_compiling=no -+ else -+ if test "$cross_compiling" = maybe; then -+ cross_compiling=yes -+ else -+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -+If you meant to cross compile, use `--host'. -+See `config.log' for more details." >&5 -+echo "$as_me: error: cannot run C compiled programs. -+If you meant to cross compile, use `--host'. -+See `config.log' for more details." >&2;} -+ { (exit 1); exit 1; }; } -+ fi -+ fi - fi --echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 --echo "configure:803: 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 "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 - --echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 --echo "configure:808: 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 -+rm -f a.out a.exe conftest$ac_cv_exeext b.out -+ac_clean_files=$ac_clean_files_save -+# Check the compiler produces executables we can run. If not, either -+# the compiler is broken, or we cross compile. -+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -+echo "$as_me:$LINENO: result: $cross_compiling" >&5 -+echo "${ECHO_T}$cross_compiling" >&6 -+ -+echo "$as_me:$LINENO: checking for suffix of executables" >&5 -+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -+if { (eval echo "$as_me:$LINENO: "$ac_link"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; then -+ # If both `conftest.exe' and `conftest' are `present' (well, observable) -+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -+# work properly (i.e., refer to `conftest.exe'), while it won't with -+# `rm'. -+for ac_file in conftest.exe conftest conftest.*; do -+ test -f "$ac_file" || continue -+ case $ac_file in -+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; -+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*(..*)'` -+ export ac_cv_exeext -+ break;; -+ * ) break;; -+ esac -+done - else -- cat > conftest.c <<EOF --#ifdef __GNUC__ -- yes; --#endif --EOF --if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:817: "$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 { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; then -+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do -+ case $ac_file in -+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; -+ *) ac_cv_objext=`expr "$ac_file" : '.*.(.*)'` -+ break;; -+ esac -+done - else -- ac_cv_prog_gcc=no --fi --fi -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --echo "$ac_t""$ac_cv_prog_gcc" 1>&6 -- --if test $ac_cv_prog_gcc = yes; then -- GCC=yes --else -- GCC= --fi -+{ { 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 - --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:836: 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 --else -- echo 'void f(){}' > conftest.c --if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_compiler_gnu=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_compiler_gnu=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ac_cv_c_compiler_gnu=$ac_compiler_gnu -+ -+fi -+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -+GCC=`test $ac_compiler_gnu = yes && echo yes` -+ac_test_CFLAGS=${CFLAGS+set} -+ac_save_CFLAGS=$CFLAGS -+CFLAGS="-g" -+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -+if test "${ac_cv_prog_cc_g+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes - else -- ac_cv_prog_cc_g=no --fi --rm -f conftest* -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_cv_prog_cc_g=no - fi -- --echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 - if test "$ac_test_CFLAGS" = set; then -- CFLAGS="$ac_save_CFLAGS" -+ CFLAGS=$ac_save_CFLAGS - elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" -@@ -860,1774 +2109,4838 @@ - CFLAGS="-O2" - else - CFLAGS= - fi - fi -+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -+if test "${ac_cv_prog_cc_stdc+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_cv_prog_cc_stdc=no -+ac_save_CC=$CC -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <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; -+} -+ -+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has -+ function prototypes and stuff, but not '\xHH' hex character constants. -+ These don't provoke an error unfortunately, instead are silently treated -+ as 'x'. The following induces an error, until -std1 is added to get -+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an -+ array size at least. It's necessary to write '\x00'==0 to get something -+ that's true only with -std1. */ -+int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -+ -+int test (int i, double x); -+struct s1 {int (*f) (int a);}; -+struct s2 {int (*f) (double a);}; -+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -+int argc; -+char **argv; -+int -+main () -+{ -+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; -+ ; -+ return 0; -+} -+_ACEOF -+# Don't try gcc -ansi; that turns off useful extensions and -+# breaks some systems' header files. -+# AIX -qlanglvl=ansi -+# Ultrix and OSF/1 -std1 -+# HP-UX 10.20 and later -Ae -+# HP-UX older versions -Aa -D_HPUX_SOURCE -+# SVR4 -Xc -D__EXTENSIONS__ -+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -+do -+ CC="$ac_save_CC $ac_arg" -+ rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_prog_cc_stdc=$ac_arg -+break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+fi -+rm -f conftest.err conftest.$ac_objext -+done -+rm -f conftest.$ac_ext conftest.$ac_objext -+CC=$ac_save_CC -+ -+fi -+ -+case "x$ac_cv_prog_cc_stdc" in -+ x|xno) -+ echo "$as_me:$LINENO: result: none needed" >&5 -+echo "${ECHO_T}none needed" >&6 ;; -+ *) -+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 -+ CC="$CC $ac_cv_prog_cc_stdc" ;; -+esac -+ -+# Some people use a C++ compiler to compile C. Since we use `exit', -+# in C++ we need to declare it. In case someone uses the same compiler -+# for both compiling C and C++ we need to have the C++ compiler decide -+# the declaration of exit, since it's the most demanding environment. -+cat >conftest.$ac_ext <<_ACEOF -+#ifndef __cplusplus -+ choke me -+#endif -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ for ac_declaration in \ -+ '' \ -+ 'extern "C" void std::exit (int) throw (); using std::exit;' \ -+ 'extern "C" void std::exit (int); using std::exit;' \ -+ 'extern "C" void exit (int) throw ();' \ -+ 'extern "C" void exit (int);' \ -+ 'void exit (int);' -+do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_declaration -+#include <stdlib.h> -+int -+main () -+{ -+exit (42); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ : -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+continue -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_declaration -+int -+main () -+{ -+exit (42); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+done -+rm -f conftest* -+if test -n "$ac_declaration"; then -+ echo '#ifdef __cplusplus' >>confdefs.h -+ echo $ac_declaration >>confdefs.h -+ echo '#endif' >>confdefs.h -+fi -+ -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu - - # Find a good install program. We prefer a C program (faster), - # so one script is as good as another. But avoid the broken or - # incompatible versions: - # SysV /etc/install, /usr/sbin/install - # SunOS /usr/etc/install - # IRIX /sbin/install - # AIX /bin/install -+# AmigaOS /C/install, which installs bootblocks on floppy discs - # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag - # AFS /usr/afsws/bin/install, which mishandles nonexistent args - # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -+# OS/2's system install, which has a completely different semantic - # ./install, which can be erroneously created by make from ./install.sh. --echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 --echo "configure:879: 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 -+if test "${ac_cv_path_install+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&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 -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ # Account for people who put trailing slashes in PATH elements. -+case $as_dir/ in -+ ./ | .// | /cC/* | \ -+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ -+ ?:\/os2\/install\/* | ?:\/OS2\/INSTALL\/* | \ -+ /usr/ucb/* ) ;; -+ *) -+ # OSF1 and SCO ODT 3.0 have their own names for install. -+ # Don't use installbsd from OSF since it installs stuff as root -+ # by default. -+ for ac_prog in ginstall scoinst install; do -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && -- grep dspmsg $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 -+ - - 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 - # break other packages using the cache if that directory is - # removed, or if the path is relative. -- INSTALL="$ac_install_sh" -+ 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' - --echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 --echo "configure:932: checking whether ln -s works" >&5 --if eval "test "`echo '$''{'ac_cv_prog_LN_S'+set}'`" = set"; then -- echo $ac_n "(cached) $ac_c" 1>&6 --else -- rm -f conftestdata --if ln -s X conftestdata 2>/dev/null --then -- rm -f conftestdata -- ac_cv_prog_LN_S="ln -s" -+echo "$as_me:$LINENO: checking whether ln -s works" >&5 -+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 -+LN_S=$as_ln_s -+if test "$LN_S" = "ln -s"; then -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 - else -- ac_cv_prog_LN_S=ln --fi --fi --LN_S="$ac_cv_prog_LN_S" --if test "$ac_cv_prog_LN_S" = "ln -s"; then -- echo "$ac_t""yes" 1>&6 --else -- echo "$ac_t""no" 1>&6 -+ echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -+echo "${ECHO_T}no, using $LN_S" >&6 - fi - - --echo $ac_n "checking "if the C compiler accepts -Wall"""... $ac_c" 1>&6 --echo "configure:954: checking "if the C compiler accepts -Wall"" >&5 -+echo "$as_me:$LINENO: checking if the C compiler accepts -Wall" >&5 -+echo $ECHO_N "checking if the C compiler accepts -Wall... $ECHO_C" >&6 - OLDCFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Wall" --cat > conftest.$ac_ext <<EOF --#line 958 "configure" --#include "confdefs.h" -- --int main() { -- --; return 0; } --EOF --if { (eval echo configure:965: "$ac_compile") 1>&5; (eval $ac_compile) 2>&5; }; then -- rm -rf conftest* -- echo "$ac_t""yes" 1>&6 --else -- echo "configure: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -- rm -rf conftest* -- -+ -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ 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 -+ -+ - CFLAGS="$OLDCFLAGS" -- echo "$ac_t""no" 1>&6 -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 - fi --rm -f conftest* -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - --echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 --echo "configure:979: checking how to run the C preprocessor" >&5 -+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 eval "test "`echo '$''{'ac_cv_prog_CPP'+set}'`" = set"; then -- echo $ac_n "(cached) $ac_c" 1>&6 -+ if test "${ac_cv_prog_CPP+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 - 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" -+ # 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. -- cat > conftest.$ac_ext <<EOF --#line 994 "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:1000: "$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 -- : -+ # not just through cpp. "Syntax error" is here to catch this case. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#ifdef __STDC__ -+# include <limits.h> -+#else -+# include <assert.h> -+#endif -+ Syntax error -+_ACEOF -+if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi - else -- 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 1011 "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:1017: "$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 -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then - : - 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 1028 "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:1034: "$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 -- : -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ # Broken: fails on valid input. -+continue -+fi -+rm -f conftest.err conftest.$ac_ext -+ -+ # OK, works on sane cases. Now check whether non-existent headers -+ # can be detected and how. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <ac_nonexistent.h> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi - else -- echo "$ac_err" >&5 -- echo "configure: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -- rm -rf conftest* -- CPP=/lib/cpp -+ ac_cpp_err=yes - fi --rm -f conftest* -+if test -z "$ac_cpp_err"; then -+ # Broken: success on invalid input. -+continue -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ # Passes both tests. -+ac_preproc_ok=: -+break - fi --rm -f conftest* -+rm -f conftest.err conftest.$ac_ext -+ -+done -+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -+rm -f conftest.err conftest.$ac_ext -+if $ac_preproc_ok; then -+ break - fi --rm -f conftest* -- ac_cv_prog_CPP="$CPP" -+ -+ done -+ ac_cv_prog_CPP=$CPP -+ -+fi -+ CPP=$ac_cv_prog_CPP -+else -+ ac_cv_prog_CPP=$CPP -+fi -+echo "$as_me:$LINENO: result: $CPP" >&5 -+echo "${ECHO_T}$CPP" >&6 -+ac_preproc_ok=false -+for ac_c_preproc_warn_flag in '' yes -+do -+ # Use a header file that comes with gcc, so configuring glibc -+ # with a fresh cross-compiler works. -+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since -+ # <limits.h> exists even on freestanding compilers. -+ # On the NeXT, cc -E runs the code through the compiler's parser, -+ # not just through cpp. "Syntax error" is here to catch this case. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#ifdef __STDC__ -+# include <limits.h> -+#else -+# include <assert.h> -+#endif -+ Syntax error -+_ACEOF -+if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ : -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ # Broken: fails on valid input. -+continue -+fi -+rm -f conftest.err conftest.$ac_ext -+ -+ # OK, works on sane cases. Now check whether non-existent headers -+ # can be detected and how. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <ac_nonexistent.h> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes - fi -- CPP="$ac_cv_prog_CPP" -+if test -z "$ac_cpp_err"; then -+ # Broken: success on invalid input. -+continue - else -- ac_cv_prog_CPP="$CPP" -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ # Passes both tests. -+ac_preproc_ok=: -+break - fi --echo "$ac_t""$CPP" 1>&6 -+rm -f conftest.err conftest.$ac_ext - --echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 --echo "configure:1059: 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 -+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 -- cat > conftest.$ac_ext <<EOF --#line 1064 "configure" --#include "confdefs.h" -+ { { echo "$as_me:$LINENO: error: C preprocessor "$CPP" fails sanity check -+See `config.log' for more details." >&5 -+echo "$as_me: error: C preprocessor "$CPP" fails sanity check -+See `config.log' for more details." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+ -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+ -+echo "$as_me:$LINENO: checking for egrep" >&5 -+echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -+if test "${ac_cv_prog_egrep+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1 -+ then ac_cv_prog_egrep='grep -E' -+ else ac_cv_prog_egrep='egrep' -+ fi -+fi -+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -+echo "${ECHO_T}$ac_cv_prog_egrep" >&6 -+ EGREP=$ac_cv_prog_egrep -+ -+ -+echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -+if test "${ac_cv_header_stdc+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include <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:1072: "$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 { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then - ac_cv_header_stdc=yes - else -- echo "$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 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 1089 "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* - - 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 1107 "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* - - 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 1128 "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)) -+#if ((' ' & 0x0FF) == 0x020) -+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -+#else -+# define ISLOWER(c) \ -+ (('a' <= (c) && (c) <= 'i') \ -+ || ('j' <= (c) && (c) <= 'r') \ -+ || ('s' <= (c) && (c) <= 'z')) -+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -+#endif -+ - #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) --int main () { int i; for (i = 0; i < 256; i++) --if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); --exit (0); } -- --EOF --if { (eval echo configure:1139: "$ac_link") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null --then -+int -+main () -+{ -+ int i; -+ for (i = 0; i < 256; i++) -+ if (XOR (islower (i), ISLOWER (i)) -+ || toupper (i) != TOUPPER (i)) -+ exit(2); -+ exit (0); -+} -+_ACEOF -+rm -f conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: "$ac_link"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then - : - else -- echo "configure: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -- rm -fr conftest* -- ac_cv_header_stdc=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_header_stdc=no - fi --rm -fr conftest* -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext - fi -- - fi - fi -- --echo "$ac_t""$ac_cv_header_stdc" 1>&6 -+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 <<\EOF -+ -+cat >>confdefs.h <<_ACEOF - #define STDC_HEADERS 1 --EOF -+_ACEOF - - fi - - --ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` --echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 --echo "configure:1165: checking for dlfcn.h" >&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 1170 "configure" --#include "confdefs.h" --#include <dlfcn.h> --EOF --ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:1175: "$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 -- : --else -- echo "$ac_t""no" 1>&6 --{ echo "configure: error: "dlfcn.h not found"" 1>&2; exit 1; } --fi -+# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - --ac_safe=`echo "sys/socket.h" | sed 'y%./+-%__p_%'` --echo $ac_n "checking for sys/socket.h""... $ac_c" 1>&6 --echo "configure:1200: checking for sys/socket.h" >&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 1205 "configure" --#include "confdefs.h" --#include <sys/socket.h> --EOF --ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:1210: "$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* -+ -+ -+ -+ -+ -+ -+ -+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ -+ inttypes.h stdint.h unistd.h -+do -+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -+echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test "${$as_ac_Header+set}" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+ -+#include <$ac_header> -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ eval "$as_ac_Header=yes" -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+eval "$as_ac_Header=no" -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+if test `eval echo '${'$as_ac_Header'}'` = yes; then -+ cat >>confdefs.h <<_ACEOF -+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ -+if test "${ac_cv_header_dlfcn_h+set}" = set; then -+ echo "$as_me:$LINENO: checking for dlfcn.h" >&5 -+echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 -+if test "${ac_cv_header_dlfcn_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+fi -+echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 -+echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 -+else -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 -+echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+#include <dlfcn.h> -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_header_compiler=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_header_compiler=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 -+ -+# Is the header present? -+echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 -+echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <dlfcn.h> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ ac_header_preproc=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_header_preproc=no -+fi -+rm -f conftest.err conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -+echo "${ECHO_T}$ac_header_preproc" >&6 -+ -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) -+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 -+echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) -+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 -+echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} -+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: section "Present But Cannot Be Compiled"" >&5 -+echo "$as_me: WARNING: dlfcn.h: section "Present But Cannot Be Compiled"" >&2;} -+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 -+echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<_ASBOX -+## ------------------------------------------ ## -+## Report this to the AC_PACKAGE_NAME lists. ## -+## ------------------------------------------ ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; -+esac -+echo "$as_me:$LINENO: checking for dlfcn.h" >&5 -+echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 -+if test "${ac_cv_header_dlfcn_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_cv_header_dlfcn_h=$ac_header_preproc -+fi -+echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 -+echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 -+ - fi --if eval "test "`echo '$ac_cv_header_'$ac_safe`" = yes"; then -- echo "$ac_t""yes" 1>&6 -+if test $ac_cv_header_dlfcn_h = yes; then - : - else -- echo "$ac_t""no" 1>&6 --{ echo "configure: error: "sys/socket.h not found"" 1>&2; exit 1; } -+ { { echo "$as_me:$LINENO: error: "dlfcn.h not found"" >&5 -+echo "$as_me: error: "dlfcn.h not found"" >&2;} -+ { (exit 1); exit 1; }; } - fi - - --ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'` --echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6 --echo "configure:1235: checking for arpa/inet.h" >&5 --if eval "test "`echo '$''{'ac_cv_header_$ac_safe'+set}'`" = set"; then -- echo $ac_n "(cached) $ac_c" 1>&6 -+ -+if test "${ac_cv_header_sys_socket_h+set}" = set; then -+ echo "$as_me:$LINENO: checking for sys/socket.h" >&5 -+echo $ECHO_N "checking for sys/socket.h... $ECHO_C" >&6 -+if test "${ac_cv_header_sys_socket_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+fi -+echo "$as_me:$LINENO: result: $ac_cv_header_sys_socket_h" >&5 -+echo "${ECHO_T}$ac_cv_header_sys_socket_h" >&6 -+else -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking sys/socket.h usability" >&5 -+echo $ECHO_N "checking sys/socket.h usability... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+#include <sys/socket.h> -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_header_compiler=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_header_compiler=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 -+ -+# Is the header present? -+echo "$as_me:$LINENO: checking sys/socket.h presence" >&5 -+echo $ECHO_N "checking sys/socket.h presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <sys/socket.h> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi - else -- cat > conftest.$ac_ext <<EOF --#line 1240 "configure" --#include "confdefs.h" --#include <arpa/inet.h> --EOF --ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:1245: "$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" -+ ac_cpp_err=yes - fi --rm -f conftest* -+if test -z "$ac_cpp_err"; then -+ ac_header_preproc=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_header_preproc=no -+fi -+rm -f conftest.err conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -+echo "${ECHO_T}$ac_header_preproc" >&6 -+ -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) -+ { echo "$as_me:$LINENO: WARNING: sys/socket.h: accepted by the compiler, rejected by the preprocessor!" >&5 -+echo "$as_me: WARNING: sys/socket.h: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/socket.h: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: sys/socket.h: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) -+ { echo "$as_me:$LINENO: WARNING: sys/socket.h: present but cannot be compiled" >&5 -+echo "$as_me: WARNING: sys/socket.h: present but cannot be compiled" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/socket.h: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: sys/socket.h: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/socket.h: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: sys/socket.h: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/socket.h: section "Present But Cannot Be Compiled"" >&5 -+echo "$as_me: WARNING: sys/socket.h: section "Present But Cannot Be Compiled"" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/socket.h: proceeding with the preprocessor's result" >&5 -+echo "$as_me: WARNING: sys/socket.h: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/socket.h: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: sys/socket.h: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<_ASBOX -+## ------------------------------------------ ## -+## Report this to the AC_PACKAGE_NAME lists. ## -+## ------------------------------------------ ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; -+esac -+echo "$as_me:$LINENO: checking for sys/socket.h" >&5 -+echo $ECHO_N "checking for sys/socket.h... $ECHO_C" >&6 -+if test "${ac_cv_header_sys_socket_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_cv_header_sys_socket_h=$ac_header_preproc - fi --if eval "test "`echo '$ac_cv_header_'$ac_safe`" = yes"; then -- echo "$ac_t""yes" 1>&6 -+echo "$as_me:$LINENO: result: $ac_cv_header_sys_socket_h" >&5 -+echo "${ECHO_T}$ac_cv_header_sys_socket_h" >&6 -+ -+fi -+if test $ac_cv_header_sys_socket_h = yes; then - : - else -- echo "$ac_t""no" 1>&6 --{ echo "configure: error: "arpa/inet.h not found"" 1>&2; exit 1; } -+ { { echo "$as_me:$LINENO: error: "sys/socket.h not found"" >&5 -+echo "$as_me: error: "sys/socket.h not found"" >&2;} -+ { (exit 1); exit 1; }; } - fi - - --ac_safe=`echo "fcntl.h" | sed 'y%./+-%__p_%'` --echo $ac_n "checking for fcntl.h""... $ac_c" 1>&6 --echo "configure:1270: checking for fcntl.h" >&5 --if eval "test "`echo '$''{'ac_cv_header_$ac_safe'+set}'`" = set"; then -- echo $ac_n "(cached) $ac_c" 1>&6 -+ -+if test "${ac_cv_header_arpa_inet_h+set}" = set; then -+ echo "$as_me:$LINENO: checking for arpa/inet.h" >&5 -+echo $ECHO_N "checking for arpa/inet.h... $ECHO_C" >&6 -+if test "${ac_cv_header_arpa_inet_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+fi -+echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5 -+echo "${ECHO_T}$ac_cv_header_arpa_inet_h" >&6 -+else -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking arpa/inet.h usability" >&5 -+echo $ECHO_N "checking arpa/inet.h usability... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+#include <arpa/inet.h> -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_header_compiler=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_header_compiler=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 -+ -+# Is the header present? -+echo "$as_me:$LINENO: checking arpa/inet.h presence" >&5 -+echo $ECHO_N "checking arpa/inet.h presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <arpa/inet.h> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi - else -- cat > conftest.$ac_ext <<EOF --#line 1275 "configure" --#include "confdefs.h" --#include <fcntl.h> --EOF --ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:1280: "$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" -+ ac_cpp_err=yes - fi --rm -f conftest* -+if test -z "$ac_cpp_err"; then -+ ac_header_preproc=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_header_preproc=no -+fi -+rm -f conftest.err conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -+echo "${ECHO_T}$ac_header_preproc" >&6 -+ -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) -+ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: accepted by the compiler, rejected by the preprocessor!" >&5 -+echo "$as_me: WARNING: arpa/inet.h: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: arpa/inet.h: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) -+ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: present but cannot be compiled" >&5 -+echo "$as_me: WARNING: arpa/inet.h: present but cannot be compiled" >&2;} -+ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: arpa/inet.h: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: arpa/inet.h: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: section "Present But Cannot Be Compiled"" >&5 -+echo "$as_me: WARNING: arpa/inet.h: section "Present But Cannot Be Compiled"" >&2;} -+ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: proceeding with the preprocessor's result" >&5 -+echo "$as_me: WARNING: arpa/inet.h: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: arpa/inet.h: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: arpa/inet.h: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<_ASBOX -+## ------------------------------------------ ## -+## Report this to the AC_PACKAGE_NAME lists. ## -+## ------------------------------------------ ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; -+esac -+echo "$as_me:$LINENO: checking for arpa/inet.h" >&5 -+echo $ECHO_N "checking for arpa/inet.h... $ECHO_C" >&6 -+if test "${ac_cv_header_arpa_inet_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_cv_header_arpa_inet_h=$ac_header_preproc - fi --if eval "test "`echo '$ac_cv_header_'$ac_safe`" = yes"; then -- echo "$ac_t""yes" 1>&6 -+echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5 -+echo "${ECHO_T}$ac_cv_header_arpa_inet_h" >&6 -+ -+fi -+if test $ac_cv_header_arpa_inet_h = yes; then - : - else -- echo "$ac_t""no" 1>&6 --{ echo "configure: error: "fcntl.h not found"" 1>&2; exit 1; } -+ { { echo "$as_me:$LINENO: error: "arpa/inet.h not found"" >&5 -+echo "$as_me: error: "arpa/inet.h not found"" >&2;} -+ { (exit 1); exit 1; }; } - fi - - --ac_safe=`echo "sys/poll.h" | sed 'y%./+-%__p_%'` --echo $ac_n "checking for sys/poll.h""... $ac_c" 1>&6 --echo "configure:1305: checking for sys/poll.h" >&5 --if eval "test "`echo '$''{'ac_cv_header_$ac_safe'+set}'`" = set"; then -- echo $ac_n "(cached) $ac_c" 1>&6 -+ -+if test "${ac_cv_header_fcntl_h+set}" = set; then -+ echo "$as_me:$LINENO: checking for fcntl.h" >&5 -+echo $ECHO_N "checking for fcntl.h... $ECHO_C" >&6 -+if test "${ac_cv_header_fcntl_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+fi -+echo "$as_me:$LINENO: result: $ac_cv_header_fcntl_h" >&5 -+echo "${ECHO_T}$ac_cv_header_fcntl_h" >&6 -+else -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking fcntl.h usability" >&5 -+echo $ECHO_N "checking fcntl.h usability... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+#include <fcntl.h> -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_header_compiler=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_header_compiler=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 -+ -+# Is the header present? -+echo "$as_me:$LINENO: checking fcntl.h presence" >&5 -+echo $ECHO_N "checking fcntl.h presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <fcntl.h> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi - else -- cat > conftest.$ac_ext <<EOF --#line 1310 "configure" --#include "confdefs.h" -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ ac_header_preproc=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_header_preproc=no -+fi -+rm -f conftest.err conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -+echo "${ECHO_T}$ac_header_preproc" >&6 -+ -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) -+ { echo "$as_me:$LINENO: WARNING: fcntl.h: accepted by the compiler, rejected by the preprocessor!" >&5 -+echo "$as_me: WARNING: fcntl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { echo "$as_me:$LINENO: WARNING: fcntl.h: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: fcntl.h: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) -+ { echo "$as_me:$LINENO: WARNING: fcntl.h: present but cannot be compiled" >&5 -+echo "$as_me: WARNING: fcntl.h: present but cannot be compiled" >&2;} -+ { echo "$as_me:$LINENO: WARNING: fcntl.h: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: fcntl.h: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: fcntl.h: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: fcntl.h: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: fcntl.h: section "Present But Cannot Be Compiled"" >&5 -+echo "$as_me: WARNING: fcntl.h: section "Present But Cannot Be Compiled"" >&2;} -+ { echo "$as_me:$LINENO: WARNING: fcntl.h: proceeding with the preprocessor's result" >&5 -+echo "$as_me: WARNING: fcntl.h: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: fcntl.h: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: fcntl.h: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<_ASBOX -+## ------------------------------------------ ## -+## Report this to the AC_PACKAGE_NAME lists. ## -+## ------------------------------------------ ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; -+esac -+echo "$as_me:$LINENO: checking for fcntl.h" >&5 -+echo $ECHO_N "checking for fcntl.h... $ECHO_C" >&6 -+if test "${ac_cv_header_fcntl_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_cv_header_fcntl_h=$ac_header_preproc -+fi -+echo "$as_me:$LINENO: result: $ac_cv_header_fcntl_h" >&5 -+echo "${ECHO_T}$ac_cv_header_fcntl_h" >&6 -+ -+fi -+if test $ac_cv_header_fcntl_h = yes; then -+ : -+else -+ { { echo "$as_me:$LINENO: error: "fcntl.h not found"" >&5 -+echo "$as_me: error: "fcntl.h not found"" >&2;} -+ { (exit 1); exit 1; }; } -+fi -+ -+ -+ -+if test "${ac_cv_header_sys_poll_h+set}" = set; then -+ echo "$as_me:$LINENO: checking for sys/poll.h" >&5 -+echo $ECHO_N "checking for sys/poll.h... $ECHO_C" >&6 -+if test "${ac_cv_header_sys_poll_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+fi -+echo "$as_me:$LINENO: result: $ac_cv_header_sys_poll_h" >&5 -+echo "${ECHO_T}$ac_cv_header_sys_poll_h" >&6 -+else -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking sys/poll.h usability" >&5 -+echo $ECHO_N "checking sys/poll.h usability... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+#include <sys/poll.h> -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_header_compiler=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_header_compiler=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 -+ -+# Is the header present? -+echo "$as_me:$LINENO: checking sys/poll.h presence" >&5 -+echo $ECHO_N "checking sys/poll.h presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include <sys/poll.h> --EOF --ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:1315: "$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" -+_ACEOF -+if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes - fi --rm -f conftest* -+if test -z "$ac_cpp_err"; then -+ ac_header_preproc=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_header_preproc=no -+fi -+rm -f conftest.err conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -+echo "${ECHO_T}$ac_header_preproc" >&6 -+ -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) -+ { echo "$as_me:$LINENO: WARNING: sys/poll.h: accepted by the compiler, rejected by the preprocessor!" >&5 -+echo "$as_me: WARNING: sys/poll.h: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/poll.h: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: sys/poll.h: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) -+ { echo "$as_me:$LINENO: WARNING: sys/poll.h: present but cannot be compiled" >&5 -+echo "$as_me: WARNING: sys/poll.h: present but cannot be compiled" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/poll.h: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: sys/poll.h: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/poll.h: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: sys/poll.h: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/poll.h: section "Present But Cannot Be Compiled"" >&5 -+echo "$as_me: WARNING: sys/poll.h: section "Present But Cannot Be Compiled"" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/poll.h: proceeding with the preprocessor's result" >&5 -+echo "$as_me: WARNING: sys/poll.h: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/poll.h: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: sys/poll.h: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<_ASBOX -+## ------------------------------------------ ## -+## Report this to the AC_PACKAGE_NAME lists. ## -+## ------------------------------------------ ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; -+esac -+echo "$as_me:$LINENO: checking for sys/poll.h" >&5 -+echo $ECHO_N "checking for sys/poll.h... $ECHO_C" >&6 -+if test "${ac_cv_header_sys_poll_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_cv_header_sys_poll_h=$ac_header_preproc -+fi -+echo "$as_me:$LINENO: result: $ac_cv_header_sys_poll_h" >&5 -+echo "${ECHO_T}$ac_cv_header_sys_poll_h" >&6 -+ - fi --if eval "test "`echo '$ac_cv_header_'$ac_safe`" = yes"; then -- echo "$ac_t""yes" 1>&6 -+if test $ac_cv_header_sys_poll_h = yes; then - : - else -- echo "$ac_t""no" 1>&6 --{ echo "configure: error: "sys/poll.h not found"" 1>&2; exit 1; } -+ { { echo "$as_me:$LINENO: error: "sys/poll.h not found"" >&5 -+echo "$as_me: error: "sys/poll.h not found"" >&2;} -+ { (exit 1); exit 1; }; } -+fi -+ -+ -+ -+if test "${ac_cv_header_sys_mman_h+set}" = set; then -+ echo "$as_me:$LINENO: checking for sys/mman.h" >&5 -+echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6 -+if test "${ac_cv_header_sys_mman_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+fi -+echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5 -+echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6 -+else -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking sys/mman.h usability" >&5 -+echo $ECHO_N "checking sys/mman.h usability... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+#include <sys/mman.h> -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_header_compiler=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_header_compiler=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 -+ -+# Is the header present? -+echo "$as_me:$LINENO: checking sys/mman.h presence" >&5 -+echo $ECHO_N "checking sys/mman.h presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <sys/mman.h> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes - fi -+if test -z "$ac_cpp_err"; then -+ ac_header_preproc=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ ac_header_preproc=no -+fi -+rm -f conftest.err conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -+echo "${ECHO_T}$ac_header_preproc" >&6 -+ -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) -+ { echo "$as_me:$LINENO: WARNING: sys/mman.h: accepted by the compiler, rejected by the preprocessor!" >&5 -+echo "$as_me: WARNING: sys/mman.h: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/mman.h: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: sys/mman.h: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) -+ { echo "$as_me:$LINENO: WARNING: sys/mman.h: present but cannot be compiled" >&5 -+echo "$as_me: WARNING: sys/mman.h: present but cannot be compiled" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/mman.h: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: sys/mman.h: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/mman.h: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: sys/mman.h: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/mman.h: section "Present But Cannot Be Compiled"" >&5 -+echo "$as_me: WARNING: sys/mman.h: section "Present But Cannot Be Compiled"" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/mman.h: proceeding with the preprocessor's result" >&5 -+echo "$as_me: WARNING: sys/mman.h: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: sys/mman.h: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: sys/mman.h: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<_ASBOX -+## ------------------------------------------ ## -+## Report this to the AC_PACKAGE_NAME lists. ## -+## ------------------------------------------ ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; -+esac -+echo "$as_me:$LINENO: checking for sys/mman.h" >&5 -+echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6 -+if test "${ac_cv_header_sys_mman_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_cv_header_sys_mman_h=$ac_header_preproc -+fi -+echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5 -+echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6 - --for ac_hdr in unistd.h --do --ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` --echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 --echo "configure:1342: 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 1347 "configure" --#include "confdefs.h" --#include <$ac_hdr> --EOF --ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:1352: "$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* -+if test $ac_cv_header_sys_mman_h = yes; then -+ : -+else -+ { { echo "$as_me:$LINENO: error: "sys/mman.h not found"" >&5 -+echo "$as_me: error: "sys/mman.h not found"" >&2;} -+ { (exit 1); exit 1; }; } -+fi -+ -+ -+ -+ -+for ac_header in unistd.h -+do -+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -+if eval "test "${$as_ac_Header+set}" = set"; then -+ echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test "${$as_ac_Header+set}" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+else -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking $ac_header usability" >&5 -+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+#include <$ac_header> -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_header_compiler=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_header_compiler=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 -+ -+# Is the header present? -+echo "$as_me:$LINENO: checking $ac_header presence" >&5 -+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <$ac_header> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: "$ac_cpp conftest.$ac_ext"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes - fi --if 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
tor-commits@lists.torproject.org