From: Sven Hoexter Date: Mon, 17 Jan 2011 15:46:33 +0000 (+0100) Subject: Imported Upstream version 7.19.6 X-Git-Tag: upstream/7.19.6^0 X-Git-Url: https://git.sven.stormbind.net/?a=commitdiff_plain;h=b0e6fb6e4379fb87fa2854b84a56c5ad49c644da;p=sven%2Ftclcurl.git Imported Upstream version 7.19.6 --- diff --git a/Cambios TclCurl.txt b/Cambios TclCurl.txt new file mode 100755 index 0000000..fcc3882 --- /dev/null +++ b/Cambios TclCurl.txt @@ -0,0 +1,148 @@ +- All the quote options (CURLOPT_QUOTE, CURLOPT_POSTQUOTE and + CURLOPT_PREQUOTE) now accept a preceeding asterisk before the command to + send when using FTP, as a sign that libcurl shall simply ignore the response + from the server instead of treating it as an error. Not treating a 400+ FTP + response code as an error means that failed commands will not abort the + chain of commands, nor will they cause the connection to get disconnected. + +SOLO DOCS + +- Added CURLOPT_SSH_KNOWNHOSTS, CURLOPT_SSH_KEYFUNCTION, CURLOPT_SSH_KEYDATA. + They introduce known_host support for SSH keys to libcurl. See docs for + details. Note that this feature depends on a new enough libssh2 version, to + be supported in libssh2 1.2 and later (or current git repo at this time). + +HECHO + +- David Kierznowski notified us about a security flaw + (http://curl.haxx.se/docs/adv_20090303.html also known as CVE-2009-0037) in + which previous libcurl versions (by design) can be tricked to access an + arbitrary local/different file instead of a remote one when + CURLOPT_FOLLOWLOCATION is enabled. This flaw is now fixed in this release + together this the addition of two new setopt options for controlling this + new behavior: + + o CURLOPT_REDIR_PROTOCOLS controls what protocols libcurl is allowed to + follow to when CURLOPT_FOLLOWLOCATION is enabled. By default, this option + excludes the FILE and SCP protocols and thus you nee to explicitly allow + them in your app if you really want that behavior. + + o CURLOPT_PROTOCOLS controls what protocol(s) libcurl is allowed to fetch + using the primary URL option. This is useful if you want to allow a user or + other outsiders control what URL to pass to libcurl and yet not allow all + protocols libcurl may have been built to support. + +HECHO + +- After a bug reported by James Cheng I've made curl_easy_getinfo() for + CURLINFO_CONTENT_LENGTH_DOWNLOAD and CURLINFO_CONTENT_LENGTH_UPLOAD return + -1 if the sizes aren't know. Previously these returned 0, make it impossible + to detect the difference between actually zero and unknown. + +SOLO DOC + +- FTP downloads (i.e.: RETR) ending with code 550 now return error + CURLE_REMOTE_FILE_NOT_FOUND instead of CURLE_FTP_COULDNT_RETR_FILE. + +SOLO DOC + +- CURLOPT_FTP_CREATE_MISSING_DIRS can now be set to 2 in addition to 1 for + plain FTP connections, and it will then allow MKD to fail once and retry the + CWD afterwards. This is especially useful if you're doing many simultanoes + connections against the same server and they all have this option enabled, + as then CWD may first fail but then another connection does MKD before this + connection and thus MKD fails but trying CWD works! The numbers can + (should?) now be set with the convenience enums now called + CURLFTP_CREATE_DIR and CURLFTP_CREATE_DIR_RETRY. + + Tests has proven that if you're making an application that uploads a set of + files to an ftp server, you will get a noticable gain in speed if you're + using multiple connections and this option will be then be very useful. + +SOLO DOC + +- CURLINFO_CONDITION_UNMET was added to allow an application to get to know if + the condition in the previous request was unmet. This is typically a time + condition set with CURLOPT_TIMECONDITION and was previously not possible to + reliably figure out. From bug report #2565128 + (http://curl.haxx.se/bug/view.cgi?id=2565128) filed by Jocelyn Jaubert. + +HECHO + +- Markus Moeller introduced tw onew options to libcurl: + CURLOPT_SOCKS5_GSSAPI_SERVICE and CURLOPT_SOCKS5_GSSAPI_NEC to allow libcurl + to do GSS-style authentication with SOCKS5 proxies. The curl tool got the + options called --socks5-gssapi-service and --socks5-gssapi-nec to enable + these. + +HECHO + +- Chad Monroe provided the new CURLOPT_TFTP_BLKSIZE option that allows an app + to set desired block size to use for TFTP transfers instead of the default + 512 bytes. + +HECHO + +- Internet Explorer had a broken HTTP digest authentication before v7 and + there are servers "out there" that relies on the client doing this broken + Digest authentication. Apache even comes with an option to work with such + broken clients. + + The difference is only for URLs that contain a query-part (a '?'-letter and + text to the right of it). + + libcurl now supports this quirk, and you enable it by setting the + CURLAUTH_DIGEST_IE bit in the bitmask you pass to the CURLOPT_HTTPAUTH or + CURLOPT_PROXYAUTH options. They are thus individually controlled to server + and proxy. + +HECHO + +- Igor Novoseltsev added CURLOPT_PROXYUSER and CURLOPT_PROXYPASSWORD that then + make CURLOPT_PROXYUSERPWD sort of deprecated. The primary motive for adding + these new options is that they have no problems with the colon separator + that the CURLOPT_PROXYUSERPWD option does. + +HECHO + +- Igor Novoseltsev brought a patch that introduced two new options to + curl_easy_setopt: CURLOPT_USERNAME and CURLOPT_PASSWORD that sort of + deprecates the good old CURLOPT_USERPWD since they allow applications to set + the user name and password independently and perhaps more importantly allow + both to contain colon(s) which CURLOPT_USERPWD doesn't fully support. + +HECHO + +- The libcurl FTP code now returns CURLE_REMOTE_FILE_NOT_FOUND error when SIZE + gets a 550 response back for the cases where a download (or NOBODY) is + wanted. It still allows a 550 as response if the SIZE is used as part of an + upload process (like if resuming an upload is requested and the file isn't + there before the upload). I also modified the FTP test server and a few test + cases accordingly to match this modified behavior. + +NADA + +- Martin Drasar provided the CURLOPT_POSTREDIR patch. It renames + CURLOPT_POST301 (but adds a define for backwards compatibility for you who + don't define CURL_NO_OLDIES). This option allows you to now also change the + libcurl behavior for a HTTP response 302 after a POST to not use GET in the + subsequent request (when CURLOPT_FOLLOWLOCATION is enabled). I edited the + patch somewhat before commit. The curl tool got a matching --post302 + option. Test case 1076 was added to verify this. + +HECHO + +- Introducing CURLOPT_CERTINFO and the corresponding CURLINFO_CERTINFO. By + enabling this feature with CURLOPT_CERTINFO for a request using SSL (HTTPS + or FTPS), libcurl will gather lots of server certificate info and that info + can then get extracted by a client after the request has completed with + curl_easy_getinfo()'s CURLINFO_CERTINFO option. Linus Nielsen Feltzing + helped me test and smoothen out this feature. + + Unfortunately, this feature currently only works with libcurl built to use + OpenSSL. + + This feature was sponsored by networking4all.com - thanks! + +HECHO + diff --git a/ChangeLog.txt b/ChangeLog.txt new file mode 100755 index 0000000..a27e459 --- /dev/null +++ b/ChangeLog.txt @@ -0,0 +1,1161 @@ +2009-09-25 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_POSTREDIR + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLAUTH_DIGEST_IE + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_TFTP_BLKSIZE + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_SOCKS5_GSSAPI_SERVICE and + CURLOPT_SOCKS5_GSSAPI_NEC + +2009-09-23 Andres Garcia + + * configure.in, + makefile.in: Updated to TEA 3.7 + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_CERTINFO and CURLINFO_CERTINFO. + +2008-09-08 Andres Garcia + + * Release version 7.19.0 + +2008-09-07 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_ADDRESS_SCOPE + +2008-08-31 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c, + generic/multi.h, + generic/multi.c: Had to add a lot of 'CONST's to prevent + warnings when compiling with Tcl 8.5.4, pretty much the same + I had to remove because of 8.5.3. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLINFO_PRIMARY_IP and + CURLINFO_APPCONNECT_TIME + +2008-08-25 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c, + tests/getInfo.tcl: Added support for CURLINFO_REDIRECT_URL. + +2008-08-25 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Changed the 'anyauth rewind' to use the new + CURLOPT_SEEKFUNCTION and CURLOPT_SEEKDATA. + +2008-08-24 Andres Garcia + + * generic/tclcurl.h: Fixed the writeproc option. + +2008-08-23 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c, + tests/progressProcPause.tcl: Added commands 'pause' and 'resume'. + +2008-08-19 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLPROXY_SOCKS4A and + CURLPROXY_SOCKS5_HOSTNAME. + +2008-08-19 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c, + generic/multi.h, + generic/multi.c: I had to remove a lot of 'CONST's from the code + to prevent warnings when compiling against Tcl 8.5.3. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_PROXY_TRANSFER_MODE. + +2007-11-01 Andres Garcia + + * Release version 7.17.1 + +2007-10-25 Andres Garcia + + * generic/tclcurl.h + generic/tclcurl.c: Compensated for the options which changed names. + + * generic/tclcurl.h + generic/tclcurl.c: Added support for CURLOPT_POST301 and + CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 + + * generic/tclcurl.c: Use CURLOPT_COPYPOSTFIELDS instead of + CURLOPT_POSTFIELDS. + +2007-10-24 Andres Garcia + + * generic/tclcurl.h + generic/tclcurl.c: Took advantage of libcurl remembering options + passed as strings. + +2007-07-19 Andres Garcia + + * Release version 7.16.4 + +2007-07-16 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Change krb4level to krblevel. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_NEW_FILE_PERMS and + CURLOPT_NEW_DIRECTORY_PERMS. + +2007-07-07 Andres Garcia + + * generic/multi.h, + generic/multi.c: Added support for the CURLMOPT_MAXCONNECTS option. + +2007-05-22 Sven Hoexter + + * doc/tclcurl.n: Fixed a couple of errors in the man page. + +2007-04-16 Andres Garcia + + * Release version 7.16.2 + +2007-04-13 Andres Garcia + + * generic/tclcurl.c: When saving the headers into an array, TclCurl + would only keep the last 'Set-Cookie' header. + +2007-04-12 Andres Garcia + + * configure.in, + Makefile.in: Updated the configure scripts to TEA 3.6 + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for the new SSH options. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_TIMEOUT_MS and + CURLOPT_CONNECTTIMEOUT_MS. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_HTTP_CONTENT_DECODING and + CURLOPT_HTTP_TRANSFER_DECODING. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_FTP_SSL_CCC. + + * generic/tclcurl.c: Added 'CONV' to the list 'curl::versioninfo' may return. + +2007-03-16 Andres Garcia + + * generic/tclcurl.c: Fixed a crash when changing a handle from using + 'writeproc' to not using one. + +2006-11-15 Andres Garcia + + * Release version 7.16.0 + +2006-11-11 Andres Garcia + + * generic/tclcurl.c: Use the new curl_easy_escape and + curl_easy_unescape. + +2006-11-07 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c, + generic/multi.h, + generic/multi.c: Added support for CURLMOPT_PIPELINING. + +2006-11-05 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Removed support for third party ftp transfers. + +2006-10-22 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_FTP_ALTERNATIVE_TO_USER. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_MAX_SEND_SPEED_LARGE and + CURLOPT_MAX_RECV_SPEED_LARGE. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLINFO_FTP_ENTRY_PATH + +2006-10-22 Andres Garcia + + * configure.in: Changed the code to check the installed version of + libcurl to use 'curl-config --checkfor' + +2006-10-14 Andres Garcia + + * generic/tclcurl.c: Prevented a few warnings about casts to + and from pointers. + +2006-04-17 Andres Garcia + + * Release version 0.15.3 + +2006-04-16 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLPROXY_SOCKS4. + +2006-04-15 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_LOCALPORT, + and CURLOPT_LOCALPORTRANGE. + +2006-04-13 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Prevented a few compiler warnings. + +2006-04-12 Andres Garcia + + * configure.in, + Makefile.in, + pkIndex.tcl, + tclconfig/: Updated the TEA scripts to version 3.5. + +2006-01-10 Andres Garcia + + * Release version 0.15.1 + +2006-01-09 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_FTP_FILEMETHOD. + +2006-01-07 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_FTP_SKIP_PASV_IP. + +2005-12-28 Andres Garcia + + * packages/Windows/tclcurl.mk: Fixed the doc directory. + +2005-09-04 Andres Garcia + + * Relase version 0.14.1 + +2005-09-03 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c, + tests/getInfo.tcl: Added support for CURLOPT_COOKIELIST and + CURLINFO_COOKIELIST. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_IGNORE_CONTENT_LENGTH. + + * generic/tclcurl.h, + generic/tclcurl.c. + tests/httpPost.tcl: Added support for CURLFORM_FILECONTENT. + + * generic/tclcurl.h, + generic/tclcurl.c: Fixed memory leaks during http posts. + +2005-06-02 Andres Garcia + + * Release version 0.14.0 + +2005-06-02 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Updated the way 'sslversion' works. + +2005-06-02 Andres Garcia + + * configure.in, + Makefile.in: Updated the scripts to the latest version of TEA + +2005-05-10 Andres Garcia + + * generic/tclcurl.c: Fixed the options 'httpauth', 'proxyauth', + 'ipresolve', 'ftpssl' and 'ftpsslauth' + +2005-04-19 Andres Garcia + + * Released version 0.13.2 + +2005-04-19 Andres Garcia + + * Makefile.in: Daniel A. Steffen's fix for parallel builds. + +2005-04-16 Andres Garcia + + * include/tclcurl.h: Fixed the msys-mingw build. + +2005-04-12 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: When the user chooses the 'any' auth method, + TclCurl will silently use CURLOPT_IOCTLFUNCTION and + CURLOPT_IOCTLDATA in case libcurl needs to 'rewind' the data. + +2005-04-08 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support SSPI in curl::versioninfo. + +2005-04-07 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support fot CURLOPT_FTP_ACCOUNT. + +2005-04-06 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c, + tests/ftp3party.tcl: Removed suppport for the obsolete options + "-sourcehost", "-sourcepath", "-sourceport", "-pasvhost" and + added support for the new third party ftp options "-sourceurl" + and "-sourcequote". + + * generic/tclcurl.h: Fixed the "-sourcepostquote" option. + +2005-04-05 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c, + tests/getInfo.tcl: Added support for CURLINFO_NUM_CONNECTS, + CURLINFO_SSL_ENGINES and CURLINFO_HTTP_CONNECTCODE. + +2004-10-18 Andres Garcia + + * Released version 0.12.2 + +2004-10-08 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Support for the share interface in threads. + +2004-10-07 Andres Garcia + + * generic/tclcurl.c: Fixed the 'cookiejar' option. + +2004-10-06 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c, + tests/strerror.tcl: Added the 'curl::easystrerror', 'curl::sharestrerror' + and 'curl::multistrerror' commands. + +2004-10-04 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_FTPSSLAUTH. + +2004-09-30 Andres Garcia + + * Released version 0.12.1 + +2004-09-29 Andres Garcia + + * generic/multi.c: Used Tcl_SetMaxBlockTime to improve automatic + transfers. + + * tests/ftpUpload: Added an example of ftp upload including commands + to the server. + + * generic/tclcurl.h, + generic/tclcurl.c, + tests/ftp3party.tcl: Added support for third party ftp transfers. + +2004-09-28 Andres Garcia + + * generic/tclcurl.c: Fixed the 'autoreferer' option. + +2004-08-13 Andres Garcia + + * tests/debugProc.tcl: Added the ssl data types. + +2004-08-13 Andres Garcia + + * generic/tclcurl.c: Use CURL_READFUNC_ABORT to abort uploads. + +2004-08-13 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added 'reset' to the easy interface commands. + +2004-08-12 Andres Garcia + + * generic/multi.h, + generic/multi.c: Hooked the multi interface to Tcl's event loop, + doesn't work that well so far. + + +2004-07-09 Andres Garcia + + * Released version 0.12.0 + +2004-07-05 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added incomplete support for the share + interface. + +2004-07-02 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_PORT, + CURLOPT_TCP_NODELAY, CURLOPT_AUTOREFERER. + + * generic/tclcurl.h: Added 'IDN' to the features reported by + 'curl::versioninfo'. + +2004-04-30 Andres Garcia + + * packages/windows/tclcurl.mk: Uses new curl compilation. + +2004-04-06 Andres Garcia + + * generic/tclcurl.c: Fixed ftps support. + +2004-02-04 Andres Garcia + + * Released version 0.11.0 + +2004-01-15 Andres Garcia + + * ReadMeW32.txt: Updated instructions to compile openssl. + +2004-01-08 Andres Garcia + + * generic/tclcurl.c, + generic/tclcurl.h: Added support for CURLOP_FTP_SSL. + +2004-01-02 Andres Garcia + + * generic/tclcurl.c: Fixed the 'netrc' option. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_NETRC_FILE. + + +2003-12-29 Andres Garcia + + * Released version 0.10.8 + +2003-12-19 Andres Garcia + + * generic/tclcurl.h: TclCurl still thought it was in version + 0.10.4. + +2003-12-18 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLINFO_HTTPAUTH_AVAIL. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLINFO_PROXYAUTH_AVAIL. + + * generic/tclcurl.c: 'curl::versioninfo' will now say if there + is support for asynchronus DNS and SPNEGO. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_IPRESOLVE. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_MAXFILESIZE. + +2003-12-18 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Fixed the 'httpauth' option. + +2003-11-11 Andres Garcia + + * autoconf.in: The configure scripts would sometimes use the + cURL in '/usr/bin' instead of the one in '/usr/local/bin' + despite the '--with-curlprefix' tag. + +2003-11-04 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLINFO_RESPONSE_CODE. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_FPT_RESPONSE_TIMEOUT. + + +2003-09-03 Andres Garcia + + * Release TclCurl 0.10.7 + +2003-09-03 Andres Garcia + + * configure.in: Changed because of the new version string used by + cURL. + +2003-08-17 Andres Garcia + + * generic/tclcurl.tcl, + generic/tclcurl.c, + generic/tclcurl.h: Some work on hooking the multi interface + to Tcl's event loop, it isn't even close to working though. + +2003-08-14 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURL_FTP_CREATE_MISSING_DIRS. + +2003-08-04 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_HTTPAUTH. + +2003-07-31 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added 'command' option to 'configure' + to execute a Tcl command after the transfer is done. So + far it only works in blocking transfer which is pretty + much useless. + +2003-05-22 Andres Garcia + + * Release TclCurl 0.10.5 + + +2003-05-20 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_FTP_USE_EPTR. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for 'all' in the 'encoding' + option. + + * generic/tclcurl.c: Changed the way the http header is dealt + with in the 'headervar' option. + + +2003-05-13 Andres Garcia + + * generic/tclcurl.c: The 'progressproc' option would crash in + windows machines. + + * packages/windows/tclcurl.mk: Changed for OpenSSL 0.9.7b. + + * ReadMeW32.txt: New instructions on how to compile OpenSSL 0.9.7b. + + +2003-05-12 Andres Garcia + + * generic/multi.c: The multihandles couldn't store the data of more + than two easy handles. + + * generic/multi.c: The '$multiHandle active' command wasn't returning + anything. + + +2003-04-07 Andres Garcia + + * Release TclCurl 0.10.4 + +2003-04-04 Andres Garcia + + * generic/tclcurl.tcl: If there is an error, the 'curl::transfer' + command will now return the code of the error, without the + 'Couldn't perform transfer' message. + +2003-03-24 Andres Garcia + + * ReadMeW32.txt: Updated build instructions for Windows. + + * Makefile.in: Added an 'uninstall' target to the make file. + +2003-03-18 Andres Garcia + + * generic/tclcurl.tcl: Added 'getinfo' features to 'curl::transfer'. + +2003-02-20 Andres Garcia + + * packages/windows/tclcurl.mk: A make file to create all the Windows + packages. + + * packages/windows/SetUp.tcl: The setup script for TclCurl in Windows. + + * packages/rpm/tclcurl.spec: The spec file to create the rpm package. + +2003-02-04 Andres Garcia + + * configure.in: It will no longer choke with the version + string of cURL's prereleases. + +2003-02-03 Andres Garcia + + * tclconfig: Updated to the TEA2 scripts in the CVS. + + * generic/tclcurl.tcl: Alex Khassin suggested using fully qualified + names to prevent problems with namespaces. + + +2003-01-30 Andres Garcia + + * Release TclCurl 0.10.3 + +2003-01-29 Andres Garcia + + * generic/multi.c: if 'curl_multi_perform' returns '-1' it will be + invoked again to read all data in the queue. + +2003-01-28 Andres Garcia + + * generic/tclcurl.c: Changed the source to use the new constant names + CURLOPT_WRITEDATA, CURLOPT_READDATA and CURLOPT_HEADERDATA. + + * generic/tclcurl.c: When using '-headervar' in Windows you could end + up with carriage returns in the name of the header. + +2003-01-27 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_HTTP200ALIASES. + +2003-01-25 Andres Garcia + + * generic/tclcurl.c, + generic/multi.c: Applied Albert Chin-A-Young patch to change C++ style + comments to C style. + + * configure.in: If 'curl' is in '/usr/bin/' or '/usr/local/bin' it will no + longer be necessary to use '--with-curlprefix' in Windows. + +2003-01-24 Andres Garcia + + * configure.in: If you want to compile TclCurl with ssl support in Windows, + you can now use the '--enable-ssl' option. + +2003-01-08 Andres Garcia + + * generic/tclcurl.c: No more crashes when using TclCurl in a threads enabled + Tcl. + + +2002-10-14 Andres Garcia + + * Release version 0.10.1 + +2002-10-13 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for 'CURLOPT_PROXYTYPE'. + + * doc/tclcurl.n, + doc/tclcurl.html, + doc/tclcurl_multi.n, + doc/tclcurl_multi.html: Updated docs. + + * configure.in: Updated version. + + * generic/tclcurl.c: Started using 'curl_free' to free memory + allocated by 'curl_escape' and 'curl_unescape'. + + * tests/escape.tcl: Added an example for 'curl::escape' and + 'curl::unescape' + + +2002-10-12 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Created the 'curl::versioninfo' command + to support 'curl_version_info'. + + +2002-10-11 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for 'CURLOPT_ENCODING', it + can either be 'identity' or 'deflated'. + + +2002-10-10 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c, + tests/bufferSize.tcl: Added support for CURLOPT_BUFFERSIZE. + + * tests/writeProc.tcl: Added a message to the write callback, so + that the difference with bufferSize.tcl can be noticed. + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLOPT_NOSIGNAL. + + + * generic/tclcurl.tcl, + tests/curlConfig.tcl: Added support for the '-ca' option for + the 'curl::curlConfig' command. + + +2002-10-06 Andres Garcia + + * generic/multi.h, + generic/multi.c, + tests/multi/single.tcl, + tests/multi/double.tcl: The multi interface tests should now work + as expected. + + +2002-10-03: Andres Garcia + + * configure.in, + Makefile.in: Asif Haswarey reported that '--with-curlinclude' did not + work and that the 'pkgIndex.tcl' generated would not do in Solaris. + + +2002-10-01 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c, + generic/multi.h, + generic/multi.c: Added a bunch of CONSTs to prevent warnings when + compiling with Tcl/Tk 8.4. + + +2002-09-29 Andres Garcia + + * tests/progressProc.tcl: It will skip all that useless decimals now. + + * generic/tclcurl.h, + generic/tclcurl.c: The buffer option to post data would not work. + + +2002-09-26 Andres Garcia + + * tests/headNoHead.tcl: removed the 'header 1' option, it is redundant + if you use 'writeheader', made the output more explicit. + + +2002-09-24 Andres Garcia + + * doc/tclcurl.n, + doc/tclcurl.html, + tests/debugProc.tcl: The values given for the data types in the + 'debugproc' options were wrong, changed the test to show it more clearly. + + +2002-08-14 Andres Garcia + + * ReadMeW32.txt: New instructions on how to compile TclCurl in Windows. + + * configure.in: Changed so that it will configure in msys-mingw + without using a 'curl-config' + + +2002-06-25 Andres Garcia + + * Release version 0.9.8 + +2002-06-23 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Changed the parameters of the curlProgressCallback + function from 'size_t' to 'double'. + + +2002-06-22 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLFORM_BUFFER. + + * generic/tclcurl.c: Fix a bug when duplication a curl handle, I was not + allocating space before doing a memcpy. + + * generic/tclcurl.c: Changed all the calls to ckalloc, malloc, ckfree to + Tcl_Alloc and Tcl_Free. + + +2002-06-13 Andres Garcia + + * generic/tclcurl.c: Changed the TIMECOND_IFMODSINCE and + TIMECOND_IFMODSINCE, so that now they have a CURL_ + prefix as they do now in libcurl. + +2002-06-12 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Added support for CURLINFO_REDIRECT_TIME and + CURLINFO_REDIRECT_COUNT. + + +2002-05-14 Andres Garcia + + * generic/multi.h, + generic/multi.c: Added support for the multi interface. + + +2002-04-30 Andres Garcia + + * Release version 0.9.6 + +2002-04-30 Andres Garcia + + * tclcurl.h, + tclcurl.c: Changed the 'interface' field in the 'curlObjData' + struct to 'interfaces', otherwise it wouldn't compile in Windows, + please, don't ask me why (but if you know, please tell me). + + * setup.tcl: the setup script for Windows will now work with + older versions of Tcl/Tk. + +2002-04-23 Andres Garcia + + * configure.in: fixed a small incompatibility with Solaris. + + * tclcurl.c: fixed a seg fault when using the 'httpheader' option + twice. + + * tclcurl.h, + tclcurl.c: support for CURLOPT_DNS_CACHE_TIMEOUT and + CURLOPT_DNS_USE_GLOBAL_CACHE. + +2002-04-22 Andres Garcia + + * tclcurl.n: Updated the documentation about the error codes. + +2002-04-17 Andres Garcia + + * tclcurl.h, + tclcurl.c: added support for CURLOPT_DEBUGFUNCTION. + +2002-04-16 Andres Garcia + + * tclcurl.c: If you set the progressproc option to the empty string + the internal progress function will be restored. + + +2002-04-15 Andres Garcia + + * tclcurl.h, + tclcurl.c: added support for CURLFORM_FILENAME and changed the code + so that all options are passed in a CURLFORM_ARRAY. + + +2002-04-14 Andres Garcia + + * tclcurl.h: Changed the 'httpPost' structs to their new + name 'curl_httppost'. + +2002-04-12 Andres Garcia + + * configure.in, + makefile.in, + tclconfig/tcl.m4: changed the configure scripts to the lastest + CVS version of the sample extension. + + * tclcurl.c, + tclcurl.h, + tclcurl.tcl: passed this files to the generic subdirectory as done + in the sample extension. + +2002-04-01 Andres Garcia + + * Release version 0.9.5 + +2002-03-29 + + * tclcurl.h, + tclcurl.c: Support for CURLOPT_PREQUOTE + + * tclcurl.tcl: 'curl::transfer' now returns a '0' if everything + went well. + +2002-03-28 + + * Update the configure.in script to the new TEA scripts by + Jeff Hobbs. + + * tclcurl.h, tclcurl.c: Added support for CURLINFO_CONTENT_TYPE. + +2002-01-29 + + * Release version 0.9.3 + +2002-01-25 Andres Garcia + + * tclcurl.c: Added support for CURLFORM_CONTENTHEADER. + +2002-01-24 Andres Garcia + + * tclcurl: the CURLOPT_SSL_VERIFYHOST was misspelled. + + * Added support for CURLOPT_SSLCERTTYPE, CURLOPT_SSLKEY, + CURLOPT_SSLKEYTYPE, CURLOPT_SSLKEYPASSWD, CURLOPT_SSL_ENGINE, + CURLOPT_SSL_ENGINEDEFAULT. + +2002-01-17 Andres Garcia + + * tclcurl.h, tclcurl.c: TclCurl was not doing binary transfers + right in Windows. + + * Makefile.in: 'checkAutoPath.tcl' will only be run if TclCurl + is not going to be installed in '/usr' + + * checkAutoPath.tcl: The script will not try to change the 'auto_path' + variable in 'init.tcl' if the user doing the install does not + have write access to the file. + + +2002-01-16 Andres Garcia + + * tclcurl.c: No more seg faults for trailing options at the end of + a configure command. + + +2001-12-09 + + * Release version 0.9.2 + +2001-12-09 Andres Garcia + + * tclcurl.n, tclcurl.html: Updated docs, removed the 'setopt' references. + +2001-12-08 Andres Garcia + + * Changed the 'httpversion' configure option to libcurl 7.9.2 behaviour. + + * Added support for CURLOP_FTP_USE_EPVS + + +2001-12-07 Andres Garcia + + * The 'perform' command now returns the exit code form 'curl_easy_perform' + + * configure.in, mkIndex.tcl.in: A port to Windows. + + * tclcurl.c, tclcurl.h: The 'configure' command will now also return the + value given for the invalid option. + +2001-11-14 Andres Garcia + + * mkIndex.tcl.in: Domenico Andreoli noticed there was a mistyped variable name. + +2001-11-05 + + * Release version 0.9 + +2001-11-04 Andres Garcia + + * Makefile.in: The man page will be installed compressed. + + +2001-10-31 Andres Garcia + + * Added the code to change the 'auto_path' variable in 'init.tcl' to the + makefile. + + +2001-10-30 Andres Garcia + + * Changed the options to the 'timecondition' configure option to lower case. + + * Changed the options to the 'closepolicy' configure option to lower case. + + +2001-10-29 Andres Garcia + + * Added support for the CURLOPT_HTTP_VERSION option. + + * Changed the http posts the new formadd function. + + +2001-10-22 Andres Garcia + + * Added the duphandle command to duplicate a curl handle. + + +2001-10-21 Andres Garcia + + * Added support for the CURLOPT_SSL_CIPHER_LIST option. + + * Added support for the CURLOPT_COOKIEJAR option. + + * Merged Domenico Andreoli patches to ease creating the Debian package. + + +2001-09-03 + + * Release version 0.8 + + +2001-09-01 Andres Garcia + + * Converted to the new 'curl::transfer' command all the tests + where it fitted. + + +2001-08-31 Andres Garcia + + * Added support for CURLOPT_HTTPGET + + * Added support for CURLOPT_SSL_SSL_VERIFYHOST + + +2001-08-30 Andres Garcia + + * Converted all the options of the 'configure' command to + lowercase. + + * Converted all the options of the 'getinfo' command to + lowercase. + + +2001-08-29 Andres Garcia + + * Fixed the 'infile' option. + + * Added the 'readProc' option to the 'configure' commmand. + + +2001-08-28 Andres Garcia + + * Added the 'writeProc' option to the 'configure' command. + + +2001-08-15 Andres Garcia + + * Added the curl::transfer command. + + +2001-06-13 Andres Garcia + + * Version 0.7 released + + +2001-06-12 Andres Garcia + + * Removed support for the CURLOPT_MUTE option, it no longer does + anything. + + * Added the '-vernum' options to 'curl::curlConfig' + + +2001-06-10 Andres Garcia + + * Used libcurl's mprintf funtions to improve TclCurl portability. + + * CURLOPT_TIMEOUT was defined two times. + + * Fixed the bug by which TclCurl would return two many possible options + after using a wrong one. + + * Changed the way the curlObjData struct is initialized. + + * Changed the syntax of the 'getinfo' command options. + + +2001-06-08 Andres Garcia + + * Passed all the tests cases to the new 'configure' option. + + +2001-06-06 Andres Garcia + + * Created the 'configure' command. + + +2001-06-03 Andres Garcia + + * TclCurl won't install the 'tclcurl.h' file. + + +2001-05-21 Andres Garcia + + * It is now possible to remove the CURLOPT_FILE, CURLOPT_INFILE and + CURLOPT_STDERR options between transfers in a persistant connection. + + +2001-05-30 Andres Garcia + + * Version 0.6.1 released. + + +2001-05-04 Andres Garcia + + * Trying to set a HTTPPOST would provoke a seg fault. + + +2001-05-03 Andres Garcia + + * Prevented segfault when saving to a file without the right permissions or + reading for a file that does not exist. + + +2001-05-02 Andres Garcia + + * Added the CURLOPT_CANCELTRANSVAR option. + + * I think I removed some memory leaks by checking that strings are empty + before filling them with strdup. + + +2001-05-01 Andres Garcia + + * Added the CURLOPT_PROGRESSPROC option. + + +2001-04-30 Andres Garcia + + * Added the CURLOPT_BODYVAR option to put the body of a request into + a Tcl variable. + + * Removed the alternative strdup implementation, if the system does not + have it libcurl will (I think). + + +2001-04-28 Andres Garcia + + * tclcurl.h: Added interp field to curlObjData. + + * Added support for the 'CURLOPT_HEADERFUNCTION' option + through 'CURLOPT_HEADERVAR'. + + +2001-04-25 Andres Garcia + + * Makefile.in: Modified to be able to install tclcurl.tcl. + + * tclcurl.tcl: Created this file to host the curl::curlConfig procedure. + + +2001-04-23 Andres Garcia + + * tests/getinfo.tcl: Added the option CURLOPT_FILETIME so + CURLINFO_FILETIME would work. + + +2001-04-12 Andres Garcia + + * First release. + diff --git a/Changes.txt b/Changes.txt new file mode 100755 index 0000000..8c64592 --- /dev/null +++ b/Changes.txt @@ -0,0 +1,778 @@ + + +Version 7.19.0 released 1-Sep-2008 + + * New commands: + + * curlHandle pause and curlHandle resume: Pause and resume a + tranfer from within a progress callback procedure. + + * New configure options: + + * addressscope: Pass a number specifying the scope_id value to + use when connecting to IPv6 link-local or site-local addresses. + + * proxytranfermode: Pass a number. If the value is set to 1 (one), + it tells TclCurl to set the transfer mode (binary or ASCII) for + FTP transfers done via an HTTP proxy, by appending ;type=a or + ;type=i to the URL. Without this setting, or if set to 0 (zero, + the default), '-tranfertext' has no effect when doing FTP via a + proxy. Beware that not all proxies support this feature. + + * Added two new types for the '-proxytype' option: 'socks4a' + and 'socks5hostname'. + + * New info available through the 'getinfo' command: + + * appconnecttime: Returns the time, in seconds, it took from the start + until the SSL/SSH connect/handshake to the remote host was completed. + + * primaryip: Returns the IP address of the most recent connection done + with this handle. + + * redirecturl: Returns the URL a redirect would take you to if you would + enable 'followlocation'. This can come very handy if you think using + the built-in redirect logic isn't good enough for you but you would + still prefer to avoid implementing all the magic of figuring out the + new URL. + + * Bug fix: The 'writeproc' option didn't work right. + + + * Internal changes: + + * When compìling against Tcl 8.5.3 I had to remove a lot of CONSTs to + prevent warnings, and then I had to add them back with Tcl 8.5.4, + so, depending on which version you use you might get quite a few + warnings while compiling, they should be harmless though. + + * The internal workings of the 'any' http authentication has been changed. + +2008-08-25 Andres Garcia + + * generic/tclcurl.h, + generic/tclcurl.c: Changed the 'anyauth rewind' to use the new + CURLOPT_SEEKFUNCTION and CURLOPT_SEEKDATA. + +Version 7.17.1 released 1-Nov-2007 + + * New configure options: + + * post301: A non-zero parameter tells TclCurl to respect + RFC 2616/10.3.2 and not convert POST requests into GET + requests when following a 301 redirection like browsers + usually do. + + * sshhostpublickeymd5: Pass a string containing 32 hexadecimal + digits. The string should be the 128 bit MD5 cheksum of the + remote host public key, and TclCurl will reject the connection + to the host unless the md5sums match. + + * If you pass the magic string 'FLUSH' to the '-cookielist' + option all known cookies will be written to the file + specified by '-cookiejar'. + + * Renamed options: + + Some configure options have been renamed so they get more general + names, the old names are deprecated even if they may be supported + forever. + + * sslpasswd => keypasswd + * ftpappend => append + * ftplistonly => dirlistonly + * ftpssl => usessl + + * Internal changes: + + Up until the current version when we wanted libcurl to use a value + in a string, like the URL to download, we had to keep the string as + long as libcurl could use it. Since 7.17.0 libcurl keeps it own + copies, so I no longer make TclCurl do it. + + That means this is a handle-with-care release, please report any + problems you may have. + + +Version 7.16.4 released 19-July-07 + + * New configure options: + + * newfileperms: Used to set the permissions, defalt 0664, that will be + assigned to newly created files on the remote server. + + * newdirectoryperms: Used to set the permissions, default 0755, that + will be assigned to newly created directories on the remote server. + + They can both be used for SFTP, SCP and FILE transfers. + + * Changed option: The option to set the Kerberos security + level for FTP is now called 'krblevel', the old name + 'krb4level' will be kept for some time for compatibility. + + * New option for multi handles: + + * maxconnects: Sets the maximum amount of simultaneously open + connections that TclCurl may cache. Default is 10. + + * Bug fix: Sven Hoexter fixed a couple of errors in the man page. + +Version 7.16.2 released 16-April-07 + + * New feature: TclCurl now supports SSH for SFTP and SCP transfers as long + as libcurl has been compiled with libssh2 support. + + * New configure options: + + * publickeyfile: name of the file with the public key to use with SSH. + + * privatekeyfile: name of the file with the provate key to use with SSH. + + * sshauthtypes: Allowed types are "publickey", "password", "host", + "keyboard", or "any" to let TclCurl choose one. + + * timeoutms and connectimeoutms: The work like 'timeout' and + 'connectimeout' except the timout is given in miliseconds. + + * ftpsslccc: If enabled, it will make libcurl shutdown SSL/TLS after + the authentication is done on a FTP-SSL operation. + + * httpcontentdecoding: If set to zero content decoding is disabled. + + * httptransferdecoding: If set to zero Set transfer decoding is + disabled. TclCurl does chunked transfer decoding by default + unless this option is set to zero. + + * ftpsslccc: If enabled, it will make libcurl shutdown SSL/TLS after + the authentication is done on a FTP-SSL operation. + + * Bug fixes: + + * Olivier Lenormand reported that in case the server sends more than + one 'Set-Cookie' header, TclCurl would only save the last one in + the header array. Now the array will contain a list with all the + cookies. + + * Jos Decoster reported and helped fixing a crash that happened when + changing a handle from using a 'writeproc' to not using one. + + * I have updated the configure scripts to TEA 3.6, hope you don't bump into + any regressions. + +Version 7.16.0 released 15-November-06 + + * Removed feature: TclCurl no longer supports third party FTP transfers. + + * New configure options: + + * ftpalternativetouser: Pass a string which will be used to authenticate + if the usual FTP "USER user" and "PASS password" negotiation fails. This + is currently only known to be required when connecting to Tumbleweed's + Secure Transport FTPS server using client certificates for + authentication. + + * ftpentrypath: Returns a string holding the path of the entry path. + That is the initial path TclCurl ended up in when logging on to the + remote FTP server. Returns an empty string if something is wrong. + + * maxsendspeed: Pass a speed in bytes per seconds. If an upload exceeds this + speed on cumulative average during the transfer, the transfer will pause to + keep the average rate less than or equal to the parameter value. + + * maxrecvspeed: Pass a speed in bytes per second. If a download exceeds this + speed on cumulative average during the transfer, the transfer will pause to + keep the average rate less than or equal to the parameter value. + + * New command for multi handles 'configure', so far the is only one option to set: + + * pipelining: Pass a 1 to enable or 0 to disable. Enabling pipelining on a multi + handle will make it attempt to perform HTTP Pipelining as far as possible for + transfers using this handle. This means that if you add a second request that + can use an already existing connection, the second request will be "piped" on + the same connection rather than being executed in parallel. + +Version 0.15.3 released 17-April-06 + + * I updated the autoconf scripts to TEA 3.5, this seems to prevent + the warnings about how the headers files couldn't be compiled, + but it may have (re)introduced other bugs. + + * Removed feature: TclCurl no longer supports Gopher, it probably + didn't work anyway. + + * New configure options: + + * localport: Sets the local port number of the socket used for + the connection. This can be used in combination with '-interface' + and you are recommended to use 'localportrange' as well when this + is set. + + * localportrange: Number of attempts TclCurl should do to find a + working local port number. It starts with the given 'localport' + and adds one to the number for each retry. + +Version 0.15.1 released 10-January-06 + + * New configure options: + + * ftpskippasvip: If set to a non-zero value, it instructs TclCurl + not to use the IP address the server suggests in its 227-response + to TclCurl's PASV command when TclCurl connects the data connection. + Instead TclCurl will re-use the same IP address it already uses for + the control connection. But it will use the port number from the + 227-response. + + * ftpfilemethod: It allows three values: + + * multicwd: the default, TclCurl will do a single CWD operation + for each path part in the given URL. For deep hierarchies this + means very many commands. This is how RFC1738 says it should + be done. + + * nocwd: no CWD at all is done, TclCurl will do SIZE, RETR, STOR + etc and give a full path to the server. + + * singlecwd: make one CWD with the full target directory and then + operate on the file "normally". + + The support for this options is still experimental, comments whether + the methods work or don't with different methods are welcome. + + Likewise, the options, or their names, may change in future releases, + so they are not yet documented elsewhere. + + * Bug fix: The Windows packages had defective 'doc' directories. Thanks to + Alex Hisen for letting me know. + +Version 0.14.1 released 4-September-05 + + * New configure options: + + * ingnorecontentlength: Ignore the Content-Length header. This is + useful for Apache 1.x (and similar servers) which will report + incorrect content length for files over 2 gigabytes. + + * cookielist: Pass a string with a cookie. The cookie can be + either in Netscape / Mozilla format or just regular HTTP-style + header (Set-Cookie: ...) format. + + '$curlHandle getinfo cookielist' will return a list of all + cookies TclCurl knows (expired ones, too). + + * When posting data, you can use the new 'filecontent' option to + read a file and use its contents as data. + + * Bug fix: The code to post data was filled with memory leaks, I hope + I have fixed them all. + +Version 0.14.0 released 3-June-05 + + * BEHAVIOUR CHANGE: To set the version SSL/TLS to use with + '-sslversion' you can know use the values: + + * default + The default action. When libcurl built with OpenSSL, this will + attempt to figure out the remote SSL protocol version. + Unfortunately there are a lot of ancient and broken servers in + use which cannot handle this technique and will fail to + connect. When libcurl is built with GnuTLS, this will mean SSLv3. + + * tlsv1 + Force TLSv1 + + * sslv2 + Force SSLv2 + + * sslv3 + Force SSLv3 + + * Bug fix: A report by Melissa Millard made me realize that the + options 'httpauth', 'proxyauth', 'ipresolve', 'ftpssl' and + 'ftpsslauth' have, probably, never worked. They should now. + + * I updated 'configure.in' and 'Makefile.in' to the latest versions + in Tcl's sample extension, unfortunately that's likely to introduce + some bugs, so, please, report any problems. + +Version 0.13.2 released 16-April-05 + + * New features: + + * New configure options: + + * ftpaccount: When an FTP server asks for "account data" + after user name and password has been provided. + + * sourceurl: When set, it enables a FTP third party transfer. + + * sourcequote: Exactly like '-quote', but for the source host. + + * The following options are now obsolete 'sourcehost', 'sourcepath', + 'sourceport' and 'pasvhost'. + + * curl::versioninfo will indicate if there is support for + SSPI. + + * More information can be obtained using 'curl::getinfo': + + * numconnects: to get the number of new connections + TclCurl had to create to achieve the previous transfer. + + * sslengines: returns a list of the OpenSSL crypto-engines + supported. + + * httpconnectcode: returns the last received proxy + response code to a CONNECT request + + * Bug fix: + + * Fixed the "-sourcepostquote" option. + + * Daniel A. Steffen fixed a bug with parallel builds. + +Version 0.12.2 released 18-October-04 + + * New features: + + * You can now share dns and cookie information among TclCurl + handles, please check the docs for details. + + * New configure option: 'ftpsslauth', you may need this option + because of servers like BSDFTPD-SSL from won't work properly + when "AUTH SSL" is issued but require "AUTH TLS" instead. + + * Added three new commands to the 'curl' namespace: + + * curl::easystrerror errorCode + + * curl::sharestrerror errorCode + + * curl::multistrerror errorCode + + All three will return a string explaining what the given error + number means. + + * Bug fix: + + * Ralph Mitchell reported that the 'cookiejar' option wouldn't + work in the latest version, it should now. + +Version 0.12.1 released 30-September-04 + + * New features: + + * Third party ftp support, you can now transfer a file between + two different ftp servers. Check the 'ftp options' in the docs + page for details. + + * A new command for curl handles 'reset' which re-initializes all + options previously set on a specified handle to the default values. + + This puts back the handle to the same state as it was in when it + was just created with curl::init. + + It does not change the following information kept in the handle: + live connections, the Session ID cache, the DNS cache, the cookies + and shares. + + * Hooked the multi interface to Tcl's event loop, so you can have + fire-and-forget transfers: + + set multiHandle [curl::multiinit] + set easyHandle [curl::init] + + $easyHandle configure -file home.tar.gz \ + -url http://127.0.0.1/~andres/HomePage.tar.gz + + $multiHandle addhandle $easyHandle + $multiHandle auto -command "CleanUp $multiHandle $easyHandle" + + This support is experimental, so any comments are welcome. + + Thanks to Eric Boudaillier who answered my question about how to + do it. + + * New ssl data types have been added to 'debugproc'. + + * In case of error when setting post data, the error will include a + code about the nature of the error. + + * Bug fix: + + * The 'autoreferer' option should now work. + +Version 0.12.0 released 09-July-04 + + * New configure options: + + * '-port': Pass the number specifying what remote port to connect to, + instead of the one specified in the URL or the default port for the + used protocol. + + * '-tcpnodelay': To specify whether the TCP_NODELAY option should be + set or cleared. + + Setting this option will disable TCP's Nagle algorithm. The purpose + of this algorithm is to try to minimize the number of small packets + on the network. + + * '-autoreferer': When enabled, TclCurl will automatically set the + 'Referer:' field in requests where it follows a 'Location:' redirect. + + * Bug fix: + + * Thanks to Stefano Federici I noticed that the 'ftpssl' option didn't + work. + +Version 0.11.0 released 04-febrary-04 + + + * New configure options: + + * 'ftpssl': You can use ftps:// URLs to explicitly switch on SSL/TSL + for the control connection and the data connection. + + Alternatively you can set this option to one of these values: + + * 'nope': Do not attempt to use SSL + + * 'try': Try using SSL, proceed anyway otherwise. + + * 'control': Use SSL for the control conecction or fail. + + * 'all': Use SSL for all communication or fail. + + * 'netrcfile': Pass a string containing the full path name to the + file you want to use as .netrc file. For the option to work, you + have to set the 'netrc' option to 'required'. If this option is + omitted, and 'netrc' is set, TclCurl will attempt to find the a + .netrc file in the current user's home directory. + + * Bug fix: Fixed the 'netrc' option. + +Version 0.10.8 released 29-december-03 + + * New 'configure' options: + + * 'ftpresponsetimeout': Causes TclCurl to set a timeout period + on the amount of time that the server is allowed to take in + order to generate a response message for a command before the + session is considered hung. + + * 'ipresolve': Allows an application to select what kind of + IP addresses to use when resolving host names. This is only + interesting when using host names that resolve addresses + using more than one version of IP. + + * 'maxfilesize': Allows you to specify the maximum size + of a file to download. + + * New 'getinfo' options: + + * 'httpauthavail': Returns a list with the authentication method(s) + available. + + * 'proxyauthavail': Returns a list with the authentication method(s) + available for your proxy athentication. + + * Misc: + + * 'curl::versioninfo' will now say if there is support for + asynchronus DNS and SPNEGO. + + * The 'httpcode' for 'getinfo' is now called 'responsecode' + since it will now work with FTP transfers. The old option + name, while deprecated, will continue to work. + + * Bug fixes: + + * TclCurl still thought it was in version 0.10.4. + + * Fixed the 'httpauth' option. + + * The configure scripts would sometimes use the cURL in + '/usr/bin' instead of the one in '/usr/local/bin' despite + the '--with-curlprefix' tag. + +Version 0.10.7 released 03-September-03 + + * New configure options: + + * 'ftpcreatemissingdirs': If set to non-zero, TclCurl + will attempt to create any remote directory that it + fails to CWD into. CWD is the command that changes + working directory. + + * 'httpauth': Set to the authentication method you want, + the available ones are: + + * 'basic': HTTP Basic authentication. This is the + default choice, and the only method that is in + widespread use and supported virtually everywhere. + It sends the user name and password over the network + in plain text, easily captured by others. + + * 'digest': HTTP Digest authentication. Digest + authentication is a more secure way to do + authentication over public networks than the + regular old-fashioned Basic method. + + * 'gssnegotiate': HTTP GSS-Negotiate authentication. + The GSS-Negotiate method was designed by Microsoft + and is used in their web aplications. It is primarily + meant as a support for Kerberos5 authentication + but may be also used along with another authenti- + cation methods. + + * 'ntlm': HTTP NTLM authentication. A proprietary + protocol invented and used by Microsoft. + + * 'any':TclCurl will automaticaly select the one it + finds most secure. + + * 'anysafe': It may use anything but basic, TclCurl + will automaticly select the one it finds most secure. + + + * 'command': Executes a Tcl command after the transfer + is done. So far it only works in blocking transfers + which is pretty much useless. + +Version 0.10.5 released 21-May-03 + + * New configure option: + + * 'ftpuseeptr': Set to non-zero, to tell TclCurl to use the EPRT + (and LPRT) command when doing active FTP downloads (which is + enabled by 'ftpport'). Using EPRT means that it will first attempt + to use EPRT and then LPRT before using PORT, if you pass zero to + this option, it will not try using EPRT or LPRT, only plain PORT + + * Bug fixes: + + * The multi handles couldn't store the data of more than two + easy handles. + + * Using the 'progressproc' option in Windows would crash Tcl. + + * The '$multiHandle active' command wasn't returning anything. + + * Misc: + + * Updated ssl in Windows binaries to version 0.9.7b. + + * Changed the way the http reponse header is dealt with in + the 'headervar' option. Now the whole header is put into + foo(http). + + ************** POTENTIAL INCOMPATIBILITY ************** + +Version 0.10.4 released 31-March-03 + + * New features: + + * Added 'getinfo' features to the 'curl::transfer' command. + + You can now do things like: + + curl::transfer -url http://www.curl.com \ + -infohttpcode httpCode \ + -infocontenttype contentType \ + + puts "Http code: $httpCode" + puts "Content type: $contentType" + + * New configure option: -unrestrictedauth, a non-zero parameter + tells the extension it can continue to send authentication + (user+password) when following locations, even when hostname + changed. Note that this is meaningful only when setting + -followlocation + + * The makefile now has an 'uninstall' target. + + * The Windows packages are now zlib enabled. + + * Added a 'packages' directory with a makefile to create the + Windows packages and the spec file for rpm. + + * Bug fix: + + * The configure script will no longer choke with the version + string of cURL's prereleases. + + * Misc + + * If there is an error, the 'curl::transfer' command will now + return the code of the error, without the 'Couldn't perform + transfer' message. + + ************** POTENTIAL INCOMPATIBILITY ************** + + * So that they have the same name in Windows and Linux, I have + changed the name of the certificate file in Windows to + 'curl-ca-bundle.crt' and it will placed in the 'Windows' + directory. + + ************** POTENTIAL INCOMPATIBILITY ************** + + * Alex Khassin suggested using fully qualified in 'tclcurl.tcl' + names to prevent problems with namespaces. + +Version 0.10.3 released 30-January-03 + + * New configure option: + + * 'http200alieases': To pass a list of aliases to be treated as valid + HTTP 200 responses. + + * Bug fixes: + + * When using '-headervar' in Windows you could end up with carriage + returns in the name of the header. + + * Julian let me know that TclCurl would crash when used in a thread + enabled Tcl. + + * Enhancements: + + * Since compiling TclCurl in Windows is a real pain, I will provide + more packages for it, thread and ssl enabled. + + * Alex Khassin has written instructions on how to get TclCurl to work + with AOLSever. + +Version 0.10.1 released 14-October-02 + + * New configure options: + + * 'proxytype': Allows you to set type of the proxy. Available options + are 'http' and 'socks5', with the HTTP one being default. + + * 'encoding': TclCurl can now request compressed contents using the + 'deflate' method. + + * 'buffersize': To set prefered size for the receive buffer in TclCurl, + so that the write callback is called more often with smaller chunks. + + * 'nosignal': Tells TclCurl not use any functions that install signal + handlers or any functions that cause signals to be sent to the process. + + * New command: + + * 'curl::versioninfo': Returns information about various run-time + features in TclCurl. + + * Bug fixes: + + * Fixed to 'buffer' option to post data. + + * Asif Haswarey reported that '--with-curlinclude' wouldn't work. + + * The multi interface examples suddenly stopped working, they + should now. + +Version 0.9.8 released 25-June-02 + + * Support for libcurl's multi interface, the main features are: + + * Enable a "pull" interface. The application that uses TclCurl + decides where and when to get/send data. + + * Enable multiple simultaneous transfers in the same thread + without making it complicated for the application. + + * Keep Tk GUIs 'alive' while transfers are taking place. + + * New 'httppost' options + + * 'bufferName' and 'buffer', the contents of buffer will be sent + to the server as if they were a file whose name is in bufferName, + please check the 'httpBufferPost.tcl' example. + + * New 'getinfo' options + + * redirectime: Returns the total time, in seconds, it took for all + redirection steps including name lookup, connect, pretransfer and + transfer before the final transaction was started, it returns the + complete execution time for multiple redirections. + + * redirectcount: Returns the total number of redirections that were + actually followed. + +Version 0.9.6 released 30-April-02 + + * New configure options: + + * dnscachetimeout, to set the timeout in seconds for keeping the name resolves + in memory. + + * dnsuseglobalcache, if set to '1' the DNS cache will be shared among + curl handles. + + * debugproc, to set a procedure that will receive the debug data + produced by the 'verbose' option. + + + * Jonathan Matthew found and fixed a seg fault when you used + the 'httpheader' option twice with the same handle. + + + * The configure scripts saw more work in this release: + + * I merged the latest changes to the TEA sample extension by + Jeff Hobbs. + + * Suresh K. Sastry found and fixed an incompatibility with Solaris. + + * And I hope I have not forgotten any 'DESTDIR' this time. + +Version 0.9.5 released 01-April-2002 + + * I have adapted the configure scripts to the new TEA scripts released by + Jeff Hobbs, for example, now it will compile 'out of the box' for freeBSD + systems (well, you may need to use '--with-curlprefix' and '--with-curlinclude') + + * New configure option: + + * prequote: use it to pass a list of ftp commands to execute *just before* + the transfer. + + * New getinfo option: + + * contenttype: if the servers bothers to tell you, this will return the type + of the downloadad object. + + * Bug fix: 'curl::transfer' will return '0' if the transfer was successful. + *** POTENTIAL INCOMPATIBILITY *** + +Version 0.9.3 released 29-Jan-2002 + + * Bug fix: There should no more seg faults because of trailing options + in configure commands. + + * Bug fix: Binary transfer weren't done right in Windows, thanks to + Peter Waltenberg and Darren Blee for the report. + + * TclCurl now supports OpenSSL engines, which allow you to keep your private + key stored in external hardware. + + In order to manage this there are a few new configure options: + + * sslcerttype: Set SSL cert type (PEM/DER). + + * sslkey: Set SSL private key (file). + + * sslkeytype: Set SSL key type (PEM/DER/ENG). + + * sslkeypasswd: Set the passphrase for your private key. + + * sslengine: Set the name of the crypto engine. + + * sslenginedefault: Set the default engine. + + * You can now add a set of headers for a particular part in a + multipart/form-post using the 'contentheader' option. + + * It is now possible to execute commands in ftp servers without + transfering files, you have to set 'nobody' to '1' and 'header' to + '0'. diff --git a/Makefile.in b/Makefile.in new file mode 100755 index 0000000..ef1b8e0 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,458 @@ +# Makefile.in -- +# +# This file is a Makefile for Sample TEA Extension. If it has the name +# "Makefile.in" then it is a template for a Makefile; to generate the +# actual Makefile, run "./configure", which is a configuration script +# generated by the "autoconf" program (constructs like "@foo@" will get +# replaced in the actual Makefile. +# +# Copyright (c) 1999 Scriptics Corporation. +# Copyright (c) 2002-2005 ActiveState Corporation. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# RCS: @(#) $Id: Makefile.in,v 1.66 2009/03/18 18:39:42 stwo Exp $ + +#======================================================================== +# Add additional lines to handle any additional AC_SUBST cases that +# have been added in a customized configure script. +#======================================================================== + +#SAMPLE_NEW_VAR = @SAMPLE_NEW_VAR@ + +#======================================================================== +# Nothing of the variables below this line should need to be changed. +# Please check the TARGETS section below to make sure the make targets +# are correct. +#======================================================================== + +#======================================================================== +# The names of the source files is defined in the configure script. +# The object files are used for linking into the final library. +# This will be used when a dist target is added to the Makefile. +# It is not important to specify the directory, as long as it is the +# $(srcdir) or in the generic, win or unix subdirectory. +#======================================================================== + +PKG_SOURCES = @PKG_SOURCES@ +TCLCURL_SCRIPTS = @TCLCURL_SCRIPTS@ +PKG_OBJECTS = @PKG_OBJECTS@ + +PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ +PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ + +#======================================================================== +# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with +# this package that need to be installed, if any. +#======================================================================== + +PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ + +#======================================================================== +# This is a list of public header files to be installed, if any. +#======================================================================== + +PKG_HEADERS = @PKG_HEADERS@ + +#======================================================================== +# "PKG_LIB_FILE" refers to the library (dynamic or static as per +# configuration options) composed of the named objects. +#======================================================================== + +PKG_LIB_FILE = @PKG_LIB_FILE@ +PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ + +lib_BINARIES = $(PKG_LIB_FILE) +BINARIES = $(lib_BINARIES) + +SHELL = @SHELL@ + +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +libdir = @libdir@ +includedir = @includedir@ +datarootdir = @datarootdir@ +datadir = @datadir@ +mandir = @mandir@ + +DESTDIR = + +PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) +pkgdatadir = $(datadir)/$(PKG_DIR) +pkglibdir = $(libdir)/$(PKG_DIR) +pkgincludedir = $(includedir)/$(PKG_DIR) + +top_builddir = . + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_LIBRARY = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ + +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +CC = @CC@ +CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ +CFLAGS_WARNING = @CFLAGS_WARNING@ +EXEEXT = @EXEEXT@ +LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ +MAKE_LIB = @MAKE_LIB@ +MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ +MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ +MAKE_STUB_LIB = @MAKE_STUB_LIB@ +OBJEXT = @OBJEXT@ +RANLIB = @RANLIB@ +RANLIB_STUB = @RANLIB_STUB@ +SHLIB_CFLAGS = @SHLIB_CFLAGS@ +SHLIB_LD = @SHLIB_LD@ +SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ +STLIB_LD = @STLIB_LD@ +#TCL_DEFS = @TCL_DEFS@ +TCL_BIN_DIR = @TCL_BIN_DIR@ +TCL_SRC_DIR = @TCL_SRC_DIR@ +#TK_BIN_DIR = @TK_BIN_DIR@ +#TK_SRC_DIR = @TK_SRC_DIR@ + +# Not used, but retained for reference of what libs Tcl required +#TCL_LIBS = @TCL_LIBS@ + +#======================================================================== +# TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our +# package without installing. The other environment variables allow us +# to test against an uninstalled Tcl. Add special env vars that you +# require for testing here (like TCLX_LIBRARY). +#======================================================================== + +EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) +#EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR) +TCLLIBPATH = $(top_builddir) +TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` +PKG_ENV = @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ + PATH="$(EXTRA_PATH):$(PATH)" \ + TCLLIBPATH="$(TCLLIBPATH)" + +TCLSH_PROG = @TCLSH_PROG@ +TCLSH = $(PKG_ENV) $(TCLSH_ENV) $(TCLSH_PROG) + +#WISH_ENV = TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` +#WISH_PROG = @WISH_PROG@ +#WISH = $(PKG_ENV) $(TCLSH_ENV) $(WISH_ENV) $(WISH_PROG) + +SHARED_BUILD = @SHARED_BUILD@ + +INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ +#INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ + +PKG_CFLAGS = @PKG_CFLAGS@ + +# TCL_DEFS is not strictly need here, but if you remove it, then you +# must make sure that configure.in checks for the necessary components +# that your library may use. TCL_DEFS can actually be a problem if +# you do not compile with a similar machine setup as the Tcl core was +# compiled with. +#DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS) +DEFS = @DEFS@ $(PKG_CFLAGS) + +# Move pkgIndex.tcl to 'BINARIES' var if it is generated in the Makefile +CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl +CLEANFILES = @CLEANFILES@ + +CPPFLAGS = @CPPFLAGS@ +LIBS = @PKG_LIBS@ @LIBS@ +AR = @AR@ +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + +#======================================================================== +# Start of user-definable TARGETS section +#======================================================================== + +#======================================================================== +# TEA TARGETS. Please note that the "libraries:" target refers to platform +# independent files, and the "binaries:" target inclues executable programs and +# platform-dependent libraries. Modify these targets so that they install +# the various pieces of your package. The make and install rules +# for the BINARIES that you specified above have already been done. +#======================================================================== + +all: binaries libraries doc + +#======================================================================== +# The binaries target builds executable programs, Windows .dll's, unix +# shared/static libraries, and any other platform-dependent files. +# The list of targets to build for "binaries:" is specified at the top +# of the Makefile, in the "BINARIES" variable. +#======================================================================== + +binaries: $(BINARIES) + +libraries: + +scripts: $(TCLCURL_SCRIPTS) + +#======================================================================== +# Your doc target should differentiate from doc builds (by the developer) +# and doc installs (see install-doc), which just install the docs on the +# end user machine when building from source. +#======================================================================== + +doc: + + + +install: all install-binaries install-scripts install-libraries install-doc + +install-binaries: binaries install-lib-binaries install-bin-binaries + +#======================================================================== +# This rule installs platform-independent files, such as header files. +# The list=...; for p in $$list handles the empty list case x-platform. +#======================================================================== + +install-libraries: libraries + @mkdir -p $(DESTDIR)$(includedir) + @echo "Installing header files in $(DESTDIR)$(includedir)" + @list='$(PKG_HEADERS)'; for i in $$list; do \ + echo "Installing $(srcdir)/$$i" ; \ + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ + done; + +#======================================================================== +# Install documentation. Unix manpages should go in the $(mandir) +# directory. +#======================================================================== + +install-doc: doc + @mkdir -p $(DESTDIR)$(mandir)/mann + @echo "Installing documentation in $(DESTDIR)$(mandir)" + @list='$(srcdir)/doc/*.n'; for i in $$list; do \ + echo "Installing $$i"; \ + rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ + gzip $$i; \ + $(INSTALL_DATA) $$i.gz $(DESTDIR)$(mandir)/mann ; \ + gunzip $$i.gz; \ + done + +test: binaries libraries + $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) + +shell: binaries libraries + @$(TCLSH) $(SCRIPT) + +gdb: + $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) + +depend: + +#======================================================================== +# $(PKG_LIB_FILE) should be listed as part of the BINARIES variable +# mentioned above. That will ensure that this target is built when you +# run "make binaries". +# +# The $(PKG_OBJECTS) objects are created and linked into the final +# library. In most cases these object files will correspond to the +# source files above. +#======================================================================== + +$(PKG_LIB_FILE): $(PKG_OBJECTS) + -rm -f $(PKG_LIB_FILE) + ${MAKE_LIB} + $(RANLIB) $(PKG_LIB_FILE) + +$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) + -rm -f $(PKG_STUB_LIB_FILE) + ${MAKE_STUB_LIB} + $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) + +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# +# In the following lines, $(srcdir) refers to the toplevel directory +# containing your extension. If your sources are in a subdirectory, +# you will have to modify the paths to reflect this: +# +# sample.$(OBJEXT): $(srcdir)/generic/sample.c +# $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@ +# +# Setting the VPATH variable to a list of paths will cause the makefile +# to look into these paths when resolving .c to .obj dependencies. +# As necessary, add $(srcdir):$(srcdir)/compat:.... +#======================================================================== + +VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win + +.c.@OBJEXT@: + $(COMPILE) -c `@CYGPATH@ $<` -o $@ + +#======================================================================== +# Distribution creation +# You may need to tweak this target to make it work correctly. +#======================================================================== + +#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar +COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) +DIST_ROOT = /tmp/dist +DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) + +dist-clean: + rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* + +dist: dist-clean + mkdir -p $(DIST_DIR) + cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ + $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ + $(DIST_DIR)/ + chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 + chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in + + for i in $(srcdir)/*.[ch]; do \ + if [ -f $$i ]; then \ + cp -p $$i $(DIST_DIR)/ ; \ + fi; \ + done; + + mkdir $(DIST_DIR)/tclconfig + cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ + $(DIST_DIR)/tclconfig/ + chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 + chmod +x $(DIST_DIR)/tclconfig/install-sh + + list='demos doc generic library mac tests unix win'; \ + for p in $$list; do \ + if test -d $(srcdir)/$$p ; then \ + mkdir $(DIST_DIR)/$$p; \ + cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ + fi; \ + done + + (cd $(DIST_ROOT); $(COMPRESS);) + +#======================================================================== +# End of user-definable section +#======================================================================== + +#======================================================================== +# Don't modify the file to clean here. Instead, set the "CLEANFILES" +# variable in configure.in +#======================================================================== + +clean: + -test -z "$(BINARIES)" || rm -f $(BINARIES) + -rm -f *.$(OBJEXT) core *.core + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean: clean + -rm -f *.tab.c + -rm -f $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log config.status + +#======================================================================== +# Install binary object libraries. On Windows this includes both .dll and +# .lib files. Because the .lib files are not explicitly listed anywhere, +# we need to deduce their existence from the .dll file of the same name. +# Library files go into the lib directory. +# In addition, this will generate the pkgIndex.tcl +# file in the install location (assuming it can find a usable tclsh shell) +# +# You should not have to modify this target. +#======================================================================== + +install-lib-binaries: binaries + @mkdir -p $(DESTDIR)$(pkglibdir) + @list='$(lib_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ + $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p; \ + stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ + if test "x$$stub" = "xstub"; then \ + echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ + else \ + echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ + fi; \ + ext=`echo $$p|sed -e "s/.*\.//"`; \ + if test "x$$ext" = "xdll"; then \ + lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ + if test -f $$lib; then \ + echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \ + $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \ + fi; \ + fi; \ + fi; \ + done + @list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + destp=`basename $$p`; \ + echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \ + fi; \ + done + @if test "x$(SHARED_BUILD)" = "x1"; then \ + echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ + $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ + fi + +#======================================================================== +# Install binary executables (e.g. .exe files and dependent .dll files) +# This is for files that must go in the bin directory (located next to +# wish and tclsh), like dependent .dll files on Windows. +# +# You should not have to modify this target, except to define bin_BINARIES +# above if necessary. +#======================================================================== + +install-bin-binaries: binaries + @mkdir -p $(DESTDIR)$(bindir) + @list='$(bin_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \ + fi; \ + done + +#======================================================================== +# This rule installs the scripts that are part of TclCurl. +#======================================================================== + +install-scripts: scripts + @for i in generic/$(TCLCURL_SCRIPTS) ; do \ + echo "Installing $$i" ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(pkglibdir) ; \ + done; + +.SUFFIXES: .c .$(OBJEXT) + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +uninstall-binaries: + list='$(lib_BINARIES)'; for p in $$list; do \ + rm -f $(DESTDIR)$(pkglibdir)/$$p; \ + done + list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ + p=`basename $$p`; \ + rm -f $(DESTDIR)$(pkglibdir)/$$p; \ + done + list='$(bin_BINARIES)'; for p in $$list; do \ + rm -f $(DESTDIR)$(bindir)/$$p; \ + done + +checkAutoPath: + @if test "x$(DESTDIR)$(libdir)" != x/usr; then \ + echo "Checking Tcl's autoPath variable" ; \ + $(TCLSH_PROG) $(srcdir)/checkAutoPath.tcl $(DESTDIR)$(libdir); \ + fi; + + +.PHONY: all binaries clean depend distclean doc install libraries test + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/ReadMe.txt b/ReadMe.txt new file mode 100755 index 0000000..74e0329 --- /dev/null +++ b/ReadMe.txt @@ -0,0 +1,59 @@ +TclCurl - get a URL with FTP, TELNET, LDAP, DICT, FILE, HTTP or HTTPS syntax. + +TclCurl gives the Tcl programmer access to the facilities of libcurl, for more information +about what libcurl is capable of check http://curl.haxx.se. + +To make type: + + ./configure ?--enable-threads? + make + make install + +The configure script will deduce $PREFIX from the tcl installation. +The generated Makefile uses the file $PREFIX/lib/tclConfig.sh that was left by +the make of tcl for most of its configuration parameters. + +There is another README to explain how to compile in Windows. + +Troubleshooting + +If you are running Red Hat or Fedora and you are compiling from source, +make sure the directory '/usr/local/lib' is listed in '/etc/ld.so.conf', +if it isn't add it before installing cURL. + +If the configure script doesn't detect Tcl even though it is there, it +is probably because there is no 'tclConfig.sh' file, maybe you need +to install a 'tcl-devel' package or maybe it would be a good idea +to download Tcl/Tk 8.4.5, the latest version, and install that. + +Usage: + + package require TclCurl + + set curlHandle [curl::init] + + curlHandle perform + + curlHandle getinfo curlinfo_option + + curlHandle duphandle + + curlhandle cleanup + + curl::transfer + + curl::version + + curl::escape url + + curl::unescape url + + curl::curlConfig option + +Check the man page for details. + + +Written by: Andres Garcia (fandom@telefonica.net) + +Use at your own risk. No support. +BSD like license, check 'license.terms' for details. diff --git a/ReadMeW32.txt b/ReadMeW32.txt new file mode 100755 index 0000000..fc2f36b --- /dev/null +++ b/ReadMeW32.txt @@ -0,0 +1,151 @@ +To install TclCurl in Windows you simply have to double-click on the 'SetUp.tcl' +file, provided you already have Tcl/Tk installed, the script will take care of +everything. + +By the way, Tcl's console doesn't seem to like the output sent by TclCurl, +for example, if you type: + +curl::transfer -url www.scriptics.com + +you will only get an error, you will have to dump it to a file with the +'file' option, read it in to a variable with 'bodyvar', use Cygwin's console +or use tkCon from msys-mingw. + + +Compiling TclCurl in Windows + + +First of all a little disclaimer: + +I know nothing about Windows programming, no kidding, not a thing, +zip, zilch, nada. I can barely manage using tools, like Tcl/Tk and +gcc, whose origin is in the Unix world, but that is just about it, so +if you think that the following is just plain stupid, that is because +it probably is, but in that case, don't forget to tell me all about it. + +To compile TclCurl in Windows you are going to need several things: + + - A msys-mingw enviroment, you can get it at SourceForge: + + http://sourceforge.net/projects/tcl/ + + or you can get MinGW and Msys from their project page: + + http://sourceforge.net/projects/mingw/ + + - Since you are already at Tcl's page at SF, you can download the + lastest Tcl version, 8.4.13 at this writing. (These instructions won't + work with 8.3.x versions) + + - Download zlib from http://www.gzip.org/zlib/ + + - Download bc from http://gnuwin32.sourceforge.net/packages/bc.htm and + install it. + + - Extract Tcl, cURL, zlib and TclCurl in the same directory. + + - Copy the 'tclcurl.mk' file in TclCurl/packages/windows to this directory. + + - Start msys, go to the directory and type: + + $ make -f tclcurl.mk tclcurl-plain + + This command will compile and install Tcl, zlib, cURL and TclCurl, if + you want to have Tk though, you will have to install it yourself. + + After compiling and installing all the elements, the make file will + try to create the self-extracting archive using 'rar', if you don't + have it installed it will fail, but don't worry, everything is already + installed. If you have rar and you want to create the archives, don't + forget to change the path at the end of the make file. + + - If you want to use TclCurl with the Tcl/Tk you have installed in + c:\Program Files or anywhere else, copy the directory + '/usr/local/lib/tclcurl0.110' to 'c:\Program Files\Tcl\lib' + + - And now you should have a working TclCurl, run Tcl/Tk and type: + + $ package require TclCurl. + + Tcl should return TclCurl's version, if it doesn't something went wrong, + could you please tell me? + + - Wish console doesn't really like TclCurl, so if you do: + + $ curl::transfer -url slashdot.org + + It will return a '0' to tell you that the transfer was successful, but it will + show you nothing, you will have to dump the page into a file to be able to read + it or use Cygwin's console. + + + +Compiling TclCurl with threads support + +You have to do basically the same thing, except that the command to compile is: + + $ make -f tclcurl.mk tclcurl-threaded + + +Compiling TclCurl with SSL support + +To prevent patent trouble, the SSL enabled binaries don't support the idea, rc5 and mdc2 +algorithms, if you need them, and you are allowed to do so, you can compile them yourself. + + + - First of all you have to compile Openssl, you can get the lastest version + at http://www.openssl.org, these instructions should work with version 0.9.8e + + - To compile it you are going to need Perl in your system, for whatever the reason + I couldn't get it to work with the Perl that comes with Cygwin, so I had to + download ActivePerl: http://www.activestate.com. + + - You will also need to download the MinGW compiler, the compiling scripts don't + like the msys enviroment though. + + - The open a MS-DOS console in the openssl directory and make sure that both + perl and mingw are in you path: + + c:\openssl-0.9.8e\> echo %PATH% + + if they aren't add them: + + c:\openssl-0.9.8e\> PATH=%PATH%;C:\Perl\bin;c:\MinGW\bin + + change the paths if you need to. + + - Only thing left is to type in the MS-DOS console: + + c:\openssl-0.9.8e\> ms\mingw32.bat + + and hope for the best. + + - After it compiles you have to copy some files around: + + - libcryto.a, libeay32.a, libssl.a and libssl32.a from + openssl-0.9.8e\out to c:\msys\local\lib. + + - libeay32.dll and libssl32.dll from openssl-0.9.8e to + c:\msys\local\lib and c:\msys\local\bin. + + - The contents of openssl-0.9.8e\outinc to c:\msys\local\include. + + - Now copy the 'tclcurl.mk' file from TclCurl/packages/windows to + the directory in which you have TclCurl, Tcl, cURL, TclCurl and OpenSSL. + + - $ make -f tclcurl.mk tclcurl-ssl + + - If you want to have threads support: + + - $ make -f tclcurl.mk tclcurl-threaded-ssl + +Sounds like a lot of work to run a little extension, but then again, you could +have downloaded the self-extracting archive file. + + +Share the wonders, +Andres +fandom@telefonica.net + + + diff --git a/ToDo.txt b/ToDo.txt new file mode 100755 index 0000000..0de6df4 --- /dev/null +++ b/ToDo.txt @@ -0,0 +1,18 @@ + +Even though the extension is already quite functional, there are many +things to improve: + + + - Automatic test suite. + + - Ports to as many OS as possible. + + - Whatever you suggest. + + +I specially need help about porting, I guess it should work wherever Tcl and +cURL are already present, I would be grateful for any feedback about where +it does or doesn't work. + +Andres +fandom@telefonica.net diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100755 index 0000000..0b05739 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,9 @@ +# +# Include the TEA standard macro set +# + +builtin(include,tclconfig/tcl.m4) + +# +# Add here whatever m4 macros you want to define for your package +# diff --git a/autom4te.cache/output.0 b/autom4te.cache/output.0 new file mode 100644 index 0000000..7a11280 --- /dev/null +++ b/autom4te.cache/output.0 @@ -0,0 +1,12598 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.63 for TclCurl 7.19.6. +@%:@ +@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +@%:@ 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME='TclCurl' +PACKAGE_TARNAME='tclcurl' +PACKAGE_VERSION='7.19.6' +PACKAGE_STRING='TclCurl 7.19.6' +PACKAGE_BUGREPORT='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='LTLIBOBJS +TCLSH_PROG +RANLIB_STUB +MAKE_STUB_LIB +MAKE_STATIC_LIB +MAKE_SHARED_LIB +MAKE_LIB +TCL_DBGX +LDFLAGS_DEFAULT +CFLAGS_DEFAULT +LD_LIBRARY_PATH_VAR +SHLIB_CFLAGS +SHLIB_LD_LIBS +SHLIB_LD +STLIB_LD +CFLAGS_WARNING +CFLAGS_OPTIMIZE +CFLAGS_DEBUG +DL_LIBS +LIB@&t@OBJS +CELIB_DIR +AR +SHARED_BUILD +TCL_THREADS +TCL_INCLUDES +CLEANFILES +curl +TCLCURL_SCRIPTS +PKG_OBJECTS +PKG_SOURCES +MATH_LIBS +EGREP +GREP +RANLIB +SET_MAKE +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +CPP +OBJEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +TCL_SHLIB_LD_LIBS +TCL_LD_FLAGS +TCL_EXTRA_CFLAGS +TCL_DEFS +TCL_LIBS +TCL_STUB_LIB_SPEC +TCL_STUB_LIB_FLAG +TCL_STUB_LIB_FILE +TCL_LIB_SPEC +TCL_LIB_FLAG +TCL_LIB_FILE +TCL_SRC_DIR +TCL_BIN_DIR +TCL_VERSION +PKG_CFLAGS +PKG_LIBS +PKG_INCLUDES +PKG_HEADERS +PKG_TCL_SOURCES +PKG_STUB_OBJECTS +PKG_STUB_SOURCES +PKG_STUB_LIB_FILE +PKG_LIB_FILE +EXEEXT +CYGPATH +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_tcl +with_curlprefix +with_curlinclude +with_libcurl +with_tclinclude +enable_threads +enable_shared +enable_64bit +enable_64bit_vis +enable_rpath +enable_wince +with_celib +enable_load +enable_symbols +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { $as_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 && + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures TclCurl 7.19.6 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/tclcurl@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of TclCurl 7.19.6:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-threads build with threads + --enable-shared build and link with shared libraries (default: on) + --enable-64bit enable 64bit support (default: off) + --enable-64bit-vis enable 64bit Sparc VIS support (default: off) + --disable-rpath disable rpath support (default: on) + --enable-wince enable Win/CE support (where applicable) + --enable-load allow dynamic loading and "load" command (default: + on) + --enable-symbols build with debugging symbols (default: off) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-tcl directory containing tcl configuration + (tclConfig.sh) + --with-curlprefix base directory for the cURL install '/usr', '/usr/local',... + --with-curlinclude directory containing the public libcurl header files + --with-libcurl directory containing libcurl + --with-tclinclude directory containing the public Tcl header files + --with-celib=DIR use Windows/CE support library from DIR + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +TclCurl configure 7.19.6 +generated by GNU Autoconf 2.63 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by TclCurl $as_me 7.19.6, which was +generated by GNU Autoconf 2.63. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +@%:@@%:@ --------- @%:@@%:@ +@%:@@%:@ Platform. @%:@@%:@ +@%:@@%:@ --------- @%:@@%:@ + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +@%:@@%:@ ----------- @%:@@%:@ +@%:@@%:@ Core tests. @%:@@%:@ +@%:@@%:@ ----------- @%:@@%:@ + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +@%:@@%:@ ---------------- @%:@@%:@ +@%:@@%:@ Cache variables. @%:@@%:@ +@%:@@%:@ ---------------- @%:@@%:@ +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +@%:@@%:@ ----------------- @%:@@%:@ +@%:@@%:@ Output variables. @%:@@%:@ +@%:@@%:@ ----------------- @%:@@%:@ +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +@%:@@%:@ ------------------- @%:@@%:@ +@%:@@%:@ File substitutions. @%:@@%:@ +@%:@@%:@ ------------------- @%:@@%:@ +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +@%:@@%:@ ----------- @%:@@%:@ +@%:@@%:@ confdefs.h. @%:@@%:@ +@%:@@%:@ ----------- @%:@@%:@ +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test -r "$ac_site_file"; then + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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 + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +#-------------------------------------------------------------------- +# Call TEA_INIT as the first TEA_ macro to set up initial vars. +# This will define a ${TEA_PLATFORM} variable == "unix" or "windows" +# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. +#-------------------------------------------------------------------- + + + # TEA extensions pass this us the version of TEA they think they + # are compatible with. + TEA_VERSION="3.7" + + { $as_echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 +$as_echo_n "checking for correct TEA configuration... " >&6; } + if test x"${PACKAGE_NAME}" = x ; then + { { $as_echo "$as_me:$LINENO: error: +The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 +$as_echo "$as_me: error: +The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} + { (exit 1); exit 1; }; } + fi + if test x"3.7" = x ; then + { { $as_echo "$as_me:$LINENO: error: +TEA version not specified." >&5 +$as_echo "$as_me: error: +TEA version not specified." >&2;} + { (exit 1); exit 1; }; } + elif test "3.7" != "${TEA_VERSION}" ; then + { $as_echo "$as_me:$LINENO: result: warning: requested TEA version \"3.7\", have \"${TEA_VERSION}\"" >&5 +$as_echo "warning: requested TEA version \"3.7\", have \"${TEA_VERSION}\"" >&6; } + else + { $as_echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 +$as_echo "ok (TEA ${TEA_VERSION})" >&6; } + fi + case "`uname -s`" in + *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) + # Extract the first word of "cygpath", so it can be a program name with args. +set dummy cygpath; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CYGPATH+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CYGPATH"; then + ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CYGPATH="cygpath -w" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" +fi +fi +CYGPATH=$ac_cv_prog_CYGPATH +if test -n "$CYGPATH"; then + { $as_echo "$as_me:$LINENO: result: $CYGPATH" >&5 +$as_echo "$CYGPATH" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + EXEEXT=".exe" + TEA_PLATFORM="windows" + ;; + *) + CYGPATH=echo + EXEEXT="" + TEA_PLATFORM="unix" + ;; + esac + + # Check if exec_prefix is set. If not use fall back to prefix. + # Note when adjusted, so that TEA_PREFIX can correct for this. + # This is needed for recursive configures, since autoconf propagates + # $prefix, but not $exec_prefix (doh!). + if test x$exec_prefix = xNONE ; then + exec_prefix_default=yes + exec_prefix=$prefix + fi + + + + + # This package name must be replaced statically for AC_SUBST to work + + # Substitute STUB_LIB_FILE in case package creates a stub library too. + + + # We AC_SUBST these here to ensure they are subst'ed, + # in case the user doesn't call TEA_ADD_... + + + + + + + + + +ac_aux_dir= +for ac_dir in tclconfig "$srcdir"/tclconfig; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in tclconfig \"$srcdir\"/tclconfig" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in tclconfig \"$srcdir\"/tclconfig" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + +#-------------------------------------------------------------------- +# Load the tclConfig.sh file +#-------------------------------------------------------------------- + + + + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + +@%:@ Check whether --with-tcl was given. +if test "${with_tcl+set}" = set; then + withval=$with_tcl; with_tclconfig=${withval} +fi + + { $as_echo "$as_me:$LINENO: checking for Tcl configuration" >&5 +$as_echo_n "checking for Tcl configuration... " >&6; } + if test "${ac_cv_c_tclconfig+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + case ${with_tclconfig} in + */tclConfig.sh ) + if test -f ${with_tclconfig}; then + { $as_echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 +$as_echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} + with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + { { $as_echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 +$as_echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test "${TEA_PLATFORM}" = "windows" \ + -a -f "$i/win/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/win; pwd)` + break + fi + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tcl.framework/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` + break + fi + done + fi + + # TEA specific: on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test "${TEA_PLATFORM}" = "windows" \ + -a -f "$i/win/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/win; pwd)` + break + fi + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + +fi + + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + { { $as_echo "$as_me:$LINENO: error: Can't find Tcl configuration definitions" >&5 +$as_echo "$as_me: error: Can't find Tcl configuration definitions" >&2;} + { (exit 1); exit 1; }; } + else + no_tcl= + TCL_BIN_DIR=${ac_cv_c_tclconfig} + { $as_echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 +$as_echo "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; } + fi + fi + + + { $as_echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 +$as_echo_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... " >&6; } + + if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then + { $as_echo "$as_me:$LINENO: result: loading" >&5 +$as_echo "loading" >&6; } + . "${TCL_BIN_DIR}/tclConfig.sh" + else + { $as_echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 +$as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tcl.framework installed in an arbitrary location. + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then + for i in "`cd ${TCL_BIN_DIR}; pwd`" \ + "`cd ${TCL_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then + TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" + break + fi + done + fi + if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then + TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" + TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + + + + + + + + + + + + + # TEA specific: + + + + + + + +#-------------------------------------------------------------------- +# Load the tkConfig.sh file if necessary (Tk extension) +#-------------------------------------------------------------------- + +#TEA_PATH_TKCONFIG +#TEA_LOAD_TKCONFIG + +#----------------------------------------------------------------------- +# Handle the --prefix=... option by defaulting to what Tcl gave. +# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. +#----------------------------------------------------------------------- + + + if test "${prefix}" = "NONE"; then + prefix_default=yes + if test x"${TCL_PREFIX}" != x; then + { $as_echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 +$as_echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} + prefix=${TCL_PREFIX} + else + { $as_echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 +$as_echo "$as_me: --prefix defaulting to /usr/local" >&6;} + prefix=/usr/local + fi + fi + if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ + -o x"${exec_prefix_default}" = x"yes" ; then + if test x"${TCL_EXEC_PREFIX}" != x; then + { $as_echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 +$as_echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} + exec_prefix=${TCL_EXEC_PREFIX} + else + { $as_echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 +$as_echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} + exec_prefix=$prefix + fi + fi + + +#----------------------------------------------------------------------- +# Standard compiler checks. +# This sets up CC by using the CC env var, or looks for gcc otherwise. +# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create +# the basic setup necessary to compile executables. +#----------------------------------------------------------------------- + + + # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) + # in this macro, they need to go into TEA_SETUP_COMPILER instead. + + # If the user did not set CFLAGS, set it now to keep + # the AC_PROG_CC macro from adding "-g -O2". + if test "${CFLAGS+set}" != "set" ; then + CFLAGS="" + 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 +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $@%:@ != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +$as_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. +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_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.out.dSYM 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. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +if test -z "$ac_file"; then + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; }; } +fi + +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_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 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_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 +$as_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 +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +$as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +$as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + 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 +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +$as_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 + + + # 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. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + +done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + + #-------------------------------------------------------------------- + # Checks to see if the make program sets the $MAKE variable. + #-------------------------------------------------------------------- + + { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + + #-------------------------------------------------------------------- + # Find ranlib + #-------------------------------------------------------------------- + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + #-------------------------------------------------------------------- + # Determines the correct binary file extension (.o, .obj, .exe etc.) + #-------------------------------------------------------------------- + + + + + + +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +@%:@define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +@%:@include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. + + + #------------------------------------------------------------------------ + # If we're using GCC, see if the compiler understands -pipe. If so, use it. + # It makes compiling go faster. (This is only a performance feature.) + #------------------------------------------------------------------------ + + if test -z "$no_pipe" -a -n "$GCC"; then + { $as_echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 +$as_echo_n "checking if the compiler understands -pipe... " >&6; } +if test "${tcl_cv_cc_pipe+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_cc_pipe=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_cc_pipe=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 +$as_echo "$tcl_cv_cc_pipe" >&6; } + if test $tcl_cv_cc_pipe = yes; then + CFLAGS="$CFLAGS -pipe" + fi + fi + + #-------------------------------------------------------------------- + # Common compiler flag setup + #-------------------------------------------------------------------- + + + { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + # Check for potential -arch flags. It is not universal unless + # there are some -arch flags. Note that *ppc* also matches + # ppc64. This check is also rather less than ideal. + case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( + *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; + esac +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_bigendian=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_bigendian=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then + # Try to guess by grepping values from an object file. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + cat >>confdefs.h <<\_ACEOF +@%:@define WORDS_BIGENDIAN 1 +_ACEOF +;; #( + no) + ;; #( + universal) + +cat >>confdefs.h <<\_ACEOF +@%:@define AC_APPLE_UNIVERSAL_BUILD 1 +_ACEOF + + ;; #( + *) + { { $as_echo "$as_me:$LINENO: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +$as_echo "$as_me: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; + esac + + if test "${TEA_PLATFORM}" = "unix" ; then + + #-------------------------------------------------------------------- + # On a few very rare systems, all of the libm.a stuff is + # already in libc.a. Set compiler flags accordingly. + # Also, Linux requires the "ieee" library for math to work + # right (and it must appear before "-lm"). + #-------------------------------------------------------------------- + + { $as_echo "$as_me:$LINENO: checking for sin" >&5 +$as_echo_n "checking for sin... " >&6; } +if test "${ac_cv_func_sin+set}" = set; then + $as_echo_n "(cached) " >&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 sin to an innocuous variant, in case declares sin. + For example, HP-UX 11i declares gettimeofday. */ +#define sin innocuous_sin + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char sin (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef sin + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sin (); +/* 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_sin || defined __stub___sin +choke me +#endif + +int +main () +{ +return sin (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_sin=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_sin=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 +$as_echo "$ac_cv_func_sin" >&6; } +if test "x$ac_cv_func_sin" = x""yes; then + MATH_LIBS="" +else + MATH_LIBS="-lm" +fi + + { $as_echo "$as_me:$LINENO: checking for main in -lieee" >&5 +$as_echo_n "checking for main in -lieee... " >&6; } +if test "${ac_cv_lib_ieee_main+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lieee $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_ieee_main=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ieee_main=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 +$as_echo "$ac_cv_lib_ieee_main" >&6; } +if test "x$ac_cv_lib_ieee_main" = x""yes; then + MATH_LIBS="-lieee $MATH_LIBS" +fi + + + #-------------------------------------------------------------------- + # Interactive UNIX requires -linet instead of -lsocket, plus it + # needs net/errno.h to define the socket-related error codes. + #-------------------------------------------------------------------- + + { $as_echo "$as_me:$LINENO: checking for main in -linet" >&5 +$as_echo_n "checking for main in -linet... " >&6; } +if test "${ac_cv_lib_inet_main+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-linet $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_inet_main=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_inet_main=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 +$as_echo "$ac_cv_lib_inet_main" >&6; } +if test "x$ac_cv_lib_inet_main" = x""yes; then + LIBS="$LIBS -linet" +fi + + if test "${ac_cv_header_net_errno_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for net/errno.h" >&5 +$as_echo_n "checking for net/errno.h... " >&6; } +if test "${ac_cv_header_net_errno_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 +$as_echo "$ac_cv_header_net_errno_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking net/errno.h usability" >&5 +$as_echo_n "checking net/errno.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +@%:@include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking net/errno.h presence" >&5 +$as_echo_n "checking net/errno.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for net/errno.h" >&5 +$as_echo_n "checking for net/errno.h... " >&6; } +if test "${ac_cv_header_net_errno_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_net_errno_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 +$as_echo "$ac_cv_header_net_errno_h" >&6; } + +fi +if test "x$ac_cv_header_net_errno_h" = x""yes; then + + +cat >>confdefs.h <<\_ACEOF +@%:@define HAVE_NET_ERRNO_H 1 +_ACEOF + +fi + + + + #-------------------------------------------------------------------- + # Check for the existence of the -lsocket and -lnsl libraries. + # The order here is important, so that they end up in the right + # order in the command line generated by make. Here are some + # special considerations: + # 1. Use "connect" and "accept" to check for -lsocket, and + # "gethostbyname" to check for -lnsl. + # 2. Use each function name only once: can't redo a check because + # autoconf caches the results of the last check and won't redo it. + # 3. Use -lnsl and -lsocket only if they supply procedures that + # aren't already present in the normal libraries. This is because + # IRIX 5.2 has libraries, but they aren't needed and they're + # bogus: they goof up name resolution if used. + # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. + # To get around this problem, check for both libraries together + # if -lsocket doesn't work by itself. + #-------------------------------------------------------------------- + + tcl_checkBoth=0 + { $as_echo "$as_me:$LINENO: checking for connect" >&5 +$as_echo_n "checking for connect... " >&6; } +if test "${ac_cv_func_connect+set}" = set; then + $as_echo_n "(cached) " >&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 connect to an innocuous variant, in case declares connect. + For example, HP-UX 11i declares gettimeofday. */ +#define connect innocuous_connect + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef connect + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char connect (); +/* 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_connect || defined __stub___connect +choke me +#endif + +int +main () +{ +return connect (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_connect=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_connect=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +$as_echo "$ac_cv_func_connect" >&6; } +if test "x$ac_cv_func_connect" = x""yes; then + tcl_checkSocket=0 +else + tcl_checkSocket=1 +fi + + if test "$tcl_checkSocket" = 1; then + { $as_echo "$as_me:$LINENO: checking for setsockopt" >&5 +$as_echo_n "checking for setsockopt... " >&6; } +if test "${ac_cv_func_setsockopt+set}" = set; then + $as_echo_n "(cached) " >&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 setsockopt to an innocuous variant, in case declares setsockopt. + For example, HP-UX 11i declares gettimeofday. */ +#define setsockopt innocuous_setsockopt + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char setsockopt (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef setsockopt + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char setsockopt (); +/* 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_setsockopt || defined __stub___setsockopt +choke me +#endif + +int +main () +{ +return setsockopt (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_setsockopt=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_setsockopt=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 +$as_echo "$ac_cv_func_setsockopt" >&6; } +if test "x$ac_cv_func_setsockopt" = x""yes; then + : +else + { $as_echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 +$as_echo_n "checking for setsockopt in -lsocket... " >&6; } +if test "${ac_cv_lib_socket_setsockopt+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char setsockopt (); +int +main () +{ +return setsockopt (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_socket_setsockopt=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_socket_setsockopt=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 +$as_echo "$ac_cv_lib_socket_setsockopt" >&6; } +if test "x$ac_cv_lib_socket_setsockopt" = x""yes; then + LIBS="$LIBS -lsocket" +else + tcl_checkBoth=1 +fi + +fi + + fi + if test "$tcl_checkBoth" = 1; then + tk_oldLibs=$LIBS + LIBS="$LIBS -lsocket -lnsl" + { $as_echo "$as_me:$LINENO: checking for accept" >&5 +$as_echo_n "checking for accept... " >&6; } +if test "${ac_cv_func_accept+set}" = set; then + $as_echo_n "(cached) " >&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 accept to an innocuous variant, in case declares accept. + For example, HP-UX 11i declares gettimeofday. */ +#define accept innocuous_accept + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char accept (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef accept + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char accept (); +/* 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_accept || defined __stub___accept +choke me +#endif + +int +main () +{ +return accept (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_accept=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_accept=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 +$as_echo "$ac_cv_func_accept" >&6; } +if test "x$ac_cv_func_accept" = x""yes; then + tcl_checkNsl=0 +else + LIBS=$tk_oldLibs +fi + + fi + { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5 +$as_echo_n "checking for gethostbyname... " >&6; } +if test "${ac_cv_func_gethostbyname+set}" = set; then + $as_echo_n "(cached) " >&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 gethostbyname to an innocuous variant, in case declares gethostbyname. + For example, HP-UX 11i declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef gethostbyname + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +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 +#endif + +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_gethostbyname=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_gethostbyname=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +$as_echo "$ac_cv_func_gethostbyname" >&6; } +if test "x$ac_cv_func_gethostbyname" = x""yes; then + : +else + { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_nsl_gethostbyname=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_nsl_gethostbyname=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then + LIBS="$LIBS -lnsl" +fi + +fi + + + # TEA specific: Don't perform the eval of the libraries here because + # DL_LIBS won't be set until we call TEA_CONFIG_CFLAGS + + TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' + + + + + { $as_echo "$as_me:$LINENO: checking dirent.h" >&5 +$as_echo_n "checking dirent.h... " >&6; } +if test "${tcl_cv_dirent_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ + +#ifndef _POSIX_SOURCE +# ifdef __Lynx__ + /* + * Generate compilation error to make the test fail: Lynx headers + * are only valid if really in the POSIX environment. + */ + + missing_procedure(); +# endif +#endif +DIR *d; +struct dirent *entryPtr; +char *p; +d = opendir("foobar"); +entryPtr = readdir(d); +p = entryPtr->d_name; +closedir(d); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_dirent_h=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_dirent_h=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 +$as_echo "$tcl_cv_dirent_h" >&6; } + + if test $tcl_cv_dirent_h = no; then + +cat >>confdefs.h <<\_ACEOF +@%:@define NO_DIRENT_H 1 +_ACEOF + + fi + + # TEA specific: + if test "${ac_cv_header_errno_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for errno.h" >&5 +$as_echo_n "checking for errno.h... " >&6; } +if test "${ac_cv_header_errno_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 +$as_echo "$ac_cv_header_errno_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking errno.h usability" >&5 +$as_echo_n "checking errno.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +@%:@include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking errno.h presence" >&5 +$as_echo_n "checking errno.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for errno.h" >&5 +$as_echo_n "checking for errno.h... " >&6; } +if test "${ac_cv_header_errno_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_errno_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 +$as_echo "$ac_cv_header_errno_h" >&6; } + +fi +if test "x$ac_cv_header_errno_h" = x""yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +@%:@define NO_ERRNO_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_float_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for float.h" >&5 +$as_echo_n "checking for float.h... " >&6; } +if test "${ac_cv_header_float_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 +$as_echo "$ac_cv_header_float_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking float.h usability" >&5 +$as_echo_n "checking float.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +@%:@include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking float.h presence" >&5 +$as_echo_n "checking float.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for float.h" >&5 +$as_echo_n "checking for float.h... " >&6; } +if test "${ac_cv_header_float_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_float_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 +$as_echo "$ac_cv_header_float_h" >&6; } + +fi +if test "x$ac_cv_header_float_h" = x""yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +@%:@define NO_FLOAT_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_values_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for values.h" >&5 +$as_echo_n "checking for values.h... " >&6; } +if test "${ac_cv_header_values_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 +$as_echo "$ac_cv_header_values_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking values.h usability" >&5 +$as_echo_n "checking values.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +@%:@include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking values.h presence" >&5 +$as_echo_n "checking values.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for values.h" >&5 +$as_echo_n "checking for values.h... " >&6; } +if test "${ac_cv_header_values_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_values_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 +$as_echo "$ac_cv_header_values_h" >&6; } + +fi +if test "x$ac_cv_header_values_h" = x""yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +@%:@define NO_VALUES_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_limits_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for limits.h" >&5 +$as_echo_n "checking for limits.h... " >&6; } +if test "${ac_cv_header_limits_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 +$as_echo "$ac_cv_header_limits_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking limits.h usability" >&5 +$as_echo_n "checking limits.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +@%:@include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking limits.h presence" >&5 +$as_echo_n "checking limits.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for limits.h" >&5 +$as_echo_n "checking for limits.h... " >&6; } +if test "${ac_cv_header_limits_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_limits_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 +$as_echo "$ac_cv_header_limits_h" >&6; } + +fi +if test "x$ac_cv_header_limits_h" = x""yes; then + +cat >>confdefs.h <<\_ACEOF +@%:@define HAVE_LIMITS_H 1 +_ACEOF + +else + +cat >>confdefs.h <<\_ACEOF +@%:@define NO_LIMITS_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_stdlib_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for stdlib.h" >&5 +$as_echo_n "checking for stdlib.h... " >&6; } +if test "${ac_cv_header_stdlib_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +$as_echo "$ac_cv_header_stdlib_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking stdlib.h usability" >&5 +$as_echo_n "checking stdlib.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +@%:@include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking stdlib.h presence" >&5 +$as_echo_n "checking stdlib.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for stdlib.h" >&5 +$as_echo_n "checking for stdlib.h... " >&6; } +if test "${ac_cv_header_stdlib_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_stdlib_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +$as_echo "$ac_cv_header_stdlib_h" >&6; } + +fi +if test "x$ac_cv_header_stdlib_h" = x""yes; then + tcl_ok=1 +else + tcl_ok=0 +fi + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtol" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtoul" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtod" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + if test $tcl_ok = 0; then + +cat >>confdefs.h <<\_ACEOF +@%:@define NO_STDLIB_H 1 +_ACEOF + + fi + if test "${ac_cv_header_string_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for string.h" >&5 +$as_echo_n "checking for string.h... " >&6; } +if test "${ac_cv_header_string_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 +$as_echo "$ac_cv_header_string_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking string.h usability" >&5 +$as_echo_n "checking string.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +@%:@include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking string.h presence" >&5 +$as_echo_n "checking string.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for string.h" >&5 +$as_echo_n "checking for string.h... " >&6; } +if test "${ac_cv_header_string_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_string_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 +$as_echo "$ac_cv_header_string_h" >&6; } + +fi +if test "x$ac_cv_header_string_h" = x""yes; then + tcl_ok=1 +else + tcl_ok=0 +fi + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strstr" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strerror" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + + # See also memmove check below for a place where NO_STRING_H can be + # set and why. + + if test $tcl_ok = 0; then + +cat >>confdefs.h <<\_ACEOF +@%:@define NO_STRING_H 1 +_ACEOF + + fi + + if test "${ac_cv_header_sys_wait_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for sys/wait.h" >&5 +$as_echo_n "checking for sys/wait.h... " >&6; } +if test "${ac_cv_header_sys_wait_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +$as_echo "$ac_cv_header_sys_wait_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 +$as_echo_n "checking sys/wait.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +@%:@include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 +$as_echo_n "checking sys/wait.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for sys/wait.h" >&5 +$as_echo_n "checking for sys/wait.h... " >&6; } +if test "${ac_cv_header_sys_wait_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_sys_wait_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +$as_echo "$ac_cv_header_sys_wait_h" >&6; } + +fi +if test "x$ac_cv_header_sys_wait_h" = x""yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +@%:@define NO_SYS_WAIT_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_dlfcn_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for dlfcn.h" >&5 +$as_echo_n "checking for dlfcn.h... " >&6; } +if test "${ac_cv_header_dlfcn_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 +$as_echo "$ac_cv_header_dlfcn_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 +$as_echo_n "checking dlfcn.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +@%:@include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 +$as_echo_n "checking dlfcn.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for dlfcn.h" >&5 +$as_echo_n "checking for dlfcn.h... " >&6; } +if test "${ac_cv_header_dlfcn_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_dlfcn_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 +$as_echo "$ac_cv_header_dlfcn_h" >&6; } + +fi +if test "x$ac_cv_header_dlfcn_h" = x""yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +@%:@define NO_DLFCN_H 1 +_ACEOF + +fi + + + + # OS/390 lacks sys/param.h (and doesn't need it, by chance). + +for ac_header in sys/param.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +@%:@include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + # Let the user call this, because if it triggers, they will + # need a compat/strtod.c that is correct. Users can also + # use Tcl_GetDouble(FromObj) instead. + #TEA_BUGGY_STRTOD + fi + + +#----------------------------------------------------------------------- +# __CHANGE__ +# Specify the C source files to compile in TEA_ADD_SOURCES, +# public headers that need to be installed in TEA_ADD_HEADERS, +# stub library C source files to compile in TEA_ADD_STUB_SOURCES, +# and runtime Tcl library files in TEA_ADD_TCL_SOURCES. +# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS +# and PKG_TCL_SOURCES. +#----------------------------------------------------------------------- + + + vars="tclcurl.c multi.c" + for i in $vars; do + case $i in + \$*) + # allow $-var names + PKG_SOURCES="$PKG_SOURCES $i" + PKG_OBJECTS="$PKG_OBJECTS $i" + ;; + *) + # check for existence - allows for generic/win/unix VPATH + # To add more dirs here (like 'src'), you have to update VPATH + # in Makefile.in as well + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + { { $as_echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 +$as_echo "$as_me: error: could not find source file '$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_SOURCES="$PKG_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" + fi + PKG_OBJECTS="$PKG_OBJECTS $j" + ;; + esac + done + + + +TCLCURL_SCRIPTS=tclcurl.tcl + + +#-------------------------------------------------------------------- +# Find libcurl, if it's not present, it makes no sense to compile +# this. +#-------------------------------------------------------------------- + + +@%:@ Check whether --with-curlprefix was given. +if test "${with_curlprefix+set}" = set; then + withval=$with_curlprefix; + curlprefix=$withval + curlpath=$curlprefix/bin + # Extract the first word of "curl", so it can be a program name with args. +set dummy curl; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_curl+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$curl"; then + ac_cv_prog_curl="$curl" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $curlpath +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_curl="yes" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_curl" && ac_cv_prog_curl="no" +fi +fi +curl=$ac_cv_prog_curl +if test -n "$curl"; then + { $as_echo "$as_me:$LINENO: result: $curl" >&5 +$as_echo "$curl" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$curl" = xno ; then + { { $as_echo "$as_me:$LINENO: error: can not find cURL in $curlpath" >&5 +$as_echo "$as_me: error: can not find cURL in $curlpath" >&2;} + { (exit 1); exit 1; }; } + fi + +else + + # Extract the first word of "curl-config", so it can be a program name with args. +set dummy curl-config; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_curl+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$curl"; then + ac_cv_prog_curl="$curl" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_curl="yes" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_curl" && ac_cv_prog_curl="no" +fi +fi +curl=$ac_cv_prog_curl +if test -n "$curl"; then + { $as_echo "$as_me:$LINENO: result: $curl" >&5 +$as_echo "$curl" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$curl" = xno ; then + { { $as_echo "$as_me:$LINENO: error: can not find cURL or libcurl... go to http://curl.haxx.se/ to download and then install it first" >&5 +$as_echo "$as_me: error: can not find cURL or libcurl... go to http://curl.haxx.se/ to download and then install it first" >&2;} + { (exit 1); exit 1; }; } + else + curlprefix=`curl-config --prefix` + curlpath=$curlprefix/bin + fi + +fi + + + +@%:@ Check whether --with-curlinclude was given. +if test "${with_curlinclude+set}" = set; then + withval=$with_curlinclude; + + vars="-I$withval" + for i in $vars; do + PKG_INCLUDES="$PKG_INCLUDES $i" + done + + + curlinclude=$withval + +else + + + vars="-I$curlprefix/include" + for i in $vars; do + PKG_INCLUDES="$PKG_INCLUDES $i" + done + + + curlinclude=$curlprefix/include + +fi + + +if test "${ac_cv_header_curl_curl_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for curl/curl.h" >&5 +$as_echo_n "checking for curl/curl.h... " >&6; } +if test "${ac_cv_header_curl_curl_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_curl_curl_h" >&5 +$as_echo "$ac_cv_header_curl_curl_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking curl/curl.h usability" >&5 +$as_echo_n "checking curl/curl.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +@%:@include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking curl/curl.h presence" >&5 +$as_echo_n "checking curl/curl.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +@%:@include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for curl/curl.h" >&5 +$as_echo_n "checking for curl/curl.h... " >&6; } +if test "${ac_cv_header_curl_curl_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_curl_curl_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_curl_curl_h" >&5 +$as_echo "$ac_cv_header_curl_curl_h" >&6; } + +fi +if test "x$ac_cv_header_curl_curl_h" = x""yes; then + headercurl=yes +else + headercurl=no +fi + + +if test "x$headercurl" = xno ; then + { $as_echo "$as_me:$LINENO: checking checking for headers at $curlinclude" >&5 +$as_echo_n "checking checking for headers at $curlinclude... " >&6; } + if test ! -r $curlinclude/curl/curl.h ; then + { { $as_echo "$as_me:$LINENO: error: cURL headers not found, you may need to install a curl-devel package" >&5 +$as_echo "$as_me: error: cURL headers not found, you may need to install a curl-devel package" >&2;} + { (exit 1); exit 1; }; } + fi + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } +fi + + +@%:@ Check whether --with-libcurl was given. +if test "${with_libcurl+set}" = set; then + withval=$with_libcurl; + + vars="-L$withval" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + +else + + + vars="-L$curlprefix/lib" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + +fi + + +{ $as_echo "$as_me:$LINENO: checking if libcurl version is recent enough" >&5 +$as_echo_n "checking if libcurl version is recent enough... " >&6; } +CURL_VERSION=`$curlpath/curl-config --checkfor 7.19.6` +if test "${CURL_VERSION}" != "" ; then + echo ${CURL_VERSION} + { { $as_echo "$as_me:$LINENO: error: libcurl version too old, please upgrade" >&5 +$as_echo "$as_me: error: libcurl version too old, please upgrade" >&2;} + { (exit 1); exit 1; }; } +fi +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + + + vars="`$curlpath/curl-config --libs`" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_sample in this case) so +# that we create the export library with the dll. +# +# Windows creates a few extra files that need to be cleaned up. +# You can add more files to clean if your extension creates any extra +# files. +# +# TEA_ADD_* any platform specific compiler/build info here. +#-------------------------------------------------------------------- + +# Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure +# and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var. +#CLEANFILES="pkgIndex.tcl" +if test "${TEA_PLATFORM}" = "windows" ; then + +cat >>confdefs.h <<\_ACEOF +@%:@define BUILD_sample 1 +_ACEOF + + CLEANFILES="$CLEANFILES *.lib *.dll *.exp *.ilk *.pdb vc*.pch" + #TEA_ADD_SOURCES([win/winFile.c]) + #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) +else + # Ensure no empty else clauses + : + #TEA_ADD_SOURCES([unix/unixFile.c]) + #TEA_ADD_LIBS([-lsuperfly]) +fi + + +#-------------------------------------------------------------------- +# __CHANGE__ +# Choose which headers you need. Extension authors should try very +# hard to only rely on the Tcl public header files. Internal headers +# contain private data structures and are subject to change without +# notice. +# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG +#-------------------------------------------------------------------- + + + { $as_echo "$as_me:$LINENO: checking for Tcl public headers" >&5 +$as_echo_n "checking for Tcl public headers... " >&6; } + + +@%:@ Check whether --with-tclinclude was given. +if test "${with_tclinclude+set}" = set; then + withval=$with_tclinclude; with_tclinclude=${withval} +fi + + + if test "${ac_cv_c_tclh+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + # Use the value from --with-tclinclude, if it was given + + if test x"${with_tclinclude}" != x ; then + if test -f "${with_tclinclude}/tcl.h" ; then + ac_cv_c_tclh=${with_tclinclude} + else + { { $as_echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 +$as_echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} + { (exit 1); exit 1; }; } + fi + else + list="" + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers directory + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tcl is not installed, + # and in that situation, look there before installed locations. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + if test x"${TCL_INCLUDE_SPEC}" != x ; then + d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` + list="$list `ls -d ${d} 2>/dev/null`" + fi + fi + for i in $list ; do + if test -f "$i/tcl.h" ; then + ac_cv_c_tclh=$i + break + fi + done + fi + +fi + + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tclh}" = x ; then + { { $as_echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 +$as_echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} + { (exit 1); exit 1; }; } + else + { $as_echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 +$as_echo "${ac_cv_c_tclh}" >&6; } + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` + + TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + + +#TEA_PRIVATE_TCL_HEADERS + +#TEA_PUBLIC_TK_HEADERS +#TEA_PRIVATE_TK_HEADERS +#TEA_PATH_X + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +# This auto-enables if Tcl was compiled threaded. +#-------------------------------------------------------------------- + + + @%:@ Check whether --enable-threads was given. +if test "${enable_threads+set}" = set; then + enableval=$enable_threads; tcl_ok=$enableval +else + tcl_ok=yes +fi + + + if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then + TCL_THREADS=1 + + if test "${TEA_PLATFORM}" != "windows" ; then + # We are always OK on Windows, so check what this platform wants: + + # USE_THREAD_ALLOC tells us to try the special thread-based + # allocator that significantly reduces lock contention + +cat >>confdefs.h <<\_ACEOF +@%:@define USE_THREAD_ALLOC 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +@%:@define _REENTRANT 1 +_ACEOF + + if test "`uname -s`" = "SunOS" ; then + +cat >>confdefs.h <<\_ACEOF +@%:@define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + fi + +cat >>confdefs.h <<\_ACEOF +@%:@define _THREAD_SAFE 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 +$as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } +if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_mutex_init (); +int +main () +{ +return pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_pthread_pthread_mutex_init=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_pthread_pthread_mutex_init=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_pthread_pthread_mutex_init" = x""yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "no"; then + # Check a little harder for __pthread_mutex_init in the same + # library, as some systems hide it there until pthread.h is + # defined. We could alternatively do an AC_TRY_COMPILE with + # pthread.h, but that will work with libpthread really doesn't + # exist, like AIX 4.2. [Bug: 4359] + { $as_echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 +$as_echo_n "checking for __pthread_mutex_init in -lpthread... " >&6; } +if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char __pthread_mutex_init (); +int +main () +{ +return __pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_pthread___pthread_mutex_init=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_pthread___pthread_mutex_init=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_pthread___pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_pthread___pthread_mutex_init" = x""yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthread" + else + { $as_echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 +$as_echo_n "checking for pthread_mutex_init in -lpthreads... " >&6; } +if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthreads $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_mutex_init (); +int +main () +{ +return pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_pthreads_pthread_mutex_init=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_pthreads_pthread_mutex_init=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = x""yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthreads" + else + { $as_echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 +$as_echo_n "checking for pthread_mutex_init in -lc... " >&6; } +if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_mutex_init (); +int +main () +{ +return pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_c_pthread_mutex_init=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_c_pthread_mutex_init=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_c_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_c_pthread_mutex_init" = x""yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "no"; then + { $as_echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 +$as_echo_n "checking for pthread_mutex_init in -lc_r... " >&6; } +if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc_r $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_mutex_init (); +int +main () +{ +return pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_c_r_pthread_mutex_init=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_c_r_pthread_mutex_init=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_c_r_pthread_mutex_init" = x""yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -pthread" + else + TCL_THREADS=0 + { $as_echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 +$as_echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;} + fi + fi + fi + fi + fi + else + TCL_THREADS=0 + fi + # Do checking message here to not mess up interleaved configure output + { $as_echo "$as_me:$LINENO: checking for building with threads" >&5 +$as_echo_n "checking for building with threads... " >&6; } + if test "${TCL_THREADS}" = 1; then + +cat >>confdefs.h <<\_ACEOF +@%:@define TCL_THREADS 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: yes (default)" >&5 +$as_echo "yes (default)" >&6; } + else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + fi + # TCL_THREADS sanity checking. See if our request for building with + # threads is the same as the way Tcl was built. If not, warn the user. + case ${TCL_DEFS} in + *THREADS=1*) + if test "${TCL_THREADS}" = "0"; then + { $as_echo "$as_me:$LINENO: WARNING: + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads." >&5 +$as_echo "$as_me: WARNING: + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads." >&2;} + fi + ;; + *) + if test "${TCL_THREADS}" = "1"; then + { $as_echo "$as_me:$LINENO: WARNING: + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core." >&5 +$as_echo "$as_me: WARNING: + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core." >&2;} + fi + ;; + esac + + + +#-------------------------------------------------------------------- +# The statement below defines a collection of symbols related to +# building as a shared library instead of a static library. +#-------------------------------------------------------------------- + + + { $as_echo "$as_me:$LINENO: checking how to build libraries" >&5 +$as_echo_n "checking how to build libraries... " >&6; } + @%:@ Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then + enableval=$enable_shared; tcl_ok=$enableval +else + tcl_ok=yes +fi + + + if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" ; then + { $as_echo "$as_me:$LINENO: result: shared" >&5 +$as_echo "shared" >&6; } + SHARED_BUILD=1 + else + { $as_echo "$as_me:$LINENO: result: static" >&5 +$as_echo "static" >&6; } + SHARED_BUILD=0 + +cat >>confdefs.h <<\_ACEOF +@%:@define STATIC_BUILD 1 +_ACEOF + + fi + + + +#-------------------------------------------------------------------- +# This macro figures out what flags to use with the compiler/linker +# when building shared/static debug/optimized objects. This information +# can be taken from the tclConfig.sh file, but this figures it all out. +#-------------------------------------------------------------------- + + + + + # Step 0.a: Enable 64 bit support? + + { $as_echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 +$as_echo_n "checking if 64bit support is requested... " >&6; } + @%:@ Check whether --enable-64bit was given. +if test "${enable_64bit+set}" = set; then + enableval=$enable_64bit; do64bit=$enableval +else + do64bit=no +fi + + { $as_echo "$as_me:$LINENO: result: $do64bit" >&5 +$as_echo "$do64bit" >&6; } + + # Step 0.b: Enable Solaris 64 bit VIS support? + + { $as_echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 +$as_echo_n "checking if 64bit Sparc VIS support is requested... " >&6; } + @%:@ Check whether --enable-64bit-vis was given. +if test "${enable_64bit_vis+set}" = set; then + enableval=$enable_64bit_vis; do64bitVIS=$enableval +else + do64bitVIS=no +fi + + { $as_echo "$as_me:$LINENO: result: $do64bitVIS" >&5 +$as_echo "$do64bitVIS" >&6; } + # Force 64bit on with VIS + if test "$do64bitVIS" = "yes"; then + do64bit=yes +fi + + + # Step 0.c: Check if visibility support is available. Do this here so + # that platform specific alternatives can be used below if this fails. + + { $as_echo "$as_me:$LINENO: checking if compiler supports visibility \"hidden\"" >&5 +$as_echo_n "checking if compiler supports visibility \"hidden\"... " >&6; } +if test "${tcl_cv_cc_visibility_hidden+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + extern __attribute__((__visibility__("hidden"))) void f(void); + void f(void) {} +int +main () +{ +f(); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_cc_visibility_hidden=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_cc_visibility_hidden=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_visibility_hidden" >&5 +$as_echo "$tcl_cv_cc_visibility_hidden" >&6; } + if test $tcl_cv_cc_visibility_hidden = yes; then + + +cat >>confdefs.h <<\_ACEOF +@%:@define MODULE_SCOPE extern __attribute__((__visibility__("hidden"))) +_ACEOF + + +fi + + + # Step 0.d: Disable -rpath support? + + { $as_echo "$as_me:$LINENO: checking if rpath support is requested" >&5 +$as_echo_n "checking if rpath support is requested... " >&6; } + @%:@ Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then + enableval=$enable_rpath; doRpath=$enableval +else + doRpath=yes +fi + + { $as_echo "$as_me:$LINENO: result: $doRpath" >&5 +$as_echo "$doRpath" >&6; } + + # TEA specific: Cross-compiling options for Windows/CE builds? + + if test "${TEA_PLATFORM}" = windows; then + + { $as_echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 +$as_echo_n "checking if Windows/CE build is requested... " >&6; } + @%:@ Check whether --enable-wince was given. +if test "${enable_wince+set}" = set; then + enableval=$enable_wince; doWince=$enableval +else + doWince=no +fi + + { $as_echo "$as_me:$LINENO: result: $doWince" >&5 +$as_echo "$doWince" >&6; } + +fi + + + # Step 1: set the variable "system" to hold the name and version number + # for the system. + + + { $as_echo "$as_me:$LINENO: checking system version" >&5 +$as_echo_n "checking system version... " >&6; } +if test "${tcl_cv_sys_version+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + # TEA specific: + if test "${TEA_PLATFORM}" = "windows" ; then + tcl_cv_sys_version=windows + elif test -f /usr/lib/NextStep/software_version; then + tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` + else + tcl_cv_sys_version=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + { $as_echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 +$as_echo "$as_me: WARNING: can't find uname command" >&2;} + tcl_cv_sys_version=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid` + fi + if test "`uname -s`" = "AIX" ; then + tcl_cv_sys_version=AIX-`uname -v`.`uname -r` + fi + fi + fi + +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 +$as_echo "$tcl_cv_sys_version" >&6; } + system=$tcl_cv_sys_version + + + # Step 2: check for existence of -ldl library. This is needed because + # Linux can use either -ldl or -ldld for dynamic loading. + + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dl_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then + have_dl=yes +else + have_dl=no +fi + + + # Require ranlib early so we can override it in special cases below. + + + + # Step 3: set configuration options based on system name and version. + # This is similar to Tcl's unix/tcl.m4 except that we've added a + # "windows" case. + + do64bit_ok=no + LDFLAGS_ORIG="$LDFLAGS" + # When ld needs options to work in 64-bit mode, put them in + # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] + # is disabled by the user. [Bug 1016796] + LDFLAGS_ARCH="" + TCL_EXPORT_FILE_SUFFIX="" + UNSHARED_LIB_SUFFIX="" + # TEA specific: use PACKAGE_VERSION instead of VERSION + TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' + ECHO_VERSION='`echo ${PACKAGE_VERSION}`' + TCL_LIB_VERSIONS_OK=ok + CFLAGS_DEBUG=-g + CFLAGS_OPTIMIZE=-O + if test "$GCC" = yes; then + + # TEA specific: + CFLAGS_OPTIMIZE=-O2 + CFLAGS_WARNING="-Wall" + +else + CFLAGS_WARNING="" +fi + + TCL_NEEDS_EXP_FILE=0 + TCL_BUILD_EXP_FILE="" + TCL_EXP_FILE="" + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="ar" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + STLIB_LD='${AR} cr' + LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" + if test "x$SHLIB_VERSION" = x; then + SHLIB_VERSION="1.0" +fi + + case $system in + # TEA specific: + windows) + # This is a 2-stage check to make sure we have the 64-bit SDK + # We have to know where the SDK is installed. + # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs + # MACHINE is IX86 for LINK, but this is used by the manifest, + # which requires x86|amd64|ia64. + MACHINE="X86" + if test "$do64bit" != "no" ; then + if test "x${MSSDK}x" = "xx" ; then + MSSDK="C:/Progra~1/Microsoft Platform SDK" + fi + MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` + PATH64="" + case "$do64bit" in + amd64|x64|yes) + MACHINE="AMD64" ; # default to AMD64 64-bit build + PATH64="${MSSDK}/Bin/Win64/x86/AMD64" + ;; + ia64) + MACHINE="IA64" + PATH64="${MSSDK}/Bin/Win64" + ;; + esac + if test ! -d "${PATH64}" ; then + { $as_echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 +$as_echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 +$as_echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} + do64bit="no" + else + { $as_echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 +$as_echo " Using 64-bit $MACHINE mode" >&6; } + do64bit_ok="yes" + fi + fi + + if test "$doWince" != "no" ; then + if test "$do64bit" != "no" ; then + { { $as_echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 +$as_echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} + { (exit 1); exit 1; }; } + fi + if test "$GCC" = "yes" ; then + { { $as_echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 +$as_echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} + { (exit 1); exit 1; }; } + fi + + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-celib + + if test x"${no_celib}" = x ; then + # we reset no_celib in case something fails here + no_celib=true + +@%:@ Check whether --with-celib was given. +if test "${with_celib+set}" = set; then + withval=$with_celib; with_celibconfig=${withval} +fi + + { $as_echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 +$as_echo_n "checking for Windows/CE celib directory... " >&6; } + if test "${ac_cv_c_celibconfig+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + # First check to see if --with-celibconfig was specified. + if test x"${with_celibconfig}" != x ; then + if test -d "${with_celibconfig}/inc" ; then + ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` + else + { { $as_echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 +$as_echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + # then check for a celib library + if test x"${ac_cv_c_celibconfig}" = x ; then + for i in \ + ../celib-palm-3.0 \ + ../celib \ + ../../celib-palm-3.0 \ + ../../celib \ + `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ + ${srcdir}/../celib-palm-3.0 \ + ${srcdir}/../celib \ + `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ + ; do + if test -d "$i/inc" ; then + ac_cv_c_celibconfig=`(cd $i; pwd)` + break + fi + done + fi + +fi + + if test x"${ac_cv_c_celibconfig}" = x ; then + { { $as_echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 +$as_echo "$as_me: error: Cannot find celib support library directory" >&2;} + { (exit 1); exit 1; }; } + else + no_celib= + CELIB_DIR=${ac_cv_c_celibconfig} + CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` + { $as_echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 +$as_echo "found $CELIB_DIR" >&6; } + fi + fi + + # Set defaults for common evc4/PPC2003 setup + # Currently Tcl requires 300+, possibly 420+ for sockets + CEVERSION=420; # could be 211 300 301 400 420 ... + TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... + ARCH=ARM; # could be ARM MIPS X86EM ... + PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" + if test "$doWince" != "yes"; then + # If !yes then the user specified something + # Reset ARCH to allow user to skip specifying it + ARCH= + eval `echo $doWince | awk -F, '{ \ + if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ + if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ + if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ + if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ + if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ + }'` + if test "x${ARCH}" = "x" ; then + ARCH=$TARGETCPU; + fi + fi + OSVERSION=WCE$CEVERSION; + if test "x${WCEROOT}" = "x" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" + if test ! -d "${WCEROOT}" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded Tools" + fi + fi + if test "x${SDKROOT}" = "x" ; then + SDKROOT="C:/Program Files/Windows CE Tools" + if test ! -d "${SDKROOT}" ; then + SDKROOT="C:/Windows CE Tools" + fi + fi + WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` + SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` + if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ + -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then + { { $as_echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 +$as_echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} + { (exit 1); exit 1; }; } + doWince="no" + else + # We could PATH_NOSPACE these, but that's not important, + # as long as we quote them when used. + CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" + if test -d "${CEINCLUDE}/${TARGETCPU}" ; then + CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" + fi + CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" + fi + fi + + if test "$GCC" != "yes" ; then + if test "${SHARED_BUILD}" = "0" ; then + runtime=-MT + else + runtime=-MD + fi + + if test "$do64bit" != "no" ; then + # All this magic is necessary for the Win64 SDK RC1 - hobbs + CC="\"${PATH64}/cl.exe\"" + CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" + RC="\"${MSSDK}/bin/rc.exe\"" + lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + LINKBIN="\"${PATH64}/link.exe\"" + CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + # Avoid 'unresolved external symbol __security_cookie' + # errors, c.f. http://support.microsoft.com/?id=894573 + + vars="bufferoverflowU.lib" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + elif test "$doWince" != "no" ; then + CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" + if test "${TARGETCPU}" = "X86"; then + CC="\"${CEBINROOT}/cl.exe\"" + else + CC="\"${CEBINROOT}/cl${ARCH}.exe\"" + fi + CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" + RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" + arch=`echo ${ARCH} | awk '{print tolower($0)}'` + defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" + if test "${SHARED_BUILD}" = "1" ; then + # Static CE builds require static celib as well + defs="${defs} _DLL" + fi + for i in $defs ; do + +cat >>confdefs.h <<_ACEOF +@%:@define $i 1 +_ACEOF + + done + +cat >>confdefs.h <<_ACEOF +@%:@define _WIN32_WCE $CEVERSION +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define UNDER_CE $CEVERSION +_ACEOF + + CFLAGS_DEBUG="-nologo -Zi -Od" + CFLAGS_OPTIMIZE="-nologo -Ox" + lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` + lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" + LINKBIN="\"${CEBINROOT}/link.exe\"" + + else + RC="rc" + lflags="-nologo" + LINKBIN="link" + CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + fi + fi + + if test "$GCC" = "yes"; then + # mingw gcc mode + RC="windres" + CFLAGS_DEBUG="-g" + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + SHLIB_LD="$CC -shared" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" + LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" + else + SHLIB_LD="${LINKBIN} -dll ${lflags}" + # link -lib only works when -lib is the first arg + STLIB_LD="${LINKBIN} -lib ${lflags}" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' + PATHTYPE=-w + # For information on what debugtype is most useful, see: + # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp + # and also + # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx + # This essentially turns it all on. + LDFLAGS_DEBUG="-debug -debugtype:cv" + LDFLAGS_OPTIMIZE="-release" + if test "$doWince" != "no" ; then + LDFLAGS_CONSOLE="-link ${lflags}" + LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} + else + LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" + LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" + fi + fi + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dll" + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' + + TCL_LIB_VERSIONS_OK=nodots + # Bogus to avoid getting this turned off + DL_OBJS="tclLoadNone.obj" + ;; + AIX-*) + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then + + # AIX requires the _r compiler when gcc isn't being used + case "${CC}" in + *_r|*_r\ *) + # ok ... + ;; + *) + # Make sure only first arg gets _r + CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'` + ;; + esac + { $as_echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 +$as_echo "Using $CC for compiling with threads" >&6; } + +fi + + LIBS="$LIBS -lc" + SHLIB_CFLAGS="" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + DL_OBJS="tclLoadDl.o" + LD_LIBRARY_PATH_VAR="LIBPATH" + + # Check to enable 64-bit flags for compiler/linker on AIX 4+ + if test "$do64bit" = yes -a "`uname -v`" -gt 3; then + + if test "$GCC" = yes; then + + { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + +else + + do64bit_ok=yes + CFLAGS="$CFLAGS -q64" + LDFLAGS_ARCH="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + +fi + + +fi + + + if test "`uname -m`" = ia64; then + + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = yes; then + + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + +else + + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + +fi + + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + +else + + if test "$GCC" = yes; then + SHLIB_LD='${CC} -shared' +else + + SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + +fi + + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + # TEA specific: use PACKAGE_VERSION instead of VERSION + TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' + +fi + + + # AIX v<=4.1 has some different flags than 4.2+ + if test "$system" = "AIX-4.1" -o "`uname -v`" -lt 4; then + + case " $LIB@&t@OBJS " in + *" tclLoadAix.$ac_objext "* ) ;; + *) LIB@&t@OBJS="$LIB@&t@OBJS tclLoadAix.$ac_objext" + ;; +esac + + DL_LIBS="-lld" + +fi + + + # On AIX <=v4 systems, libbsd.a has to be linked in to support + # non-blocking file IO. This library has to be linked in after + # the MATH_LIBS or it breaks the pow() function. The way to + # insure proper sequencing, is to add it to the tail of MATH_LIBS. + # This library also supplies gettimeofday. + # + # AIX does not have a timezone field in struct tm. When the AIX + # bsd library is used, the timezone global and the gettimeofday + # methods are to be avoided for timezone deduction instead, we + # deduce the timezone by comparing the localtime result on a + # known GMT value. + + { $as_echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 +$as_echo_n "checking for gettimeofday in -lbsd... " >&6; } +if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gettimeofday (); +int +main () +{ +return gettimeofday (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_bsd_gettimeofday=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_bsd_gettimeofday=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 +$as_echo "$ac_cv_lib_bsd_gettimeofday" >&6; } +if test "x$ac_cv_lib_bsd_gettimeofday" = x""yes; then + libbsd=yes +else + libbsd=no +fi + + if test $libbsd = yes; then + + MATH_LIBS="$MATH_LIBS -lbsd" + +cat >>confdefs.h <<\_ACEOF +@%:@define USE_DELTA_FOR_TZ 1 +_ACEOF + + +fi + + ;; + BeOS*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD='${CC} -nostart' + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + + #----------------------------------------------------------- + # Check for inet_ntoa in -lbind, for BeOS (which also needs + # -lsocket, even if the network functions are in -lnet which + # is always linked to, for compatibility. + #----------------------------------------------------------- + { $as_echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 +$as_echo_n "checking for inet_ntoa in -lbind... " >&6; } +if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbind $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char inet_ntoa (); +int +main () +{ +return inet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_bind_inet_ntoa=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_bind_inet_ntoa=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 +$as_echo "$ac_cv_lib_bind_inet_ntoa" >&6; } +if test "x$ac_cv_lib_bind_inet_ntoa" = x""yes; then + LIBS="$LIBS -lbind -lsocket" +fi + + ;; + BSD/OS-2.1*|BSD/OS-3*) + SHLIB_CFLAGS="" + SHLIB_LD="shlicc -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + BSD/OS-4.*) + SHLIB_CFLAGS="-export-dynamic -fPIC" + SHLIB_LD='${CC} -shared' + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + dgux*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + HP-UX-*.11.*) + # Use updated header definitions where possible + +cat >>confdefs.h <<\_ACEOF +@%:@define _XOPEN_SOURCE_EXTENDED 1 +_ACEOF + + # TEA specific: Needed by Tcl, but not most extensions + #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) + #LIBS="$LIBS -lxnet" # Use the XOPEN network library + + if test "`uname -m`" = ia64; then + + SHLIB_SUFFIX=".so" + # Use newer C++ library for C++ extensions + #if test "$GCC" != "yes" ; then + # CPPFLAGS="-AA" + #fi + +else + + SHLIB_SUFFIX=".sl" + +fi + + { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dld_shl_load=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_shl_load=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = yes; then + + SHLIB_LD_LIBS='${LIBS}' + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + +fi + + if test "$GCC" = yes; then + + SHLIB_LD='${CC} -shared' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + +else + + CFLAGS="$CFLAGS -z" + # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc + #CFLAGS="$CFLAGS +DAportable" + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + +fi + + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes"; then + + if test "$GCC" = yes; then + + case `${CC} -dumpmachine` in + hppa64*) + # 64-bit gcc in use. Fix flags for GNU ld. + do64bit_ok=yes + SHLIB_LD='${CC} -shared' + SHLIB_LD_LIBS='${LIBS}' + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' +fi + + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ;; + *) + { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + ;; + esac + +else + + do64bit_ok=yes + CFLAGS="$CFLAGS +DD64" + LDFLAGS_ARCH="+DD64" + +fi + + +fi + ;; + HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) + SHLIB_SUFFIX=".sl" + { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dld_shl_load=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_shl_load=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = yes; then + + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS="" + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + +fi + ;; + IRIX-5.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' +fi + + ;; + IRIX-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' +fi + + if test "$GCC" = yes; then + + CFLAGS="$CFLAGS -mabi=n32" + LDFLAGS="$LDFLAGS -mabi=n32" + +else + + case $system in + IRIX-6.3) + # Use to build 6.2 compatible binaries on 6.3. + CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" + ;; + *) + CFLAGS="$CFLAGS -n32" + ;; + esac + LDFLAGS="$LDFLAGS -n32" + +fi + + ;; + IRIX64-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' +fi + + + # Check to enable 64-bit flags for compiler/linker + + if test "$do64bit" = yes; then + + if test "$GCC" = yes; then + + { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} + +else + + do64bit_ok=yes + SHLIB_LD="ld -64 -shared -rdata_shared" + CFLAGS="$CFLAGS -64" + LDFLAGS_ARCH="-64" + +fi + + +fi + + ;; + Linux*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + # TEA specific: + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings + # when you inline the string and math operations. Turn this off to + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS + SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' +fi + + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "`uname -m`" = "alpha"; then + CFLAGS="$CFLAGS -mieee" +fi + + if test $do64bit = yes; then + + { $as_echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 +$as_echo_n "checking if compiler accepts -m64 flag... " >&6; } +if test "${tcl_cv_cc_m64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -m64" + 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 conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_cc_m64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_cc_m64=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 +$as_echo "$tcl_cv_cc_m64" >&6; } + if test $tcl_cv_cc_m64 = yes; then + + CFLAGS="$CFLAGS -m64" + do64bit_ok=yes + +fi + + +fi + + + # The combo of gcc + glibc has a bug related to inlining of + # functions like strtod(). The -fno-builtin flag should address + # this problem but it does not work. The -fno-inline flag is kind + # of overkill but it works. Disable inlining only when one of the + # files in compat/*.c is being linked in. + + if test x"${USE_COMPAT}" != x; then + CFLAGS="$CFLAGS -fno-inline" +fi + + + ;; + GNU*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + SHLIB_LD='${CC} -shared' + DL_OBJS="" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + if test "`uname -m`" = "alpha"; then + CFLAGS="$CFLAGS -mieee" +fi + + ;; + Lynx*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + CFLAGS_OPTIMIZE=-02 + SHLIB_LD='${CC} -shared' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-mshared -ldl" + LD_FLAGS="-Wl,--export-dynamic" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' +fi + + ;; + MP-RAS-02*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + MP-RAS-*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,-Bexport" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + NetBSD-1.*|FreeBSD-[1-2].*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' +fi + + { $as_echo "$as_me:$LINENO: checking for ELF" >&5 +$as_echo_n "checking for ELF... " >&6; } +if test "${tcl_cv_ld_elf+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef __ELF__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + tcl_cv_ld_elf=yes +else + tcl_cv_ld_elf=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 +$as_echo "$tcl_cv_ld_elf" >&6; } + if test $tcl_cv_ld_elf = yes; then + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + +else + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' + +fi + + + # Ancient FreeBSD doesn't handle version numbers with dots. + + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + OpenBSD-*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' +fi + + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' + { $as_echo "$as_me:$LINENO: checking for ELF" >&5 +$as_echo_n "checking for ELF... " >&6; } +if test "${tcl_cv_ld_elf+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef __ELF__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + tcl_cv_ld_elf=yes +else + tcl_cv_ld_elf=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 +$as_echo "$tcl_cv_ld_elf" >&6; } + if test $tcl_cv_ld_elf = yes; then + + LDFLAGS=-Wl,-export-dynamic + +else + LDFLAGS="" +fi + + + # OpenBSD doesn't do version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + NetBSD-*|FreeBSD-*) + # FreeBSD 3.* and greater have ELF. + # NetBSD 2.* has ELF and can use 'cc -shared' to build shared libs + SHLIB_CFLAGS="-fPIC" + SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS -export-dynamic" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' +fi + + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "${TCL_THREADS}" = "1"; then + + # The -pthread needs to go in the CFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + +fi + + case $system in + FreeBSD-3.*) + # FreeBSD-3 doesn't handle version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + TCL_LIB_VERSIONS_OK=nodots + ;; + esac + ;; + Darwin-*) + CFLAGS_OPTIMIZE="-Os" + SHLIB_CFLAGS="-fno-common" + # To avoid discrepancies between what headers configure sees during + # preprocessing tests and compiling tests, move any -isysroot and + # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: + CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" + CFLAGS="`echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" + if test $do64bit = yes; then + + case `arch` in + ppc) + { $as_echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 +$as_echo_n "checking if compiler accepts -arch ppc64 flag... " >&6; } +if test "${tcl_cv_cc_arch_ppc64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + 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 conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_cc_arch_ppc64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_cc_arch_ppc64=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 +$as_echo "$tcl_cv_cc_arch_ppc64" >&6; } + if test $tcl_cv_cc_arch_ppc64 = yes; then + + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + do64bit_ok=yes + +fi +;; + i386) + { $as_echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 +$as_echo_n "checking if compiler accepts -arch x86_64 flag... " >&6; } +if test "${tcl_cv_cc_arch_x86_64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch x86_64" + 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 conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_cc_arch_x86_64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_cc_arch_x86_64=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 +$as_echo "$tcl_cv_cc_arch_x86_64" >&6; } + if test $tcl_cv_cc_arch_x86_64 = yes; then + + CFLAGS="$CFLAGS -arch x86_64" + do64bit_ok=yes + +fi +;; + *) + { $as_echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 +$as_echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; + esac + +else + + # Check for combined 32-bit and 64-bit fat build + if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \ + && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then + + fat_32_64=yes +fi + + +fi + + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS + SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' + { $as_echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 +$as_echo_n "checking if ld accepts -single_module flag... " >&6; } +if test "${tcl_cv_ld_single_module+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_ld_single_module=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_ld_single_module=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 +$as_echo "$tcl_cv_ld_single_module" >&6; } + if test $tcl_cv_ld_single_module = yes; then + + SHLIB_LD="${SHLIB_LD} -Wl,-single_module" + +fi + + # TEA specific: link shlib with current and compatiblity version flags + vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([0-9]\{1,5\}\)\(\(\.[0-9]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d` + SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dylib" + DL_OBJS="tclLoadDyld.o" + DL_LIBS="" + # Don't use -prebind when building for Mac OS X 10.4 or later only: + if test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ + "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then + + LDFLAGS="$LDFLAGS -prebind" +fi + + LDFLAGS="$LDFLAGS -headerpad_max_install_names" + { $as_echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 +$as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; } +if test "${tcl_cv_ld_search_paths_first+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_ld_search_paths_first=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_ld_search_paths_first=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 +$as_echo "$tcl_cv_ld_search_paths_first" >&6; } + if test $tcl_cv_ld_search_paths_first = yes; then + + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + +fi + + if test "$tcl_cv_cc_visibility_hidden" != yes; then + + +cat >>confdefs.h <<\_ACEOF +@%:@define MODULE_SCOPE __private_extern__ +_ACEOF + + +fi + + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" + # TEA specific: for combined 32 & 64 bit fat builds of Tk + # extensions, verify that 64-bit build is possible. + if test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"; then + + if test "${TEA_WINDOWINGSYSTEM}" = x11; then + + { $as_echo "$as_me:$LINENO: checking for 64-bit X11" >&5 +$as_echo_n "checking for 64-bit X11... " >&6; } +if test "${tcl_cv_lib_x11_64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' + done + CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" + LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +XrmInitialize(); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_lib_x11_64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_lib_x11_64=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="$hold_'$v'"' + done +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_lib_x11_64" >&5 +$as_echo "$tcl_cv_lib_x11_64" >&6; } + +fi + + if test "${TEA_WINDOWINGSYSTEM}" = aqua; then + + { $as_echo "$as_me:$LINENO: checking for 64-bit Tk" >&5 +$as_echo_n "checking for 64-bit Tk... " >&6; } +if test "${tcl_cv_lib_tk_64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' + done + CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}" + LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +Tk_InitStubs(NULL, "", 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_lib_tk_64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_lib_tk_64=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="$hold_'$v'"' + done +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_lib_tk_64" >&5 +$as_echo "$tcl_cv_lib_tk_64" >&6; } + +fi + + # remove 64-bit arch flags from CFLAGS et al. if configuration + # does not support 64-bit. + if test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no; then + + { $as_echo "$as_me:$LINENO: Removing 64-bit architectures from compiler & linker flags" >&5 +$as_echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;} + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' + done +fi + + +fi + + ;; + NEXTSTEP-*) + SHLIB_CFLAGS="" + SHLIB_LD='${CC} -nostdlib -r' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadNext.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OS/390-*) + CFLAGS_OPTIMIZE="" # Optimizer is buggy + +cat >>confdefs.h <<\_ACEOF +@%:@define _OE_SOCKETS 1 +_ACEOF + + ;; + OSF1-1.0|OSF1-1.1|OSF1-1.2) + # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 + SHLIB_CFLAGS="" + # Hack: make package name same as library name + SHLIB_LD='ld -R -export :' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadOSF.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-1.*) + # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 + SHLIB_CFLAGS="-fPIC" + if test "$SHARED_BUILD" = 1; then + SHLIB_LD="ld -shared" +else + + SHLIB_LD="ld -non_shared" + +fi + + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-V*) + # Digital OSF/1 + SHLIB_CFLAGS="" + if test "$SHARED_BUILD" = 1; then + + SHLIB_LD='ld -shared -expect_unresolved "*"' + +else + + SHLIB_LD='ld -non_shared -expect_unresolved "*"' + +fi + + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' +fi + + if test "$GCC" = yes; then + CFLAGS="$CFLAGS -mieee" +else + + CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" +fi + + # see pthread_intro(3) for pthread support on osf1, k.furukawa + if test "${TCL_THREADS}" = 1; then + + CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" + CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" + LIBS=`echo $LIBS | sed s/-lpthreads//` + if test "$GCC" = yes; then + + LIBS="$LIBS -lpthread -lmach -lexc" + +else + + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + +fi + + +fi + + ;; + QNX-6*) + # QNX RTP + # This may work for all QNX, but it was only reported for v6. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + # dlopen is in -lc on QNX + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SCO_SV-3.2*) + # Note, dlopen is available only on SCO 3.2.5 and greater. However, + # this test works, since "uname -s" was non-standard in 3.2.4 and + # below. + if test "$GCC" = yes; then + + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" + +else + + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" + +fi + + SHLIB_LD="ld -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SINIX*5.4*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SunOS-4*) + SHLIB_CFLAGS="-PIC" + SHLIB_LD="ld" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + + # SunOS can't handle version numbers with dots in them in library + # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it + # requires an extra version number at the end of .so file names. + # So, the library has to have a name like libtcl75.so.1.0 + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + SunOS-5.[0-6]) + # Careful to not let 5.10+ fall into this case + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + +cat >>confdefs.h <<\_ACEOF +@%:@define _REENTRANT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +@%:@define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + + SHLIB_CFLAGS="-KPIC" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = yes; then + + SHLIB_LD='${CC} -shared' + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + +else + + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + +fi + + ;; + SunOS-5*) + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + +cat >>confdefs.h <<\_ACEOF +@%:@define _REENTRANT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +@%:@define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + + SHLIB_CFLAGS="-KPIC" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = yes; then + + arch=`isainfo` + if test "$arch" = "sparcv9 sparc"; then + + if test "$GCC" = yes; then + + if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then + + { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} + +else + + do64bit_ok=yes + CFLAGS="$CFLAGS -m64 -mcpu=v9" + LDFLAGS="$LDFLAGS -m64 -mcpu=v9" + SHLIB_CFLAGS="-fPIC" + +fi + + +else + + do64bit_ok=yes + if test "$do64bitVIS" = yes; then + + CFLAGS="$CFLAGS -xarch=v9a" + LDFLAGS_ARCH="-xarch=v9a" + +else + + CFLAGS="$CFLAGS -xarch=v9" + LDFLAGS_ARCH="-xarch=v9" + +fi + + # Solaris 64 uses this as well + #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" + +fi + + +else + if test "$arch" = "amd64 i386"; then + + if test "$GCC" = yes; then + + case $system in + SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) + do64bit_ok=yes + CFLAGS="$CFLAGS -m64" + LDFLAGS="$LDFLAGS -m64";; + *) + { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; + esac + +else + + do64bit_ok=yes + case $system in + SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) + CFLAGS="$CFLAGS -m64" + LDFLAGS="$LDFLAGS -m64";; + *) + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64";; + esac + +fi + + +else + { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} +fi + +fi + + +fi + + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = yes; then + + SHLIB_LD='${CC} -shared' + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "$do64bit_ok" = yes; then + + if test "$arch" = "sparcv9 sparc"; then + + # We need to specify -static-libgcc or we need to + # add the path to the sparv9 libgcc. + # JH: static-libgcc is necessary for core Tcl, but may + # not be necessary for extensions. + SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" + # for finding sparcv9 libgcc, get the regular libgcc + # path, remove so name and append 'sparcv9' + #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." + #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + +else + if test "$arch" = "amd64 i386"; then + + # JH: static-libgcc is necessary for core Tcl, but may + # not be necessary for extensions. + SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" + +fi + +fi + + +fi + + +else + + case $system in + SunOS-5.[1-9][0-9]*) + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS + SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';; + *) + SHLIB_LD='/usr/ccs/bin/ld -G -z text';; + esac + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + +fi + + ;; + UNIX_SV* | UnixWare-5*) + SHLIB_CFLAGS="-KPIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers + # that don't grok the -Bexport option. Test that it does. + { $as_echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 +$as_echo_n "checking for ld accepts -Bexport flag... " >&6; } +if test "${tcl_cv_ld_Bexport+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-Bexport" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_ld_Bexport=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_ld_Bexport=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 +$as_echo "$tcl_cv_ld_Bexport" >&6; } + if test $tcl_cv_ld_Bexport = yes; then + + LDFLAGS="$LDFLAGS -Wl,-Bexport" + +fi + + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + esac + + if test "$do64bit" = yes -a "$do64bit_ok" = no; then + + { $as_echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 +$as_echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} + +fi + + + + + # Step 4: disable dynamic loading if requested via a command-line switch. + + @%:@ Check whether --enable-load was given. +if test "${enable_load+set}" = set; then + enableval=$enable_load; tcl_ok=$enableval +else + tcl_ok=yes +fi + + if test "$tcl_ok" = no; then + DL_OBJS="" +fi + + + if test "x$DL_OBJS" != x; then + BUILD_DLTEST="\$(DLTEST_TARGETS)" +else + + { $as_echo "$as_me:$LINENO: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5 +$as_echo "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;} + SHLIB_CFLAGS="" + SHLIB_LD="" + SHLIB_SUFFIX="" + DL_OBJS="tclLoadNone.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS_ORIG" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + BUILD_DLTEST="" + +fi + + LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" + + # If we're running gcc, then change the C flags for compiling shared + # libraries to the right flags for gcc, instead of those for the + # standard manufacturer compiler. + + if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes; then + + case $system in + AIX-*) ;; + BSD/OS*) ;; + IRIX*) ;; + NetBSD-*|FreeBSD-*) ;; + Darwin-*) ;; + SCO_SV-3.2*) ;; + windows) ;; + *) SHLIB_CFLAGS="-fPIC" ;; + esac +fi + + + if test "$SHARED_LIB_SUFFIX" = ""; then + + # TEA specific: use PACKAGE_VERSION instead of VERSION + SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' +fi + + if test "$UNSHARED_LIB_SUFFIX" = ""; then + + # TEA specific: use PACKAGE_VERSION instead of VERSION + UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' +fi + + + + + + + + + + + + + + + + + # These must be called after we do the basic CFLAGS checks and + # verify any possible 64-bit or similar switches are necessary + + { $as_echo "$as_me:$LINENO: checking for required early compiler flags" >&5 +$as_echo_n "checking for required early compiler flags... " >&6; } + tcl_flags="" + + if test "${tcl_cv_flag__isoc99_source+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *)strtoll; char *q = (char *)strtoull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_flag__isoc99_source=no +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _ISOC99_SOURCE 1 +#include +int +main () +{ +char *p = (char *)strtoll; char *q = (char *)strtoull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_flag__isoc99_source=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_flag__isoc99_source=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +@%:@define _ISOC99_SOURCE 1 +_ACEOF + + tcl_flags="$tcl_flags _ISOC99_SOURCE" + fi + + + if test "${tcl_cv_flag__largefile64_source+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +struct stat64 buf; int i = stat64("/", &buf); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_flag__largefile64_source=no +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE64_SOURCE 1 +#include +int +main () +{ +struct stat64 buf; int i = stat64("/", &buf); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_flag__largefile64_source=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_flag__largefile64_source=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +@%:@define _LARGEFILE64_SOURCE 1 +_ACEOF + + tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" + fi + + + if test "${tcl_cv_flag__largefile_source64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *)open64; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_flag__largefile_source64=no +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE64 1 +#include +int +main () +{ +char *p = (char *)open64; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_flag__largefile_source64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_flag__largefile_source64=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +@%:@define _LARGEFILE_SOURCE64 1 +_ACEOF + + tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" + fi + + if test "x${tcl_flags}" = "x" ; then + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } + else + { $as_echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 +$as_echo "${tcl_flags}" >&6; } + fi + + + { $as_echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 +$as_echo_n "checking for 64-bit integer type... " >&6; } + if test "${tcl_cv_type_64bit+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +__int64 value = (__int64) 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_type_64bit=__int64 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_type_64bit="long long" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +switch (0) { + case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; + } + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_type_64bit=${tcl_type_64bit} +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "${tcl_cv_type_64bit}" = none ; then + +cat >>confdefs.h <<\_ACEOF +@%:@define TCL_WIDE_INT_IS_LONG 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: using long" >&5 +$as_echo "using long" >&6; } + elif test "${tcl_cv_type_64bit}" = "__int64" \ + -a "${TEA_PLATFORM}" = "windows" ; then + # TEA specific: We actually want to use the default tcl.h checks in + # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* + { $as_echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 +$as_echo "using Tcl header defaults" >&6; } + else + +cat >>confdefs.h <<_ACEOF +@%:@define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} +_ACEOF + + { $as_echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 +$as_echo "${tcl_cv_type_64bit}" >&6; } + + # Now check for auxiliary declarations + { $as_echo "$as_me:$LINENO: checking for struct dirent64" >&5 +$as_echo_n "checking for struct dirent64... " >&6; } +if test "${tcl_cv_struct_dirent64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +struct dirent64 p; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_struct_dirent64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_struct_dirent64=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 +$as_echo "$tcl_cv_struct_dirent64" >&6; } + if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +@%:@define HAVE_STRUCT_DIRENT64 1 +_ACEOF + + fi + + { $as_echo "$as_me:$LINENO: checking for struct stat64" >&5 +$as_echo_n "checking for struct stat64... " >&6; } +if test "${tcl_cv_struct_stat64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +struct stat64 p; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_struct_stat64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_struct_stat64=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 +$as_echo "$tcl_cv_struct_stat64" >&6; } + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +@%:@define HAVE_STRUCT_STAT64 1 +_ACEOF + + fi + + + +for ac_func in open64 lseek64 +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + { $as_echo "$as_me:$LINENO: checking for off64_t" >&5 +$as_echo_n "checking for off64_t... " >&6; } + if test "${tcl_cv_type_off64_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +off64_t offset; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_type_off64_t=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_type_off64_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_type_off64_t}" = "xyes" && \ + test "x${ac_cv_func_lseek64}" = "xyes" && \ + test "x${ac_cv_func_open64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +@%:@define HAVE_TYPE_OFF64_T 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + fi + fi + + + +#-------------------------------------------------------------------- +# Set the default compiler switches based on the --enable-symbols option. +#-------------------------------------------------------------------- + + + + { $as_echo "$as_me:$LINENO: checking for build with symbols" >&5 +$as_echo_n "checking for build with symbols... " >&6; } + @%:@ Check whether --enable-symbols was given. +if test "${enable_symbols+set}" = set; then + enableval=$enable_symbols; tcl_ok=$enableval +else + tcl_ok=no +fi + + DBGX="" + if test "$tcl_ok" = "no"; then + CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" + LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + else + CFLAGS_DEFAULT="${CFLAGS_DEBUG}" + LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" + if test "$tcl_ok" = "yes"; then + { $as_echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 +$as_echo "yes (standard debugging)" >&6; } + fi + fi + # TEA specific: + if test "${TEA_PLATFORM}" != "windows" ; then + LDFLAGS_DEFAULT="${LDFLAGS}" + fi + + + + + if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then + +cat >>confdefs.h <<\_ACEOF +@%:@define TCL_MEM_DEBUG 1 +_ACEOF + + fi + + if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then + if test "$tcl_ok" = "all"; then + { $as_echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 +$as_echo "enabled symbols mem debugging" >&6; } + else + { $as_echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 +$as_echo "enabled $tcl_ok debugging" >&6; } + fi + fi + + +#-------------------------------------------------------------------- +# Everyone should be linking against the Tcl stub library. If you +# can't for some reason, remove this definition. If you aren't using +# stubs, you also need to modify the SHLIB_LD_LIBS setting below to +# link against the non-stubbed Tcl library. Add Tk too if necessary. +#-------------------------------------------------------------------- + + +cat >>confdefs.h <<\_ACEOF +@%:@define USE_TCL_STUBS 1 +_ACEOF + +#AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) + +#-------------------------------------------------------------------- +# This macro generates a line to use when building a library. It +# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, +# and TEA_LOAD_TCLCONFIG macros above. +#-------------------------------------------------------------------- + + + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then + MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" + MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" + else + MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" + MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" + fi + + if test "${SHARED_BUILD}" = "1" ; then + MAKE_LIB="${MAKE_SHARED_LIB} " + else + MAKE_LIB="${MAKE_STATIC_LIB} " + fi + + #-------------------------------------------------------------------- + # Shared libraries and static libraries have different names. + # Use the double eval to make sure any variables in the suffix is + # substituted. (@@@ Might not be necessary anymore) + #-------------------------------------------------------------------- + + if test "${TEA_PLATFORM}" = "windows" ; then + if test "${SHARED_BUILD}" = "1" ; then + # We force the unresolved linking of symbols that are really in + # the private libraries of Tcl and Tk. + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" + fi + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + else + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + if test "$GCC" = "yes"; then + PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} + fi + # These aren't needed on Windows (either MSVC or gcc) + RANLIB=: + RANLIB_STUB=: + else + RANLIB_STUB="${RANLIB}" + if test "${SHARED_BUILD}" = "1" ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" + fi + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + fi + + # These are escaped so that only CFLAGS is picked up at configure time. + # The other values will be substituted at make time. + CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" + if test "${SHARED_BUILD}" = "1" ; then + CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" + fi + + + + + + + + +#-------------------------------------------------------------------- +# Determine the name of the tclsh and/or wish executables in the +# Tcl and Tk build directories or the location they were installed +# into. These paths are used to support running test cases only, +# the Makefile should not be making use of these paths to generate +# a pkgIndex.tcl file or anything else at extension build time. +#-------------------------------------------------------------------- + + + { $as_echo "$as_me:$LINENO: checking for tclsh" >&5 +$as_echo_n "checking for tclsh... " >&6; } + if test -f "${TCL_BIN_DIR}/Makefile" ; then + # tclConfig.sh is in Tcl build directory + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="${TCL_BIN_DIR}/tclsh" + fi + else + # tclConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" + fi + list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${TCLSH_PROG}" ; then + REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" + fi + { $as_echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 +$as_echo "${TCLSH_PROG}" >&6; } + + +#TEA_PROG_WISH + +#-------------------------------------------------------------------- +# Finally, substitute all of the various values into the Makefile. +# You may alternatively have a special pkgIndex.tcl.in or other files +# which require substituting th AC variables in. Include these here. +#-------------------------------------------------------------------- + +ac_config_files="$ac_config_files Makefile pkgIndex.tcl" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by TclCurl $as_me 7.19.6, which was +generated by GNU Autoconf 2.63. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="`echo $ac_config_files`" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTION]... [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet, --silent + 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 + +Configuration files: +$config_files + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_version="\\ +TclCurl config.status 7.19.6 +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { $as_echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "pkgIndex.tcl") CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;; + + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_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 +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + $as_echo "$as_me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=' ' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_ACEOF + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + ;; + + + + esac + +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + +# 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 +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/autom4te.cache/requests b/autom4te.cache/requests new file mode 100644 index 0000000..fbfa6dc --- /dev/null +++ b/autom4te.cache/requests @@ -0,0 +1,67 @@ +# This file was generated. +# It contains the lists of macros which have been traced. +# It can be safely removed. + +@request = ( + bless( [ + '0', + 1, + [ + '/usr/share/autoconf' + ], + [ + '/usr/share/autoconf/autoconf/autoconf.m4f', + 'aclocal.m4', + 'configure.in' + ], + { + 'AM_PROG_F77_C_O' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'm4_pattern_forbid' => 1, + 'AC_INIT' => 1, + 'AC_CANONICAL_TARGET' => 1, + '_AM_COND_IF' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, + 'AC_SUBST' => 1, + 'AC_CANONICAL_HOST' => 1, + 'AC_FC_SRCEXT' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'AC_CONFIG_LINKS' => 1, + 'AC_REQUIRE_AUX_FILE' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'm4_sinclude' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, + '_m4_warn' => 1, + 'AM_PROG_CXX_C_O' => 1, + '_AM_COND_ENDIF' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'AC_CONFIG_FILES' => 1, + 'include' => 1, + 'LT_INIT' => 1, + 'AM_GNU_GETTEXT' => 1, + 'AC_LIBSOURCE' => 1, + 'AM_PROG_FC_C_O' => 1, + 'AC_CANONICAL_BUILD' => 1, + 'AC_FC_FREEFORM' => 1, + 'AH_OUTPUT' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'AM_PROG_CC_C_O' => 1, + 'm4_pattern_allow' => 1, + 'sinclude' => 1, + 'AM_CONDITIONAL' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'm4_include' => 1, + '_AM_COND_ELSE' => 1, + 'AC_SUBST_TRACE' => 1 + } + ], 'Autom4te::Request' ) + ); + diff --git a/autom4te.cache/traces.0 b/autom4te.cache/traces.0 new file mode 100644 index 0000000..e05efa2 --- /dev/null +++ b/autom4te.cache/traces.0 @@ -0,0 +1,823 @@ +m4trace:configure.in:22: -1- AC_INIT([TclCurl], [7.19.6]) +m4trace:configure.in:22: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.in:22: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.in:22: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.in:22: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.in:22: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.in:22: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.in:22: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.in:22: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([SHELL]) +m4trace:configure.in:22: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.in:22: -1- AC_SUBST([PATH_SEPARATOR]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) +m4trace:configure.in:22: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.in:22: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([PACKAGE_NAME]) +m4trace:configure.in:22: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:22: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) +m4trace:configure.in:22: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:22: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) +m4trace:configure.in:22: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:22: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([PACKAGE_STRING]) +m4trace:configure.in:22: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:22: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) +m4trace:configure.in:22: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:22: -1- AC_SUBST([exec_prefix], [NONE]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([exec_prefix]) +m4trace:configure.in:22: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.in:22: -1- AC_SUBST([prefix], [NONE]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([prefix]) +m4trace:configure.in:22: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.in:22: -1- AC_SUBST([program_transform_name], [s,x,x,]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([program_transform_name]) +m4trace:configure.in:22: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.in:22: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([bindir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.in:22: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([sbindir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.in:22: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([libexecdir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.in:22: -1- AC_SUBST([datarootdir], ['${prefix}/share']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.in:22: -1- AC_SUBST([datadir], ['${datarootdir}']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([datadir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.in:22: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([sysconfdir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.in:22: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([sharedstatedir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.in:22: -1- AC_SUBST([localstatedir], ['${prefix}/var']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([localstatedir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.in:22: -1- AC_SUBST([includedir], ['${prefix}/include']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([includedir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.in:22: -1- AC_SUBST([oldincludedir], ['/usr/include']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([oldincludedir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.in:22: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.in:22: -1- AC_SUBST([infodir], ['${datarootdir}/info']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([infodir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.in:22: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.in:22: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.in:22: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.in:22: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.in:22: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([libdir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.in:22: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.in:22: -1- AC_SUBST([mandir], ['${datarootdir}/man']) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([mandir]) +m4trace:configure.in:22: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.in:22: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) +m4trace:configure.in:22: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:22: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ +#undef PACKAGE_NAME]) +m4trace:configure.in:22: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) +m4trace:configure.in:22: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:22: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME]) +m4trace:configure.in:22: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) +m4trace:configure.in:22: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:22: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ +#undef PACKAGE_VERSION]) +m4trace:configure.in:22: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) +m4trace:configure.in:22: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:22: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING]) +m4trace:configure.in:22: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) +m4trace:configure.in:22: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:22: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT]) +m4trace:configure.in:22: -1- AC_SUBST([DEFS]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([DEFS]) +m4trace:configure.in:22: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.in:22: -1- AC_SUBST([ECHO_C]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([ECHO_C]) +m4trace:configure.in:22: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.in:22: -1- AC_SUBST([ECHO_N]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([ECHO_N]) +m4trace:configure.in:22: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.in:22: -1- AC_SUBST([ECHO_T]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([ECHO_T]) +m4trace:configure.in:22: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.in:22: -1- AC_SUBST([LIBS]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.in:22: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:22: -1- AC_SUBST([build_alias]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([build_alias]) +m4trace:configure.in:22: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.in:22: -1- AC_SUBST([host_alias]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([host_alias]) +m4trace:configure.in:22: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.in:22: -1- AC_SUBST([target_alias]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([target_alias]) +m4trace:configure.in:22: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.in:30: -1- AC_SUBST([CYGPATH]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([CYGPATH]) +m4trace:configure.in:30: -1- m4_pattern_allow([^CYGPATH$]) +m4trace:configure.in:30: -1- AC_SUBST([EXEEXT]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([EXEEXT]) +m4trace:configure.in:30: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.in:30: -1- AC_SUBST([CYGPATH]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([CYGPATH]) +m4trace:configure.in:30: -1- m4_pattern_allow([^CYGPATH$]) +m4trace:configure.in:30: -1- AC_SUBST([PKG_LIB_FILE]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([PKG_LIB_FILE]) +m4trace:configure.in:30: -1- m4_pattern_allow([^PKG_LIB_FILE$]) +m4trace:configure.in:30: -1- AC_SUBST([PKG_STUB_LIB_FILE]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([PKG_STUB_LIB_FILE]) +m4trace:configure.in:30: -1- m4_pattern_allow([^PKG_STUB_LIB_FILE$]) +m4trace:configure.in:30: -1- AC_SUBST([PKG_STUB_SOURCES]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([PKG_STUB_SOURCES]) +m4trace:configure.in:30: -1- m4_pattern_allow([^PKG_STUB_SOURCES$]) +m4trace:configure.in:30: -1- AC_SUBST([PKG_STUB_OBJECTS]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([PKG_STUB_OBJECTS]) +m4trace:configure.in:30: -1- m4_pattern_allow([^PKG_STUB_OBJECTS$]) +m4trace:configure.in:30: -1- AC_SUBST([PKG_TCL_SOURCES]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([PKG_TCL_SOURCES]) +m4trace:configure.in:30: -1- m4_pattern_allow([^PKG_TCL_SOURCES$]) +m4trace:configure.in:30: -1- AC_SUBST([PKG_HEADERS]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([PKG_HEADERS]) +m4trace:configure.in:30: -1- m4_pattern_allow([^PKG_HEADERS$]) +m4trace:configure.in:30: -1- AC_SUBST([PKG_INCLUDES]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([PKG_INCLUDES]) +m4trace:configure.in:30: -1- m4_pattern_allow([^PKG_INCLUDES$]) +m4trace:configure.in:30: -1- AC_SUBST([PKG_LIBS]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([PKG_LIBS]) +m4trace:configure.in:30: -1- m4_pattern_allow([^PKG_LIBS$]) +m4trace:configure.in:30: -1- AC_SUBST([PKG_CFLAGS]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([PKG_CFLAGS]) +m4trace:configure.in:30: -1- m4_pattern_allow([^PKG_CFLAGS$]) +m4trace:configure.in:32: -1- AC_CONFIG_AUX_DIR([tclconfig]) +m4trace:configure.in:38: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +tclconfig/tcl.m4:45: TEA_PATH_TCLCONFIG is expanded from... +configure.in:38: the top level]) +m4trace:configure.in:39: -1- AC_SUBST([TCL_VERSION]) +m4trace:configure.in:39: -1- AC_SUBST_TRACE([TCL_VERSION]) +m4trace:configure.in:39: -1- m4_pattern_allow([^TCL_VERSION$]) +m4trace:configure.in:39: -1- AC_SUBST([TCL_BIN_DIR]) +m4trace:configure.in:39: -1- AC_SUBST_TRACE([TCL_BIN_DIR]) +m4trace:configure.in:39: -1- m4_pattern_allow([^TCL_BIN_DIR$]) +m4trace:configure.in:39: -1- AC_SUBST([TCL_SRC_DIR]) +m4trace:configure.in:39: -1- AC_SUBST_TRACE([TCL_SRC_DIR]) +m4trace:configure.in:39: -1- m4_pattern_allow([^TCL_SRC_DIR$]) +m4trace:configure.in:39: -1- AC_SUBST([TCL_LIB_FILE]) +m4trace:configure.in:39: -1- AC_SUBST_TRACE([TCL_LIB_FILE]) +m4trace:configure.in:39: -1- m4_pattern_allow([^TCL_LIB_FILE$]) +m4trace:configure.in:39: -1- AC_SUBST([TCL_LIB_FLAG]) +m4trace:configure.in:39: -1- AC_SUBST_TRACE([TCL_LIB_FLAG]) +m4trace:configure.in:39: -1- m4_pattern_allow([^TCL_LIB_FLAG$]) +m4trace:configure.in:39: -1- AC_SUBST([TCL_LIB_SPEC]) +m4trace:configure.in:39: -1- AC_SUBST_TRACE([TCL_LIB_SPEC]) +m4trace:configure.in:39: -1- m4_pattern_allow([^TCL_LIB_SPEC$]) +m4trace:configure.in:39: -1- AC_SUBST([TCL_STUB_LIB_FILE]) +m4trace:configure.in:39: -1- AC_SUBST_TRACE([TCL_STUB_LIB_FILE]) +m4trace:configure.in:39: -1- m4_pattern_allow([^TCL_STUB_LIB_FILE$]) +m4trace:configure.in:39: -1- AC_SUBST([TCL_STUB_LIB_FLAG]) +m4trace:configure.in:39: -1- AC_SUBST_TRACE([TCL_STUB_LIB_FLAG]) +m4trace:configure.in:39: -1- m4_pattern_allow([^TCL_STUB_LIB_FLAG$]) +m4trace:configure.in:39: -1- AC_SUBST([TCL_STUB_LIB_SPEC]) +m4trace:configure.in:39: -1- AC_SUBST_TRACE([TCL_STUB_LIB_SPEC]) +m4trace:configure.in:39: -1- m4_pattern_allow([^TCL_STUB_LIB_SPEC$]) +m4trace:configure.in:39: -1- AC_SUBST([TCL_LIBS]) +m4trace:configure.in:39: -1- AC_SUBST_TRACE([TCL_LIBS]) +m4trace:configure.in:39: -1- m4_pattern_allow([^TCL_LIBS$]) +m4trace:configure.in:39: -1- AC_SUBST([TCL_DEFS]) +m4trace:configure.in:39: -1- AC_SUBST_TRACE([TCL_DEFS]) +m4trace:configure.in:39: -1- m4_pattern_allow([^TCL_DEFS$]) +m4trace:configure.in:39: -1- AC_SUBST([TCL_EXTRA_CFLAGS]) +m4trace:configure.in:39: -1- AC_SUBST_TRACE([TCL_EXTRA_CFLAGS]) +m4trace:configure.in:39: -1- m4_pattern_allow([^TCL_EXTRA_CFLAGS$]) +m4trace:configure.in:39: -1- AC_SUBST([TCL_LD_FLAGS]) +m4trace:configure.in:39: -1- AC_SUBST_TRACE([TCL_LD_FLAGS]) +m4trace:configure.in:39: -1- m4_pattern_allow([^TCL_LD_FLAGS$]) +m4trace:configure.in:39: -1- AC_SUBST([TCL_SHLIB_LD_LIBS]) +m4trace:configure.in:39: -1- AC_SUBST_TRACE([TCL_SHLIB_LD_LIBS]) +m4trace:configure.in:39: -1- m4_pattern_allow([^TCL_SHLIB_LD_LIBS$]) +m4trace:configure.in:62: -1- AC_SUBST([CC]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:62: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:62: -1- AC_SUBST([CFLAGS]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([CFLAGS]) +m4trace:configure.in:62: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.in:62: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.in:62: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.in:62: -1- AC_SUBST([LIBS]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.in:62: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:62: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.in:62: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.in:62: -1- AC_SUBST([CC]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:62: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:62: -1- AC_SUBST([CC]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:62: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:62: -1- AC_SUBST([CC]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:62: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:62: -1- AC_SUBST([CC]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:62: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:62: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([ac_ct_CC]) +m4trace:configure.in:62: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.in:62: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([EXEEXT]) +m4trace:configure.in:62: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.in:62: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([OBJEXT]) +m4trace:configure.in:62: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.in:62: -1- AC_SUBST([CPP]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.in:62: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.in:62: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.in:62: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.in:62: -1- AC_SUBST([CPP]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.in:62: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.in:62: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.in:62: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.in:62: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.in:62: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) +m4trace:configure.in:62: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.in:62: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([INSTALL_DATA]) +m4trace:configure.in:62: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.in:62: -1- AC_SUBST([SET_MAKE]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([SET_MAKE]) +m4trace:configure.in:62: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.in:62: -1- AC_SUBST([RANLIB]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([RANLIB]) +m4trace:configure.in:62: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.in:62: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2470: AC_TRY_COMPILE is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from... +tclconfig/tcl.m4:3344: TEA_SETUP_COMPILER is expanded from... +configure.in:62: the top level]) +m4trace:configure.in:62: -1- AH_OUTPUT([WORDS_BIGENDIAN], [/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif]) +m4trace:configure.in:62: -1- AC_SUBST([GREP]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([GREP]) +m4trace:configure.in:62: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.in:62: -1- AC_SUBST([EGREP]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([EGREP]) +m4trace:configure.in:62: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) +m4trace:configure.in:62: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.in:62: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS]) +m4trace:configure.in:62: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H]) +m4trace:configure.in:62: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H]) +m4trace:configure.in:62: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H]) +m4trace:configure.in:62: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H]) +m4trace:configure.in:62: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H]) +m4trace:configure.in:62: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H]) +m4trace:configure.in:62: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H]) +m4trace:configure.in:62: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H]) +m4trace:configure.in:62: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H]) +m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([WORDS_BIGENDIAN]) +m4trace:configure.in:62: -1- m4_pattern_allow([^WORDS_BIGENDIAN$]) +m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([AC_APPLE_UNIVERSAL_BUILD]) +m4trace:configure.in:62: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$]) +m4trace:configure.in:62: -1- AH_OUTPUT([AC_APPLE_UNIVERSAL_BUILD], [/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD]) +m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NET_ERRNO_H]) +m4trace:configure.in:62: -1- m4_pattern_allow([^HAVE_NET_ERRNO_H$]) +m4trace:configure.in:62: -1- AH_OUTPUT([HAVE_NET_ERRNO_H], [/* Do we have ? */ +#undef HAVE_NET_ERRNO_H]) +m4trace:configure.in:62: -1- AC_SUBST([TCL_LIBS]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([TCL_LIBS]) +m4trace:configure.in:62: -1- m4_pattern_allow([^TCL_LIBS$]) +m4trace:configure.in:62: -1- AC_SUBST([MATH_LIBS]) +m4trace:configure.in:62: -1- AC_SUBST_TRACE([MATH_LIBS]) +m4trace:configure.in:62: -1- m4_pattern_allow([^MATH_LIBS$]) +m4trace:configure.in:62: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2527: AC_TRY_LINK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from... +tclconfig/tcl.m4:2398: TEA_MISSING_POSIX_HEADERS is expanded from... +tclconfig/tcl.m4:3344: TEA_SETUP_COMPILER is expanded from... +configure.in:62: the top level]) +m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([NO_DIRENT_H]) +m4trace:configure.in:62: -1- m4_pattern_allow([^NO_DIRENT_H$]) +m4trace:configure.in:62: -1- AH_OUTPUT([NO_DIRENT_H], [/* Do we have ? */ +#undef NO_DIRENT_H]) +m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([NO_ERRNO_H]) +m4trace:configure.in:62: -1- m4_pattern_allow([^NO_ERRNO_H$]) +m4trace:configure.in:62: -1- AH_OUTPUT([NO_ERRNO_H], [/* Do we have ? */ +#undef NO_ERRNO_H]) +m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([NO_FLOAT_H]) +m4trace:configure.in:62: -1- m4_pattern_allow([^NO_FLOAT_H$]) +m4trace:configure.in:62: -1- AH_OUTPUT([NO_FLOAT_H], [/* Do we have ? */ +#undef NO_FLOAT_H]) +m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([NO_VALUES_H]) +m4trace:configure.in:62: -1- m4_pattern_allow([^NO_VALUES_H$]) +m4trace:configure.in:62: -1- AH_OUTPUT([NO_VALUES_H], [/* Do we have ? */ +#undef NO_VALUES_H]) +m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIMITS_H]) +m4trace:configure.in:62: -1- m4_pattern_allow([^HAVE_LIMITS_H$]) +m4trace:configure.in:62: -1- AH_OUTPUT([HAVE_LIMITS_H], [/* Do we have ? */ +#undef HAVE_LIMITS_H]) +m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([NO_LIMITS_H]) +m4trace:configure.in:62: -1- m4_pattern_allow([^NO_LIMITS_H$]) +m4trace:configure.in:62: -1- AH_OUTPUT([NO_LIMITS_H], [/* Do we have ? */ +#undef NO_LIMITS_H]) +m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([NO_STDLIB_H]) +m4trace:configure.in:62: -1- m4_pattern_allow([^NO_STDLIB_H$]) +m4trace:configure.in:62: -1- AH_OUTPUT([NO_STDLIB_H], [/* Do we have ? */ +#undef NO_STDLIB_H]) +m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([NO_STRING_H]) +m4trace:configure.in:62: -1- m4_pattern_allow([^NO_STRING_H$]) +m4trace:configure.in:62: -1- AH_OUTPUT([NO_STRING_H], [/* Do we have ? */ +#undef NO_STRING_H]) +m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([NO_SYS_WAIT_H]) +m4trace:configure.in:62: -1- m4_pattern_allow([^NO_SYS_WAIT_H$]) +m4trace:configure.in:62: -1- AH_OUTPUT([NO_SYS_WAIT_H], [/* Do we have ? */ +#undef NO_SYS_WAIT_H]) +m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([NO_DLFCN_H]) +m4trace:configure.in:62: -1- m4_pattern_allow([^NO_DLFCN_H$]) +m4trace:configure.in:62: -1- AH_OUTPUT([NO_DLFCN_H], [/* Do we have ? */ +#undef NO_DLFCN_H]) +m4trace:configure.in:62: -1- _m4_warn([obsolete], [The macro `AC_HAVE_HEADERS' is obsolete. +You should run autoupdate.], [../../lib/autoconf/oldnames.m4:56: AC_HAVE_HEADERS is expanded from... +tclconfig/tcl.m4:2398: TEA_MISSING_POSIX_HEADERS is expanded from... +tclconfig/tcl.m4:3344: TEA_SETUP_COMPILER is expanded from... +configure.in:62: the top level]) +m4trace:configure.in:62: -1- AH_OUTPUT([HAVE_SYS_PARAM_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H]) +m4trace:configure.in:74: -1- AC_SUBST([PKG_SOURCES]) +m4trace:configure.in:74: -1- AC_SUBST_TRACE([PKG_SOURCES]) +m4trace:configure.in:74: -1- m4_pattern_allow([^PKG_SOURCES$]) +m4trace:configure.in:74: -1- AC_SUBST([PKG_OBJECTS]) +m4trace:configure.in:74: -1- AC_SUBST_TRACE([PKG_OBJECTS]) +m4trace:configure.in:74: -1- m4_pattern_allow([^PKG_OBJECTS$]) +m4trace:configure.in:76: -1- AC_SUBST([TCLCURL_SCRIPTS]) +m4trace:configure.in:76: -1- AC_SUBST_TRACE([TCLCURL_SCRIPTS]) +m4trace:configure.in:76: -1- m4_pattern_allow([^TCLCURL_SCRIPTS$]) +m4trace:configure.in:83: -1- AC_SUBST([curl]) +m4trace:configure.in:83: -1- AC_SUBST_TRACE([curl]) +m4trace:configure.in:83: -1- m4_pattern_allow([^curl$]) +m4trace:configure.in:83: -1- AC_SUBST([curl]) +m4trace:configure.in:83: -1- AC_SUBST_TRACE([curl]) +m4trace:configure.in:83: -1- m4_pattern_allow([^curl$]) +m4trace:configure.in:102: -1- AC_SUBST([PKG_INCLUDES]) +m4trace:configure.in:102: -1- AC_SUBST_TRACE([PKG_INCLUDES]) +m4trace:configure.in:102: -1- m4_pattern_allow([^PKG_INCLUDES$]) +m4trace:configure.in:102: -1- AC_SUBST([PKG_INCLUDES]) +m4trace:configure.in:102: -1- AC_SUBST_TRACE([PKG_INCLUDES]) +m4trace:configure.in:102: -1- m4_pattern_allow([^PKG_INCLUDES$]) +m4trace:configure.in:121: -1- AC_SUBST([PKG_LIBS]) +m4trace:configure.in:121: -1- AC_SUBST_TRACE([PKG_LIBS]) +m4trace:configure.in:121: -1- m4_pattern_allow([^PKG_LIBS$]) +m4trace:configure.in:121: -1- AC_SUBST([PKG_LIBS]) +m4trace:configure.in:121: -1- AC_SUBST_TRACE([PKG_LIBS]) +m4trace:configure.in:121: -1- m4_pattern_allow([^PKG_LIBS$]) +m4trace:configure.in:137: -1- AC_SUBST([PKG_LIBS]) +m4trace:configure.in:137: -1- AC_SUBST_TRACE([PKG_LIBS]) +m4trace:configure.in:137: -1- m4_pattern_allow([^PKG_LIBS$]) +m4trace:configure.in:157: -1- AC_DEFINE_TRACE_LITERAL([BUILD_sample]) +m4trace:configure.in:157: -1- m4_pattern_allow([^BUILD_sample$]) +m4trace:configure.in:157: -1- AH_OUTPUT([BUILD_sample], [/* Build windows export dll */ +#undef BUILD_sample]) +m4trace:configure.in:167: -1- AC_SUBST([CLEANFILES]) +m4trace:configure.in:167: -1- AC_SUBST_TRACE([CLEANFILES]) +m4trace:configure.in:167: -1- m4_pattern_allow([^CLEANFILES$]) +m4trace:configure.in:178: -1- AC_SUBST([TCL_INCLUDES]) +m4trace:configure.in:178: -1- AC_SUBST_TRACE([TCL_INCLUDES]) +m4trace:configure.in:178: -1- m4_pattern_allow([^TCL_INCLUDES$]) +m4trace:configure.in:190: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +tclconfig/tcl.m4:705: TEA_ENABLE_THREADS is expanded from... +configure.in:190: the top level]) +m4trace:configure.in:190: -1- AC_DEFINE_TRACE_LITERAL([USE_THREAD_ALLOC]) +m4trace:configure.in:190: -1- m4_pattern_allow([^USE_THREAD_ALLOC$]) +m4trace:configure.in:190: -1- AH_OUTPUT([USE_THREAD_ALLOC], [/* Do we want to use the threaded memory allocator? */ +#undef USE_THREAD_ALLOC]) +m4trace:configure.in:190: -1- AC_DEFINE_TRACE_LITERAL([_REENTRANT]) +m4trace:configure.in:190: -1- m4_pattern_allow([^_REENTRANT$]) +m4trace:configure.in:190: -1- AH_OUTPUT([_REENTRANT], [/* Do we want the reentrant OS API? */ +#undef _REENTRANT]) +m4trace:configure.in:190: -1- AC_DEFINE_TRACE_LITERAL([_POSIX_PTHREAD_SEMANTICS]) +m4trace:configure.in:190: -1- m4_pattern_allow([^_POSIX_PTHREAD_SEMANTICS$]) +m4trace:configure.in:190: -1- AH_OUTPUT([_POSIX_PTHREAD_SEMANTICS], [/* Do we really want to follow the standard? Yes we do! */ +#undef _POSIX_PTHREAD_SEMANTICS]) +m4trace:configure.in:190: -1- AC_DEFINE_TRACE_LITERAL([_THREAD_SAFE]) +m4trace:configure.in:190: -1- m4_pattern_allow([^_THREAD_SAFE$]) +m4trace:configure.in:190: -1- AH_OUTPUT([_THREAD_SAFE], [/* Do we want the thread-safe OS API? */ +#undef _THREAD_SAFE]) +m4trace:configure.in:190: -1- AC_DEFINE_TRACE_LITERAL([TCL_THREADS]) +m4trace:configure.in:190: -1- m4_pattern_allow([^TCL_THREADS$]) +m4trace:configure.in:190: -1- AH_OUTPUT([TCL_THREADS], [/* Are we building with threads enabled? */ +#undef TCL_THREADS]) +m4trace:configure.in:190: -1- AC_SUBST([TCL_THREADS]) +m4trace:configure.in:190: -1- AC_SUBST_TRACE([TCL_THREADS]) +m4trace:configure.in:190: -1- m4_pattern_allow([^TCL_THREADS$]) +m4trace:configure.in:197: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +tclconfig/tcl.m4:647: TEA_ENABLE_SHARED is expanded from... +configure.in:197: the top level]) +m4trace:configure.in:197: -1- AC_DEFINE_TRACE_LITERAL([STATIC_BUILD]) +m4trace:configure.in:197: -1- m4_pattern_allow([^STATIC_BUILD$]) +m4trace:configure.in:197: -1- AH_OUTPUT([STATIC_BUILD], [/* Is this a static build? */ +#undef STATIC_BUILD]) +m4trace:configure.in:197: -1- AC_SUBST([SHARED_BUILD]) +m4trace:configure.in:197: -1- AC_SUBST_TRACE([SHARED_BUILD]) +m4trace:configure.in:197: -1- m4_pattern_allow([^SHARED_BUILD$]) +m4trace:configure.in:205: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2527: AC_TRY_LINK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([MODULE_SCOPE]) +m4trace:configure.in:205: -1- m4_pattern_allow([^MODULE_SCOPE$]) +m4trace:configure.in:205: -1- AH_OUTPUT([MODULE_SCOPE], [/* Compiler support for module scope symbols */ +#undef MODULE_SCOPE]) +m4trace:configure.in:205: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- AC_SUBST([AR]) +m4trace:configure.in:205: -1- AC_SUBST_TRACE([AR]) +m4trace:configure.in:205: -1- m4_pattern_allow([^AR$]) +m4trace:configure.in:205: -1- AC_SUBST([PKG_LIBS]) +m4trace:configure.in:205: -1- AC_SUBST_TRACE([PKG_LIBS]) +m4trace:configure.in:205: -1- m4_pattern_allow([^PKG_LIBS$]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([_WIN32_WCE]) +m4trace:configure.in:205: -1- m4_pattern_allow([^_WIN32_WCE$]) +m4trace:configure.in:205: -1- AH_OUTPUT([_WIN32_WCE], [/* _WIN32_WCE version */ +#undef _WIN32_WCE]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([UNDER_CE]) +m4trace:configure.in:205: -1- m4_pattern_allow([^UNDER_CE$]) +m4trace:configure.in:205: -1- AH_OUTPUT([UNDER_CE], [/* UNDER_CE version */ +#undef UNDER_CE]) +m4trace:configure.in:205: -1- AC_SUBST([CELIB_DIR]) +m4trace:configure.in:205: -1- AC_SUBST_TRACE([CELIB_DIR]) +m4trace:configure.in:205: -1- m4_pattern_allow([^CELIB_DIR$]) +m4trace:configure.in:205: -1- AC_LIBSOURCE([tclLoadAix.c]) +m4trace:configure.in:205: -1- AC_SUBST([LIB@&t@OBJS], ["$LIB@&t@OBJS tclLoadAix.$ac_objext"]) +m4trace:configure.in:205: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.in:205: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([USE_DELTA_FOR_TZ]) +m4trace:configure.in:205: -1- m4_pattern_allow([^USE_DELTA_FOR_TZ$]) +m4trace:configure.in:205: -1- AH_OUTPUT([USE_DELTA_FOR_TZ], [/* Do we need a special AIX hack for timezones? */ +#undef USE_DELTA_FOR_TZ]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([_XOPEN_SOURCE_EXTENDED]) +m4trace:configure.in:205: -1- m4_pattern_allow([^_XOPEN_SOURCE_EXTENDED$]) +m4trace:configure.in:205: -1- AH_OUTPUT([_XOPEN_SOURCE_EXTENDED], [/* Do we want to use the XOPEN network library? */ +#undef _XOPEN_SOURCE_EXTENDED]) +m4trace:configure.in:205: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2527: AC_TRY_LINK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2527: AC_TRY_LINK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2527: AC_TRY_LINK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2527: AC_TRY_LINK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2527: AC_TRY_LINK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([MODULE_SCOPE]) +m4trace:configure.in:205: -1- m4_pattern_allow([^MODULE_SCOPE$]) +m4trace:configure.in:205: -1- AH_OUTPUT([MODULE_SCOPE], [/* Compiler support for module scope symbols */ +#undef MODULE_SCOPE]) +m4trace:configure.in:205: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2527: AC_TRY_LINK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2527: AC_TRY_LINK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([_OE_SOCKETS]) +m4trace:configure.in:205: -1- m4_pattern_allow([^_OE_SOCKETS$]) +m4trace:configure.in:205: -1- AH_OUTPUT([_OE_SOCKETS], [/* # needed in sys/socket.h Should OS/390 do the right thing with sockets? */ +#undef _OE_SOCKETS]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([_REENTRANT]) +m4trace:configure.in:205: -1- m4_pattern_allow([^_REENTRANT$]) +m4trace:configure.in:205: -1- AH_OUTPUT([_REENTRANT], [/* Do we want the reentrant OS API? */ +#undef _REENTRANT]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([_POSIX_PTHREAD_SEMANTICS]) +m4trace:configure.in:205: -1- m4_pattern_allow([^_POSIX_PTHREAD_SEMANTICS$]) +m4trace:configure.in:205: -1- AH_OUTPUT([_POSIX_PTHREAD_SEMANTICS], [/* Do we really want to follow the standard? Yes we do! */ +#undef _POSIX_PTHREAD_SEMANTICS]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([_REENTRANT]) +m4trace:configure.in:205: -1- m4_pattern_allow([^_REENTRANT$]) +m4trace:configure.in:205: -1- AH_OUTPUT([_REENTRANT], [/* Do we want the reentrant OS API? */ +#undef _REENTRANT]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([_POSIX_PTHREAD_SEMANTICS]) +m4trace:configure.in:205: -1- m4_pattern_allow([^_POSIX_PTHREAD_SEMANTICS$]) +m4trace:configure.in:205: -1- AH_OUTPUT([_POSIX_PTHREAD_SEMANTICS], [/* Do we really want to follow the standard? Yes we do! */ +#undef _POSIX_PTHREAD_SEMANTICS]) +m4trace:configure.in:205: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2527: AC_TRY_LINK is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- AC_SUBST([DL_LIBS]) +m4trace:configure.in:205: -1- AC_SUBST_TRACE([DL_LIBS]) +m4trace:configure.in:205: -1- m4_pattern_allow([^DL_LIBS$]) +m4trace:configure.in:205: -1- AC_SUBST([CFLAGS_DEBUG]) +m4trace:configure.in:205: -1- AC_SUBST_TRACE([CFLAGS_DEBUG]) +m4trace:configure.in:205: -1- m4_pattern_allow([^CFLAGS_DEBUG$]) +m4trace:configure.in:205: -1- AC_SUBST([CFLAGS_OPTIMIZE]) +m4trace:configure.in:205: -1- AC_SUBST_TRACE([CFLAGS_OPTIMIZE]) +m4trace:configure.in:205: -1- m4_pattern_allow([^CFLAGS_OPTIMIZE$]) +m4trace:configure.in:205: -1- AC_SUBST([CFLAGS_WARNING]) +m4trace:configure.in:205: -1- AC_SUBST_TRACE([CFLAGS_WARNING]) +m4trace:configure.in:205: -1- m4_pattern_allow([^CFLAGS_WARNING$]) +m4trace:configure.in:205: -1- AC_SUBST([STLIB_LD]) +m4trace:configure.in:205: -1- AC_SUBST_TRACE([STLIB_LD]) +m4trace:configure.in:205: -1- m4_pattern_allow([^STLIB_LD$]) +m4trace:configure.in:205: -1- AC_SUBST([SHLIB_LD]) +m4trace:configure.in:205: -1- AC_SUBST_TRACE([SHLIB_LD]) +m4trace:configure.in:205: -1- m4_pattern_allow([^SHLIB_LD$]) +m4trace:configure.in:205: -1- AC_SUBST([SHLIB_LD_LIBS]) +m4trace:configure.in:205: -1- AC_SUBST_TRACE([SHLIB_LD_LIBS]) +m4trace:configure.in:205: -1- m4_pattern_allow([^SHLIB_LD_LIBS$]) +m4trace:configure.in:205: -1- AC_SUBST([SHLIB_CFLAGS]) +m4trace:configure.in:205: -1- AC_SUBST_TRACE([SHLIB_CFLAGS]) +m4trace:configure.in:205: -1- m4_pattern_allow([^SHLIB_CFLAGS$]) +m4trace:configure.in:205: -1- AC_SUBST([LD_LIBRARY_PATH_VAR]) +m4trace:configure.in:205: -1- AC_SUBST_TRACE([LD_LIBRARY_PATH_VAR]) +m4trace:configure.in:205: -1- m4_pattern_allow([^LD_LIBRARY_PATH_VAR$]) +m4trace:configure.in:205: -3- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2470: AC_TRY_COMPILE is expanded from... +tclconfig/tcl.m4:2829: TEA_TCL_EARLY_FLAG is expanded from... +tclconfig/tcl.m4:2842: TEA_TCL_EARLY_FLAGS is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -2- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2470: AC_TRY_COMPILE is expanded from... +tclconfig/tcl.m4:2829: TEA_TCL_EARLY_FLAG is expanded from... +tclconfig/tcl.m4:2842: TEA_TCL_EARLY_FLAGS is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([_ISOC99_SOURCE]) +m4trace:configure.in:205: -1- m4_pattern_allow([^_ISOC99_SOURCE$]) +m4trace:configure.in:205: -1- AH_OUTPUT([_ISOC99_SOURCE], [/* Add the _ISOC99_SOURCE flag when building */ +#undef _ISOC99_SOURCE]) +m4trace:configure.in:205: -3- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2470: AC_TRY_COMPILE is expanded from... +tclconfig/tcl.m4:2829: TEA_TCL_EARLY_FLAG is expanded from... +tclconfig/tcl.m4:2842: TEA_TCL_EARLY_FLAGS is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -2- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2470: AC_TRY_COMPILE is expanded from... +tclconfig/tcl.m4:2829: TEA_TCL_EARLY_FLAG is expanded from... +tclconfig/tcl.m4:2842: TEA_TCL_EARLY_FLAGS is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([_LARGEFILE64_SOURCE]) +m4trace:configure.in:205: -1- m4_pattern_allow([^_LARGEFILE64_SOURCE$]) +m4trace:configure.in:205: -1- AH_OUTPUT([_LARGEFILE64_SOURCE], [/* Add the _LARGEFILE64_SOURCE flag when building */ +#undef _LARGEFILE64_SOURCE]) +m4trace:configure.in:205: -3- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2470: AC_TRY_COMPILE is expanded from... +tclconfig/tcl.m4:2829: TEA_TCL_EARLY_FLAG is expanded from... +tclconfig/tcl.m4:2842: TEA_TCL_EARLY_FLAGS is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -2- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2470: AC_TRY_COMPILE is expanded from... +tclconfig/tcl.m4:2829: TEA_TCL_EARLY_FLAG is expanded from... +tclconfig/tcl.m4:2842: TEA_TCL_EARLY_FLAGS is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([_LARGEFILE_SOURCE64]) +m4trace:configure.in:205: -1- m4_pattern_allow([^_LARGEFILE_SOURCE64$]) +m4trace:configure.in:205: -1- AH_OUTPUT([_LARGEFILE_SOURCE64], [/* Add the _LARGEFILE_SOURCE64 flag when building */ +#undef _LARGEFILE_SOURCE64]) +m4trace:configure.in:205: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2470: AC_TRY_COMPILE is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +tclconfig/tcl.m4:2877: TEA_TCL_64BIT_FLAGS is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2470: AC_TRY_COMPILE is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +tclconfig/tcl.m4:2877: TEA_TCL_64BIT_FLAGS is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([TCL_WIDE_INT_IS_LONG]) +m4trace:configure.in:205: -1- m4_pattern_allow([^TCL_WIDE_INT_IS_LONG$]) +m4trace:configure.in:205: -1- AH_OUTPUT([TCL_WIDE_INT_IS_LONG], [/* Are wide integers to be implemented with C \'long\'s? */ +#undef TCL_WIDE_INT_IS_LONG]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([TCL_WIDE_INT_TYPE]) +m4trace:configure.in:205: -1- m4_pattern_allow([^TCL_WIDE_INT_TYPE$]) +m4trace:configure.in:205: -1- AH_OUTPUT([TCL_WIDE_INT_TYPE], [/* What type should be used to define wide integers? */ +#undef TCL_WIDE_INT_TYPE]) +m4trace:configure.in:205: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2470: AC_TRY_COMPILE is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from... +tclconfig/tcl.m4:2877: TEA_TCL_64BIT_FLAGS is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_DIRENT64]) +m4trace:configure.in:205: -1- m4_pattern_allow([^HAVE_STRUCT_DIRENT64$]) +m4trace:configure.in:205: -1- AH_OUTPUT([HAVE_STRUCT_DIRENT64], [/* Is \'struct dirent64\' in ? */ +#undef HAVE_STRUCT_DIRENT64]) +m4trace:configure.in:205: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2470: AC_TRY_COMPILE is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from... +tclconfig/tcl.m4:2877: TEA_TCL_64BIT_FLAGS is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT64]) +m4trace:configure.in:205: -1- m4_pattern_allow([^HAVE_STRUCT_STAT64$]) +m4trace:configure.in:205: -1- AH_OUTPUT([HAVE_STRUCT_STAT64], [/* Is \'struct stat64\' in ? */ +#undef HAVE_STRUCT_STAT64]) +m4trace:configure.in:205: -1- AH_OUTPUT([HAVE_OPEN64], [/* Define to 1 if you have the `open64\' function. */ +#undef HAVE_OPEN64]) +m4trace:configure.in:205: -1- AH_OUTPUT([HAVE_LSEEK64], [/* Define to 1 if you have the `lseek64\' function. */ +#undef HAVE_LSEEK64]) +m4trace:configure.in:205: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2470: AC_TRY_COMPILE is expanded from... +../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from... +../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from... +tclconfig/tcl.m4:2877: TEA_TCL_64BIT_FLAGS is expanded from... +tclconfig/tcl.m4:1040: TEA_CONFIG_CFLAGS is expanded from... +configure.in:205: the top level]) +m4trace:configure.in:205: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TYPE_OFF64_T]) +m4trace:configure.in:205: -1- m4_pattern_allow([^HAVE_TYPE_OFF64_T$]) +m4trace:configure.in:205: -1- AH_OUTPUT([HAVE_TYPE_OFF64_T], [/* Is off64_t in ? */ +#undef HAVE_TYPE_OFF64_T]) +m4trace:configure.in:211: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +tclconfig/tcl.m4:834: TEA_ENABLE_SYMBOLS is expanded from... +configure.in:211: the top level]) +m4trace:configure.in:211: -1- AC_SUBST([CFLAGS_DEFAULT]) +m4trace:configure.in:211: -1- AC_SUBST_TRACE([CFLAGS_DEFAULT]) +m4trace:configure.in:211: -1- m4_pattern_allow([^CFLAGS_DEFAULT$]) +m4trace:configure.in:211: -1- AC_SUBST([LDFLAGS_DEFAULT]) +m4trace:configure.in:211: -1- AC_SUBST_TRACE([LDFLAGS_DEFAULT]) +m4trace:configure.in:211: -1- m4_pattern_allow([^LDFLAGS_DEFAULT$]) +m4trace:configure.in:211: -1- AC_SUBST([TCL_DBGX]) +m4trace:configure.in:211: -1- AC_SUBST_TRACE([TCL_DBGX]) +m4trace:configure.in:211: -1- m4_pattern_allow([^TCL_DBGX$]) +m4trace:configure.in:211: -1- AC_DEFINE_TRACE_LITERAL([TCL_MEM_DEBUG]) +m4trace:configure.in:211: -1- m4_pattern_allow([^TCL_MEM_DEBUG$]) +m4trace:configure.in:211: -1- AH_OUTPUT([TCL_MEM_DEBUG], [/* Is memory debugging enabled? */ +#undef TCL_MEM_DEBUG]) +m4trace:configure.in:220: -1- AC_DEFINE_TRACE_LITERAL([USE_TCL_STUBS]) +m4trace:configure.in:220: -1- m4_pattern_allow([^USE_TCL_STUBS$]) +m4trace:configure.in:220: -1- AH_OUTPUT([USE_TCL_STUBS], [/* Use Tcl stubs */ +#undef USE_TCL_STUBS]) +m4trace:configure.in:229: -1- AC_SUBST([MAKE_LIB]) +m4trace:configure.in:229: -1- AC_SUBST_TRACE([MAKE_LIB]) +m4trace:configure.in:229: -1- m4_pattern_allow([^MAKE_LIB$]) +m4trace:configure.in:229: -1- AC_SUBST([MAKE_SHARED_LIB]) +m4trace:configure.in:229: -1- AC_SUBST_TRACE([MAKE_SHARED_LIB]) +m4trace:configure.in:229: -1- m4_pattern_allow([^MAKE_SHARED_LIB$]) +m4trace:configure.in:229: -1- AC_SUBST([MAKE_STATIC_LIB]) +m4trace:configure.in:229: -1- AC_SUBST_TRACE([MAKE_STATIC_LIB]) +m4trace:configure.in:229: -1- m4_pattern_allow([^MAKE_STATIC_LIB$]) +m4trace:configure.in:229: -1- AC_SUBST([MAKE_STUB_LIB]) +m4trace:configure.in:229: -1- AC_SUBST_TRACE([MAKE_STUB_LIB]) +m4trace:configure.in:229: -1- m4_pattern_allow([^MAKE_STUB_LIB$]) +m4trace:configure.in:229: -1- AC_SUBST([RANLIB_STUB]) +m4trace:configure.in:229: -1- AC_SUBST_TRACE([RANLIB_STUB]) +m4trace:configure.in:229: -1- m4_pattern_allow([^RANLIB_STUB$]) +m4trace:configure.in:239: -1- AC_SUBST([TCLSH_PROG]) +m4trace:configure.in:239: -1- AC_SUBST_TRACE([TCLSH_PROG]) +m4trace:configure.in:239: -1- m4_pattern_allow([^TCLSH_PROG$]) +m4trace:configure.in:248: -1- AC_CONFIG_FILES([Makefile pkgIndex.tcl]) +m4trace:configure.in:248: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. +You should run autoupdate.], []) +m4trace:configure.in:248: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +m4trace:configure.in:248: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.in:248: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.in:248: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +m4trace:configure.in:248: -1- AC_SUBST_TRACE([LTLIBOBJS]) +m4trace:configure.in:248: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.in:248: -1- _m4_warn([obsolete], [AC_C_BIGENDIAN should be used with AC_CONFIG_HEADERS], []) +m4trace:configure.in:248: -1- AC_SUBST_TRACE([top_builddir]) +m4trace:configure.in:248: -1- AC_SUBST_TRACE([top_build_prefix]) +m4trace:configure.in:248: -1- AC_SUBST_TRACE([srcdir]) +m4trace:configure.in:248: -1- AC_SUBST_TRACE([abs_srcdir]) +m4trace:configure.in:248: -1- AC_SUBST_TRACE([top_srcdir]) +m4trace:configure.in:248: -1- AC_SUBST_TRACE([abs_top_srcdir]) +m4trace:configure.in:248: -1- AC_SUBST_TRACE([builddir]) +m4trace:configure.in:248: -1- AC_SUBST_TRACE([abs_builddir]) +m4trace:configure.in:248: -1- AC_SUBST_TRACE([abs_top_builddir]) +m4trace:configure.in:248: -1- AC_SUBST_TRACE([INSTALL]) diff --git a/checkAutoPath.tcl b/checkAutoPath.tcl new file mode 100755 index 0000000..71d41a6 --- /dev/null +++ b/checkAutoPath.tcl @@ -0,0 +1,17 @@ +# This file checks that the directory where TclCurl is going to be +# installed is actually in the auto_path variable, if it isn't it +# modifies 'init.tcl'. + +set tclCurlDir [lindex $argv 0] +set initTclDir [lindex $argv 1] +set initFile [file join $tcl_library init.tcl] +if {[file writable $initFile]==0} exit + + +if {[lsearch $auto_path $tclCurlDir]==-1} { + set handle [open "$initFile" a] + puts $handle "\nlappend auto_path $tclCurlDir\n" +} + +exit + diff --git a/configure b/configure new file mode 100755 index 0000000..9b58381 --- /dev/null +++ b/configure @@ -0,0 +1,12598 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.63 for TclCurl 7.19.6. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME='TclCurl' +PACKAGE_TARNAME='tclcurl' +PACKAGE_VERSION='7.19.6' +PACKAGE_STRING='TclCurl 7.19.6' +PACKAGE_BUGREPORT='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='LTLIBOBJS +TCLSH_PROG +RANLIB_STUB +MAKE_STUB_LIB +MAKE_STATIC_LIB +MAKE_SHARED_LIB +MAKE_LIB +TCL_DBGX +LDFLAGS_DEFAULT +CFLAGS_DEFAULT +LD_LIBRARY_PATH_VAR +SHLIB_CFLAGS +SHLIB_LD_LIBS +SHLIB_LD +STLIB_LD +CFLAGS_WARNING +CFLAGS_OPTIMIZE +CFLAGS_DEBUG +DL_LIBS +LIBOBJS +CELIB_DIR +AR +SHARED_BUILD +TCL_THREADS +TCL_INCLUDES +CLEANFILES +curl +TCLCURL_SCRIPTS +PKG_OBJECTS +PKG_SOURCES +MATH_LIBS +EGREP +GREP +RANLIB +SET_MAKE +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +CPP +OBJEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +TCL_SHLIB_LD_LIBS +TCL_LD_FLAGS +TCL_EXTRA_CFLAGS +TCL_DEFS +TCL_LIBS +TCL_STUB_LIB_SPEC +TCL_STUB_LIB_FLAG +TCL_STUB_LIB_FILE +TCL_LIB_SPEC +TCL_LIB_FLAG +TCL_LIB_FILE +TCL_SRC_DIR +TCL_BIN_DIR +TCL_VERSION +PKG_CFLAGS +PKG_LIBS +PKG_INCLUDES +PKG_HEADERS +PKG_TCL_SOURCES +PKG_STUB_OBJECTS +PKG_STUB_SOURCES +PKG_STUB_LIB_FILE +PKG_LIB_FILE +EXEEXT +CYGPATH +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_tcl +with_curlprefix +with_curlinclude +with_libcurl +with_tclinclude +enable_threads +enable_shared +enable_64bit +enable_64bit_vis +enable_rpath +enable_wince +with_celib +enable_load +enable_symbols +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { $as_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 && + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures TclCurl 7.19.6 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/tclcurl] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of TclCurl 7.19.6:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-threads build with threads + --enable-shared build and link with shared libraries (default: on) + --enable-64bit enable 64bit support (default: off) + --enable-64bit-vis enable 64bit Sparc VIS support (default: off) + --disable-rpath disable rpath support (default: on) + --enable-wince enable Win/CE support (where applicable) + --enable-load allow dynamic loading and "load" command (default: + on) + --enable-symbols build with debugging symbols (default: off) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-tcl directory containing tcl configuration + (tclConfig.sh) + --with-curlprefix base directory for the cURL install '/usr', '/usr/local',... + --with-curlinclude directory containing the public libcurl header files + --with-libcurl directory containing libcurl + --with-tclinclude directory containing the public Tcl header files + --with-celib=DIR use Windows/CE support library from DIR + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +TclCurl configure 7.19.6 +generated by GNU Autoconf 2.63 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by TclCurl $as_me 7.19.6, which was +generated by GNU Autoconf 2.63. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test -r "$ac_site_file"; then + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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 + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +#-------------------------------------------------------------------- +# Call TEA_INIT as the first TEA_ macro to set up initial vars. +# This will define a ${TEA_PLATFORM} variable == "unix" or "windows" +# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. +#-------------------------------------------------------------------- + + + # TEA extensions pass this us the version of TEA they think they + # are compatible with. + TEA_VERSION="3.7" + + { $as_echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 +$as_echo_n "checking for correct TEA configuration... " >&6; } + if test x"${PACKAGE_NAME}" = x ; then + { { $as_echo "$as_me:$LINENO: error: +The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 +$as_echo "$as_me: error: +The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} + { (exit 1); exit 1; }; } + fi + if test x"3.7" = x ; then + { { $as_echo "$as_me:$LINENO: error: +TEA version not specified." >&5 +$as_echo "$as_me: error: +TEA version not specified." >&2;} + { (exit 1); exit 1; }; } + elif test "3.7" != "${TEA_VERSION}" ; then + { $as_echo "$as_me:$LINENO: result: warning: requested TEA version \"3.7\", have \"${TEA_VERSION}\"" >&5 +$as_echo "warning: requested TEA version \"3.7\", have \"${TEA_VERSION}\"" >&6; } + else + { $as_echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 +$as_echo "ok (TEA ${TEA_VERSION})" >&6; } + fi + case "`uname -s`" in + *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) + # Extract the first word of "cygpath", so it can be a program name with args. +set dummy cygpath; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CYGPATH+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CYGPATH"; then + ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CYGPATH="cygpath -w" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" +fi +fi +CYGPATH=$ac_cv_prog_CYGPATH +if test -n "$CYGPATH"; then + { $as_echo "$as_me:$LINENO: result: $CYGPATH" >&5 +$as_echo "$CYGPATH" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + EXEEXT=".exe" + TEA_PLATFORM="windows" + ;; + *) + CYGPATH=echo + EXEEXT="" + TEA_PLATFORM="unix" + ;; + esac + + # Check if exec_prefix is set. If not use fall back to prefix. + # Note when adjusted, so that TEA_PREFIX can correct for this. + # This is needed for recursive configures, since autoconf propagates + # $prefix, but not $exec_prefix (doh!). + if test x$exec_prefix = xNONE ; then + exec_prefix_default=yes + exec_prefix=$prefix + fi + + + + + # This package name must be replaced statically for AC_SUBST to work + + # Substitute STUB_LIB_FILE in case package creates a stub library too. + + + # We AC_SUBST these here to ensure they are subst'ed, + # in case the user doesn't call TEA_ADD_... + + + + + + + + + +ac_aux_dir= +for ac_dir in tclconfig "$srcdir"/tclconfig; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in tclconfig \"$srcdir\"/tclconfig" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in tclconfig \"$srcdir\"/tclconfig" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + +#-------------------------------------------------------------------- +# Load the tclConfig.sh file +#-------------------------------------------------------------------- + + + + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + +# Check whether --with-tcl was given. +if test "${with_tcl+set}" = set; then + withval=$with_tcl; with_tclconfig=${withval} +fi + + { $as_echo "$as_me:$LINENO: checking for Tcl configuration" >&5 +$as_echo_n "checking for Tcl configuration... " >&6; } + if test "${ac_cv_c_tclconfig+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + case ${with_tclconfig} in + */tclConfig.sh ) + if test -f ${with_tclconfig}; then + { $as_echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 +$as_echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} + with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + { { $as_echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 +$as_echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test "${TEA_PLATFORM}" = "windows" \ + -a -f "$i/win/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/win; pwd)` + break + fi + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tcl.framework/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` + break + fi + done + fi + + # TEA specific: on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test "${TEA_PLATFORM}" = "windows" \ + -a -f "$i/win/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/win; pwd)` + break + fi + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + +fi + + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + { { $as_echo "$as_me:$LINENO: error: Can't find Tcl configuration definitions" >&5 +$as_echo "$as_me: error: Can't find Tcl configuration definitions" >&2;} + { (exit 1); exit 1; }; } + else + no_tcl= + TCL_BIN_DIR=${ac_cv_c_tclconfig} + { $as_echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 +$as_echo "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; } + fi + fi + + + { $as_echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 +$as_echo_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... " >&6; } + + if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then + { $as_echo "$as_me:$LINENO: result: loading" >&5 +$as_echo "loading" >&6; } + . "${TCL_BIN_DIR}/tclConfig.sh" + else + { $as_echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 +$as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tcl.framework installed in an arbitrary location. + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then + for i in "`cd ${TCL_BIN_DIR}; pwd`" \ + "`cd ${TCL_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then + TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" + break + fi + done + fi + if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then + TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" + TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + + + + + + + + + + + + + # TEA specific: + + + + + + + +#-------------------------------------------------------------------- +# Load the tkConfig.sh file if necessary (Tk extension) +#-------------------------------------------------------------------- + +#TEA_PATH_TKCONFIG +#TEA_LOAD_TKCONFIG + +#----------------------------------------------------------------------- +# Handle the --prefix=... option by defaulting to what Tcl gave. +# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. +#----------------------------------------------------------------------- + + + if test "${prefix}" = "NONE"; then + prefix_default=yes + if test x"${TCL_PREFIX}" != x; then + { $as_echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 +$as_echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} + prefix=${TCL_PREFIX} + else + { $as_echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 +$as_echo "$as_me: --prefix defaulting to /usr/local" >&6;} + prefix=/usr/local + fi + fi + if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ + -o x"${exec_prefix_default}" = x"yes" ; then + if test x"${TCL_EXEC_PREFIX}" != x; then + { $as_echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 +$as_echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} + exec_prefix=${TCL_EXEC_PREFIX} + else + { $as_echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 +$as_echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} + exec_prefix=$prefix + fi + fi + + +#----------------------------------------------------------------------- +# Standard compiler checks. +# This sets up CC by using the CC env var, or looks for gcc otherwise. +# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create +# the basic setup necessary to compile executables. +#----------------------------------------------------------------------- + + + # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) + # in this macro, they need to go into TEA_SETUP_COMPILER instead. + + # If the user did not set CFLAGS, set it now to keep + # the AC_PROG_CC macro from adding "-g -O2". + if test "${CFLAGS+set}" != "set" ; then + CFLAGS="" + 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 +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +$as_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. +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_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.out.dSYM 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. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +if test -z "$ac_file"; then + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; }; } +fi + +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_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 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_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 +$as_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 +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +$as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +$as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + 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 +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +$as_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 + + + # 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. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + +done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + + #-------------------------------------------------------------------- + # Checks to see if the make program sets the $MAKE variable. + #-------------------------------------------------------------------- + + { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + + #-------------------------------------------------------------------- + # Find ranlib + #-------------------------------------------------------------------- + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + #-------------------------------------------------------------------- + # Determines the correct binary file extension (.o, .obj, .exe etc.) + #-------------------------------------------------------------------- + + + + + + +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. + + + #------------------------------------------------------------------------ + # If we're using GCC, see if the compiler understands -pipe. If so, use it. + # It makes compiling go faster. (This is only a performance feature.) + #------------------------------------------------------------------------ + + if test -z "$no_pipe" -a -n "$GCC"; then + { $as_echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 +$as_echo_n "checking if the compiler understands -pipe... " >&6; } +if test "${tcl_cv_cc_pipe+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_cc_pipe=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_cc_pipe=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 +$as_echo "$tcl_cv_cc_pipe" >&6; } + if test $tcl_cv_cc_pipe = yes; then + CFLAGS="$CFLAGS -pipe" + fi + fi + + #-------------------------------------------------------------------- + # Common compiler flag setup + #-------------------------------------------------------------------- + + + { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + # Check for potential -arch flags. It is not universal unless + # there are some -arch flags. Note that *ppc* also matches + # ppc64. This check is also rather less than ideal. + case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( + *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; + esac +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_bigendian=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_bigendian=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then + # Try to guess by grepping values from an object file. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF +;; #( + no) + ;; #( + universal) + +cat >>confdefs.h <<\_ACEOF +#define AC_APPLE_UNIVERSAL_BUILD 1 +_ACEOF + + ;; #( + *) + { { $as_echo "$as_me:$LINENO: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +$as_echo "$as_me: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; + esac + + if test "${TEA_PLATFORM}" = "unix" ; then + + #-------------------------------------------------------------------- + # On a few very rare systems, all of the libm.a stuff is + # already in libc.a. Set compiler flags accordingly. + # Also, Linux requires the "ieee" library for math to work + # right (and it must appear before "-lm"). + #-------------------------------------------------------------------- + + { $as_echo "$as_me:$LINENO: checking for sin" >&5 +$as_echo_n "checking for sin... " >&6; } +if test "${ac_cv_func_sin+set}" = set; then + $as_echo_n "(cached) " >&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 sin to an innocuous variant, in case declares sin. + For example, HP-UX 11i declares gettimeofday. */ +#define sin innocuous_sin + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char sin (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef sin + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sin (); +/* 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_sin || defined __stub___sin +choke me +#endif + +int +main () +{ +return sin (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_sin=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_sin=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 +$as_echo "$ac_cv_func_sin" >&6; } +if test "x$ac_cv_func_sin" = x""yes; then + MATH_LIBS="" +else + MATH_LIBS="-lm" +fi + + { $as_echo "$as_me:$LINENO: checking for main in -lieee" >&5 +$as_echo_n "checking for main in -lieee... " >&6; } +if test "${ac_cv_lib_ieee_main+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lieee $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_ieee_main=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ieee_main=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 +$as_echo "$ac_cv_lib_ieee_main" >&6; } +if test "x$ac_cv_lib_ieee_main" = x""yes; then + MATH_LIBS="-lieee $MATH_LIBS" +fi + + + #-------------------------------------------------------------------- + # Interactive UNIX requires -linet instead of -lsocket, plus it + # needs net/errno.h to define the socket-related error codes. + #-------------------------------------------------------------------- + + { $as_echo "$as_me:$LINENO: checking for main in -linet" >&5 +$as_echo_n "checking for main in -linet... " >&6; } +if test "${ac_cv_lib_inet_main+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-linet $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_inet_main=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_inet_main=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 +$as_echo "$ac_cv_lib_inet_main" >&6; } +if test "x$ac_cv_lib_inet_main" = x""yes; then + LIBS="$LIBS -linet" +fi + + if test "${ac_cv_header_net_errno_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for net/errno.h" >&5 +$as_echo_n "checking for net/errno.h... " >&6; } +if test "${ac_cv_header_net_errno_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 +$as_echo "$ac_cv_header_net_errno_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking net/errno.h usability" >&5 +$as_echo_n "checking net/errno.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking net/errno.h presence" >&5 +$as_echo_n "checking net/errno.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for net/errno.h" >&5 +$as_echo_n "checking for net/errno.h... " >&6; } +if test "${ac_cv_header_net_errno_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_net_errno_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 +$as_echo "$ac_cv_header_net_errno_h" >&6; } + +fi +if test "x$ac_cv_header_net_errno_h" = x""yes; then + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_NET_ERRNO_H 1 +_ACEOF + +fi + + + + #-------------------------------------------------------------------- + # Check for the existence of the -lsocket and -lnsl libraries. + # The order here is important, so that they end up in the right + # order in the command line generated by make. Here are some + # special considerations: + # 1. Use "connect" and "accept" to check for -lsocket, and + # "gethostbyname" to check for -lnsl. + # 2. Use each function name only once: can't redo a check because + # autoconf caches the results of the last check and won't redo it. + # 3. Use -lnsl and -lsocket only if they supply procedures that + # aren't already present in the normal libraries. This is because + # IRIX 5.2 has libraries, but they aren't needed and they're + # bogus: they goof up name resolution if used. + # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. + # To get around this problem, check for both libraries together + # if -lsocket doesn't work by itself. + #-------------------------------------------------------------------- + + tcl_checkBoth=0 + { $as_echo "$as_me:$LINENO: checking for connect" >&5 +$as_echo_n "checking for connect... " >&6; } +if test "${ac_cv_func_connect+set}" = set; then + $as_echo_n "(cached) " >&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 connect to an innocuous variant, in case declares connect. + For example, HP-UX 11i declares gettimeofday. */ +#define connect innocuous_connect + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef connect + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char connect (); +/* 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_connect || defined __stub___connect +choke me +#endif + +int +main () +{ +return connect (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_connect=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_connect=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +$as_echo "$ac_cv_func_connect" >&6; } +if test "x$ac_cv_func_connect" = x""yes; then + tcl_checkSocket=0 +else + tcl_checkSocket=1 +fi + + if test "$tcl_checkSocket" = 1; then + { $as_echo "$as_me:$LINENO: checking for setsockopt" >&5 +$as_echo_n "checking for setsockopt... " >&6; } +if test "${ac_cv_func_setsockopt+set}" = set; then + $as_echo_n "(cached) " >&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 setsockopt to an innocuous variant, in case declares setsockopt. + For example, HP-UX 11i declares gettimeofday. */ +#define setsockopt innocuous_setsockopt + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char setsockopt (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef setsockopt + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char setsockopt (); +/* 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_setsockopt || defined __stub___setsockopt +choke me +#endif + +int +main () +{ +return setsockopt (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_setsockopt=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_setsockopt=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 +$as_echo "$ac_cv_func_setsockopt" >&6; } +if test "x$ac_cv_func_setsockopt" = x""yes; then + : +else + { $as_echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 +$as_echo_n "checking for setsockopt in -lsocket... " >&6; } +if test "${ac_cv_lib_socket_setsockopt+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char setsockopt (); +int +main () +{ +return setsockopt (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_socket_setsockopt=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_socket_setsockopt=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 +$as_echo "$ac_cv_lib_socket_setsockopt" >&6; } +if test "x$ac_cv_lib_socket_setsockopt" = x""yes; then + LIBS="$LIBS -lsocket" +else + tcl_checkBoth=1 +fi + +fi + + fi + if test "$tcl_checkBoth" = 1; then + tk_oldLibs=$LIBS + LIBS="$LIBS -lsocket -lnsl" + { $as_echo "$as_me:$LINENO: checking for accept" >&5 +$as_echo_n "checking for accept... " >&6; } +if test "${ac_cv_func_accept+set}" = set; then + $as_echo_n "(cached) " >&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 accept to an innocuous variant, in case declares accept. + For example, HP-UX 11i declares gettimeofday. */ +#define accept innocuous_accept + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char accept (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef accept + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char accept (); +/* 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_accept || defined __stub___accept +choke me +#endif + +int +main () +{ +return accept (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_accept=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_accept=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 +$as_echo "$ac_cv_func_accept" >&6; } +if test "x$ac_cv_func_accept" = x""yes; then + tcl_checkNsl=0 +else + LIBS=$tk_oldLibs +fi + + fi + { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5 +$as_echo_n "checking for gethostbyname... " >&6; } +if test "${ac_cv_func_gethostbyname+set}" = set; then + $as_echo_n "(cached) " >&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 gethostbyname to an innocuous variant, in case declares gethostbyname. + For example, HP-UX 11i declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef gethostbyname + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +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 +#endif + +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_gethostbyname=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_gethostbyname=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +$as_echo "$ac_cv_func_gethostbyname" >&6; } +if test "x$ac_cv_func_gethostbyname" = x""yes; then + : +else + { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_nsl_gethostbyname=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_nsl_gethostbyname=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then + LIBS="$LIBS -lnsl" +fi + +fi + + + # TEA specific: Don't perform the eval of the libraries here because + # DL_LIBS won't be set until we call TEA_CONFIG_CFLAGS + + TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' + + + + + { $as_echo "$as_me:$LINENO: checking dirent.h" >&5 +$as_echo_n "checking dirent.h... " >&6; } +if test "${tcl_cv_dirent_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ + +#ifndef _POSIX_SOURCE +# ifdef __Lynx__ + /* + * Generate compilation error to make the test fail: Lynx headers + * are only valid if really in the POSIX environment. + */ + + missing_procedure(); +# endif +#endif +DIR *d; +struct dirent *entryPtr; +char *p; +d = opendir("foobar"); +entryPtr = readdir(d); +p = entryPtr->d_name; +closedir(d); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_dirent_h=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_dirent_h=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 +$as_echo "$tcl_cv_dirent_h" >&6; } + + if test $tcl_cv_dirent_h = no; then + +cat >>confdefs.h <<\_ACEOF +#define NO_DIRENT_H 1 +_ACEOF + + fi + + # TEA specific: + if test "${ac_cv_header_errno_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for errno.h" >&5 +$as_echo_n "checking for errno.h... " >&6; } +if test "${ac_cv_header_errno_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 +$as_echo "$ac_cv_header_errno_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking errno.h usability" >&5 +$as_echo_n "checking errno.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking errno.h presence" >&5 +$as_echo_n "checking errno.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for errno.h" >&5 +$as_echo_n "checking for errno.h... " >&6; } +if test "${ac_cv_header_errno_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_errno_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 +$as_echo "$ac_cv_header_errno_h" >&6; } + +fi +if test "x$ac_cv_header_errno_h" = x""yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_ERRNO_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_float_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for float.h" >&5 +$as_echo_n "checking for float.h... " >&6; } +if test "${ac_cv_header_float_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 +$as_echo "$ac_cv_header_float_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking float.h usability" >&5 +$as_echo_n "checking float.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking float.h presence" >&5 +$as_echo_n "checking float.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for float.h" >&5 +$as_echo_n "checking for float.h... " >&6; } +if test "${ac_cv_header_float_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_float_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 +$as_echo "$ac_cv_header_float_h" >&6; } + +fi +if test "x$ac_cv_header_float_h" = x""yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_FLOAT_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_values_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for values.h" >&5 +$as_echo_n "checking for values.h... " >&6; } +if test "${ac_cv_header_values_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 +$as_echo "$ac_cv_header_values_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking values.h usability" >&5 +$as_echo_n "checking values.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking values.h presence" >&5 +$as_echo_n "checking values.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for values.h" >&5 +$as_echo_n "checking for values.h... " >&6; } +if test "${ac_cv_header_values_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_values_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 +$as_echo "$ac_cv_header_values_h" >&6; } + +fi +if test "x$ac_cv_header_values_h" = x""yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_VALUES_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_limits_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for limits.h" >&5 +$as_echo_n "checking for limits.h... " >&6; } +if test "${ac_cv_header_limits_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 +$as_echo "$ac_cv_header_limits_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking limits.h usability" >&5 +$as_echo_n "checking limits.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking limits.h presence" >&5 +$as_echo_n "checking limits.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for limits.h" >&5 +$as_echo_n "checking for limits.h... " >&6; } +if test "${ac_cv_header_limits_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_limits_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 +$as_echo "$ac_cv_header_limits_h" >&6; } + +fi +if test "x$ac_cv_header_limits_h" = x""yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIMITS_H 1 +_ACEOF + +else + +cat >>confdefs.h <<\_ACEOF +#define NO_LIMITS_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_stdlib_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for stdlib.h" >&5 +$as_echo_n "checking for stdlib.h... " >&6; } +if test "${ac_cv_header_stdlib_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +$as_echo "$ac_cv_header_stdlib_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking stdlib.h usability" >&5 +$as_echo_n "checking stdlib.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking stdlib.h presence" >&5 +$as_echo_n "checking stdlib.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for stdlib.h" >&5 +$as_echo_n "checking for stdlib.h... " >&6; } +if test "${ac_cv_header_stdlib_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_stdlib_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +$as_echo "$ac_cv_header_stdlib_h" >&6; } + +fi +if test "x$ac_cv_header_stdlib_h" = x""yes; then + tcl_ok=1 +else + tcl_ok=0 +fi + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtol" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtoul" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtod" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + if test $tcl_ok = 0; then + +cat >>confdefs.h <<\_ACEOF +#define NO_STDLIB_H 1 +_ACEOF + + fi + if test "${ac_cv_header_string_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for string.h" >&5 +$as_echo_n "checking for string.h... " >&6; } +if test "${ac_cv_header_string_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 +$as_echo "$ac_cv_header_string_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking string.h usability" >&5 +$as_echo_n "checking string.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking string.h presence" >&5 +$as_echo_n "checking string.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for string.h" >&5 +$as_echo_n "checking for string.h... " >&6; } +if test "${ac_cv_header_string_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_string_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 +$as_echo "$ac_cv_header_string_h" >&6; } + +fi +if test "x$ac_cv_header_string_h" = x""yes; then + tcl_ok=1 +else + tcl_ok=0 +fi + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strstr" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strerror" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + + # See also memmove check below for a place where NO_STRING_H can be + # set and why. + + if test $tcl_ok = 0; then + +cat >>confdefs.h <<\_ACEOF +#define NO_STRING_H 1 +_ACEOF + + fi + + if test "${ac_cv_header_sys_wait_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for sys/wait.h" >&5 +$as_echo_n "checking for sys/wait.h... " >&6; } +if test "${ac_cv_header_sys_wait_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +$as_echo "$ac_cv_header_sys_wait_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 +$as_echo_n "checking sys/wait.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 +$as_echo_n "checking sys/wait.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for sys/wait.h" >&5 +$as_echo_n "checking for sys/wait.h... " >&6; } +if test "${ac_cv_header_sys_wait_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_sys_wait_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +$as_echo "$ac_cv_header_sys_wait_h" >&6; } + +fi +if test "x$ac_cv_header_sys_wait_h" = x""yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_SYS_WAIT_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_dlfcn_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for dlfcn.h" >&5 +$as_echo_n "checking for dlfcn.h... " >&6; } +if test "${ac_cv_header_dlfcn_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 +$as_echo "$ac_cv_header_dlfcn_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 +$as_echo_n "checking dlfcn.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 +$as_echo_n "checking dlfcn.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for dlfcn.h" >&5 +$as_echo_n "checking for dlfcn.h... " >&6; } +if test "${ac_cv_header_dlfcn_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_dlfcn_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 +$as_echo "$ac_cv_header_dlfcn_h" >&6; } + +fi +if test "x$ac_cv_header_dlfcn_h" = x""yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_DLFCN_H 1 +_ACEOF + +fi + + + + # OS/390 lacks sys/param.h (and doesn't need it, by chance). + +for ac_header in sys/param.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + # Let the user call this, because if it triggers, they will + # need a compat/strtod.c that is correct. Users can also + # use Tcl_GetDouble(FromObj) instead. + #TEA_BUGGY_STRTOD + fi + + +#----------------------------------------------------------------------- +# __CHANGE__ +# Specify the C source files to compile in TEA_ADD_SOURCES, +# public headers that need to be installed in TEA_ADD_HEADERS, +# stub library C source files to compile in TEA_ADD_STUB_SOURCES, +# and runtime Tcl library files in TEA_ADD_TCL_SOURCES. +# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS +# and PKG_TCL_SOURCES. +#----------------------------------------------------------------------- + + + vars="tclcurl.c multi.c" + for i in $vars; do + case $i in + \$*) + # allow $-var names + PKG_SOURCES="$PKG_SOURCES $i" + PKG_OBJECTS="$PKG_OBJECTS $i" + ;; + *) + # check for existence - allows for generic/win/unix VPATH + # To add more dirs here (like 'src'), you have to update VPATH + # in Makefile.in as well + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + { { $as_echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 +$as_echo "$as_me: error: could not find source file '$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_SOURCES="$PKG_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" + fi + PKG_OBJECTS="$PKG_OBJECTS $j" + ;; + esac + done + + + +TCLCURL_SCRIPTS=tclcurl.tcl + + +#-------------------------------------------------------------------- +# Find libcurl, if it's not present, it makes no sense to compile +# this. +#-------------------------------------------------------------------- + + +# Check whether --with-curlprefix was given. +if test "${with_curlprefix+set}" = set; then + withval=$with_curlprefix; + curlprefix=$withval + curlpath=$curlprefix/bin + # Extract the first word of "curl", so it can be a program name with args. +set dummy curl; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_curl+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$curl"; then + ac_cv_prog_curl="$curl" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $curlpath +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_curl="yes" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_curl" && ac_cv_prog_curl="no" +fi +fi +curl=$ac_cv_prog_curl +if test -n "$curl"; then + { $as_echo "$as_me:$LINENO: result: $curl" >&5 +$as_echo "$curl" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$curl" = xno ; then + { { $as_echo "$as_me:$LINENO: error: can not find cURL in $curlpath" >&5 +$as_echo "$as_me: error: can not find cURL in $curlpath" >&2;} + { (exit 1); exit 1; }; } + fi + +else + + # Extract the first word of "curl-config", so it can be a program name with args. +set dummy curl-config; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_curl+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$curl"; then + ac_cv_prog_curl="$curl" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_curl="yes" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_curl" && ac_cv_prog_curl="no" +fi +fi +curl=$ac_cv_prog_curl +if test -n "$curl"; then + { $as_echo "$as_me:$LINENO: result: $curl" >&5 +$as_echo "$curl" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$curl" = xno ; then + { { $as_echo "$as_me:$LINENO: error: can not find cURL or libcurl... go to http://curl.haxx.se/ to download and then install it first" >&5 +$as_echo "$as_me: error: can not find cURL or libcurl... go to http://curl.haxx.se/ to download and then install it first" >&2;} + { (exit 1); exit 1; }; } + else + curlprefix=`curl-config --prefix` + curlpath=$curlprefix/bin + fi + +fi + + + +# Check whether --with-curlinclude was given. +if test "${with_curlinclude+set}" = set; then + withval=$with_curlinclude; + + vars="-I$withval" + for i in $vars; do + PKG_INCLUDES="$PKG_INCLUDES $i" + done + + + curlinclude=$withval + +else + + + vars="-I$curlprefix/include" + for i in $vars; do + PKG_INCLUDES="$PKG_INCLUDES $i" + done + + + curlinclude=$curlprefix/include + +fi + + +if test "${ac_cv_header_curl_curl_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for curl/curl.h" >&5 +$as_echo_n "checking for curl/curl.h... " >&6; } +if test "${ac_cv_header_curl_curl_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_curl_curl_h" >&5 +$as_echo "$ac_cv_header_curl_curl_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking curl/curl.h usability" >&5 +$as_echo_n "checking curl/curl.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking curl/curl.h presence" >&5 +$as_echo_n "checking curl/curl.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: curl/curl.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: curl/curl.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for curl/curl.h" >&5 +$as_echo_n "checking for curl/curl.h... " >&6; } +if test "${ac_cv_header_curl_curl_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_curl_curl_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_curl_curl_h" >&5 +$as_echo "$ac_cv_header_curl_curl_h" >&6; } + +fi +if test "x$ac_cv_header_curl_curl_h" = x""yes; then + headercurl=yes +else + headercurl=no +fi + + +if test "x$headercurl" = xno ; then + { $as_echo "$as_me:$LINENO: checking checking for headers at $curlinclude" >&5 +$as_echo_n "checking checking for headers at $curlinclude... " >&6; } + if test ! -r $curlinclude/curl/curl.h ; then + { { $as_echo "$as_me:$LINENO: error: cURL headers not found, you may need to install a curl-devel package" >&5 +$as_echo "$as_me: error: cURL headers not found, you may need to install a curl-devel package" >&2;} + { (exit 1); exit 1; }; } + fi + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } +fi + + +# Check whether --with-libcurl was given. +if test "${with_libcurl+set}" = set; then + withval=$with_libcurl; + + vars="-L$withval" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + +else + + + vars="-L$curlprefix/lib" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + +fi + + +{ $as_echo "$as_me:$LINENO: checking if libcurl version is recent enough" >&5 +$as_echo_n "checking if libcurl version is recent enough... " >&6; } +CURL_VERSION=`$curlpath/curl-config --checkfor 7.19.6` +if test "${CURL_VERSION}" != "" ; then + echo ${CURL_VERSION} + { { $as_echo "$as_me:$LINENO: error: libcurl version too old, please upgrade" >&5 +$as_echo "$as_me: error: libcurl version too old, please upgrade" >&2;} + { (exit 1); exit 1; }; } +fi +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + + + vars="`$curlpath/curl-config --libs`" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_sample in this case) so +# that we create the export library with the dll. +# +# Windows creates a few extra files that need to be cleaned up. +# You can add more files to clean if your extension creates any extra +# files. +# +# TEA_ADD_* any platform specific compiler/build info here. +#-------------------------------------------------------------------- + +# Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure +# and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var. +#CLEANFILES="pkgIndex.tcl" +if test "${TEA_PLATFORM}" = "windows" ; then + +cat >>confdefs.h <<\_ACEOF +#define BUILD_sample 1 +_ACEOF + + CLEANFILES="$CLEANFILES *.lib *.dll *.exp *.ilk *.pdb vc*.pch" + #TEA_ADD_SOURCES([win/winFile.c]) + #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) +else + # Ensure no empty else clauses + : + #TEA_ADD_SOURCES([unix/unixFile.c]) + #TEA_ADD_LIBS([-lsuperfly]) +fi + + +#-------------------------------------------------------------------- +# __CHANGE__ +# Choose which headers you need. Extension authors should try very +# hard to only rely on the Tcl public header files. Internal headers +# contain private data structures and are subject to change without +# notice. +# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG +#-------------------------------------------------------------------- + + + { $as_echo "$as_me:$LINENO: checking for Tcl public headers" >&5 +$as_echo_n "checking for Tcl public headers... " >&6; } + + +# Check whether --with-tclinclude was given. +if test "${with_tclinclude+set}" = set; then + withval=$with_tclinclude; with_tclinclude=${withval} +fi + + + if test "${ac_cv_c_tclh+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + # Use the value from --with-tclinclude, if it was given + + if test x"${with_tclinclude}" != x ; then + if test -f "${with_tclinclude}/tcl.h" ; then + ac_cv_c_tclh=${with_tclinclude} + else + { { $as_echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 +$as_echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} + { (exit 1); exit 1; }; } + fi + else + list="" + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers directory + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tcl is not installed, + # and in that situation, look there before installed locations. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + if test x"${TCL_INCLUDE_SPEC}" != x ; then + d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` + list="$list `ls -d ${d} 2>/dev/null`" + fi + fi + for i in $list ; do + if test -f "$i/tcl.h" ; then + ac_cv_c_tclh=$i + break + fi + done + fi + +fi + + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tclh}" = x ; then + { { $as_echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 +$as_echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} + { (exit 1); exit 1; }; } + else + { $as_echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 +$as_echo "${ac_cv_c_tclh}" >&6; } + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` + + TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + + +#TEA_PRIVATE_TCL_HEADERS + +#TEA_PUBLIC_TK_HEADERS +#TEA_PRIVATE_TK_HEADERS +#TEA_PATH_X + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +# This auto-enables if Tcl was compiled threaded. +#-------------------------------------------------------------------- + + + # Check whether --enable-threads was given. +if test "${enable_threads+set}" = set; then + enableval=$enable_threads; tcl_ok=$enableval +else + tcl_ok=yes +fi + + + if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then + TCL_THREADS=1 + + if test "${TEA_PLATFORM}" != "windows" ; then + # We are always OK on Windows, so check what this platform wants: + + # USE_THREAD_ALLOC tells us to try the special thread-based + # allocator that significantly reduces lock contention + +cat >>confdefs.h <<\_ACEOF +#define USE_THREAD_ALLOC 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + if test "`uname -s`" = "SunOS" ; then + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + fi + +cat >>confdefs.h <<\_ACEOF +#define _THREAD_SAFE 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 +$as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } +if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_mutex_init (); +int +main () +{ +return pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_pthread_pthread_mutex_init=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_pthread_pthread_mutex_init=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_pthread_pthread_mutex_init" = x""yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "no"; then + # Check a little harder for __pthread_mutex_init in the same + # library, as some systems hide it there until pthread.h is + # defined. We could alternatively do an AC_TRY_COMPILE with + # pthread.h, but that will work with libpthread really doesn't + # exist, like AIX 4.2. [Bug: 4359] + { $as_echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 +$as_echo_n "checking for __pthread_mutex_init in -lpthread... " >&6; } +if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char __pthread_mutex_init (); +int +main () +{ +return __pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_pthread___pthread_mutex_init=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_pthread___pthread_mutex_init=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_pthread___pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_pthread___pthread_mutex_init" = x""yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthread" + else + { $as_echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 +$as_echo_n "checking for pthread_mutex_init in -lpthreads... " >&6; } +if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthreads $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_mutex_init (); +int +main () +{ +return pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_pthreads_pthread_mutex_init=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_pthreads_pthread_mutex_init=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = x""yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthreads" + else + { $as_echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 +$as_echo_n "checking for pthread_mutex_init in -lc... " >&6; } +if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_mutex_init (); +int +main () +{ +return pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_c_pthread_mutex_init=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_c_pthread_mutex_init=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_c_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_c_pthread_mutex_init" = x""yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "no"; then + { $as_echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 +$as_echo_n "checking for pthread_mutex_init in -lc_r... " >&6; } +if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc_r $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_mutex_init (); +int +main () +{ +return pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_c_r_pthread_mutex_init=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_c_r_pthread_mutex_init=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_c_r_pthread_mutex_init" = x""yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -pthread" + else + TCL_THREADS=0 + { $as_echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 +$as_echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;} + fi + fi + fi + fi + fi + else + TCL_THREADS=0 + fi + # Do checking message here to not mess up interleaved configure output + { $as_echo "$as_me:$LINENO: checking for building with threads" >&5 +$as_echo_n "checking for building with threads... " >&6; } + if test "${TCL_THREADS}" = 1; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_THREADS 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: yes (default)" >&5 +$as_echo "yes (default)" >&6; } + else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + fi + # TCL_THREADS sanity checking. See if our request for building with + # threads is the same as the way Tcl was built. If not, warn the user. + case ${TCL_DEFS} in + *THREADS=1*) + if test "${TCL_THREADS}" = "0"; then + { $as_echo "$as_me:$LINENO: WARNING: + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads." >&5 +$as_echo "$as_me: WARNING: + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads." >&2;} + fi + ;; + *) + if test "${TCL_THREADS}" = "1"; then + { $as_echo "$as_me:$LINENO: WARNING: + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core." >&5 +$as_echo "$as_me: WARNING: + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core." >&2;} + fi + ;; + esac + + + +#-------------------------------------------------------------------- +# The statement below defines a collection of symbols related to +# building as a shared library instead of a static library. +#-------------------------------------------------------------------- + + + { $as_echo "$as_me:$LINENO: checking how to build libraries" >&5 +$as_echo_n "checking how to build libraries... " >&6; } + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then + enableval=$enable_shared; tcl_ok=$enableval +else + tcl_ok=yes +fi + + + if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" ; then + { $as_echo "$as_me:$LINENO: result: shared" >&5 +$as_echo "shared" >&6; } + SHARED_BUILD=1 + else + { $as_echo "$as_me:$LINENO: result: static" >&5 +$as_echo "static" >&6; } + SHARED_BUILD=0 + +cat >>confdefs.h <<\_ACEOF +#define STATIC_BUILD 1 +_ACEOF + + fi + + + +#-------------------------------------------------------------------- +# This macro figures out what flags to use with the compiler/linker +# when building shared/static debug/optimized objects. This information +# can be taken from the tclConfig.sh file, but this figures it all out. +#-------------------------------------------------------------------- + + + + + # Step 0.a: Enable 64 bit support? + + { $as_echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 +$as_echo_n "checking if 64bit support is requested... " >&6; } + # Check whether --enable-64bit was given. +if test "${enable_64bit+set}" = set; then + enableval=$enable_64bit; do64bit=$enableval +else + do64bit=no +fi + + { $as_echo "$as_me:$LINENO: result: $do64bit" >&5 +$as_echo "$do64bit" >&6; } + + # Step 0.b: Enable Solaris 64 bit VIS support? + + { $as_echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 +$as_echo_n "checking if 64bit Sparc VIS support is requested... " >&6; } + # Check whether --enable-64bit-vis was given. +if test "${enable_64bit_vis+set}" = set; then + enableval=$enable_64bit_vis; do64bitVIS=$enableval +else + do64bitVIS=no +fi + + { $as_echo "$as_me:$LINENO: result: $do64bitVIS" >&5 +$as_echo "$do64bitVIS" >&6; } + # Force 64bit on with VIS + if test "$do64bitVIS" = "yes"; then + do64bit=yes +fi + + + # Step 0.c: Check if visibility support is available. Do this here so + # that platform specific alternatives can be used below if this fails. + + { $as_echo "$as_me:$LINENO: checking if compiler supports visibility \"hidden\"" >&5 +$as_echo_n "checking if compiler supports visibility \"hidden\"... " >&6; } +if test "${tcl_cv_cc_visibility_hidden+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + extern __attribute__((__visibility__("hidden"))) void f(void); + void f(void) {} +int +main () +{ +f(); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_cc_visibility_hidden=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_cc_visibility_hidden=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_visibility_hidden" >&5 +$as_echo "$tcl_cv_cc_visibility_hidden" >&6; } + if test $tcl_cv_cc_visibility_hidden = yes; then + + +cat >>confdefs.h <<\_ACEOF +#define MODULE_SCOPE extern __attribute__((__visibility__("hidden"))) +_ACEOF + + +fi + + + # Step 0.d: Disable -rpath support? + + { $as_echo "$as_me:$LINENO: checking if rpath support is requested" >&5 +$as_echo_n "checking if rpath support is requested... " >&6; } + # Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then + enableval=$enable_rpath; doRpath=$enableval +else + doRpath=yes +fi + + { $as_echo "$as_me:$LINENO: result: $doRpath" >&5 +$as_echo "$doRpath" >&6; } + + # TEA specific: Cross-compiling options for Windows/CE builds? + + if test "${TEA_PLATFORM}" = windows; then + + { $as_echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 +$as_echo_n "checking if Windows/CE build is requested... " >&6; } + # Check whether --enable-wince was given. +if test "${enable_wince+set}" = set; then + enableval=$enable_wince; doWince=$enableval +else + doWince=no +fi + + { $as_echo "$as_me:$LINENO: result: $doWince" >&5 +$as_echo "$doWince" >&6; } + +fi + + + # Step 1: set the variable "system" to hold the name and version number + # for the system. + + + { $as_echo "$as_me:$LINENO: checking system version" >&5 +$as_echo_n "checking system version... " >&6; } +if test "${tcl_cv_sys_version+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + # TEA specific: + if test "${TEA_PLATFORM}" = "windows" ; then + tcl_cv_sys_version=windows + elif test -f /usr/lib/NextStep/software_version; then + tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` + else + tcl_cv_sys_version=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + { $as_echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 +$as_echo "$as_me: WARNING: can't find uname command" >&2;} + tcl_cv_sys_version=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid` + fi + if test "`uname -s`" = "AIX" ; then + tcl_cv_sys_version=AIX-`uname -v`.`uname -r` + fi + fi + fi + +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 +$as_echo "$tcl_cv_sys_version" >&6; } + system=$tcl_cv_sys_version + + + # Step 2: check for existence of -ldl library. This is needed because + # Linux can use either -ldl or -ldld for dynamic loading. + + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dl_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then + have_dl=yes +else + have_dl=no +fi + + + # Require ranlib early so we can override it in special cases below. + + + + # Step 3: set configuration options based on system name and version. + # This is similar to Tcl's unix/tcl.m4 except that we've added a + # "windows" case. + + do64bit_ok=no + LDFLAGS_ORIG="$LDFLAGS" + # When ld needs options to work in 64-bit mode, put them in + # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] + # is disabled by the user. [Bug 1016796] + LDFLAGS_ARCH="" + TCL_EXPORT_FILE_SUFFIX="" + UNSHARED_LIB_SUFFIX="" + # TEA specific: use PACKAGE_VERSION instead of VERSION + TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' + ECHO_VERSION='`echo ${PACKAGE_VERSION}`' + TCL_LIB_VERSIONS_OK=ok + CFLAGS_DEBUG=-g + CFLAGS_OPTIMIZE=-O + if test "$GCC" = yes; then + + # TEA specific: + CFLAGS_OPTIMIZE=-O2 + CFLAGS_WARNING="-Wall" + +else + CFLAGS_WARNING="" +fi + + TCL_NEEDS_EXP_FILE=0 + TCL_BUILD_EXP_FILE="" + TCL_EXP_FILE="" + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="ar" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + STLIB_LD='${AR} cr' + LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" + if test "x$SHLIB_VERSION" = x; then + SHLIB_VERSION="1.0" +fi + + case $system in + # TEA specific: + windows) + # This is a 2-stage check to make sure we have the 64-bit SDK + # We have to know where the SDK is installed. + # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs + # MACHINE is IX86 for LINK, but this is used by the manifest, + # which requires x86|amd64|ia64. + MACHINE="X86" + if test "$do64bit" != "no" ; then + if test "x${MSSDK}x" = "xx" ; then + MSSDK="C:/Progra~1/Microsoft Platform SDK" + fi + MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` + PATH64="" + case "$do64bit" in + amd64|x64|yes) + MACHINE="AMD64" ; # default to AMD64 64-bit build + PATH64="${MSSDK}/Bin/Win64/x86/AMD64" + ;; + ia64) + MACHINE="IA64" + PATH64="${MSSDK}/Bin/Win64" + ;; + esac + if test ! -d "${PATH64}" ; then + { $as_echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 +$as_echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 +$as_echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} + do64bit="no" + else + { $as_echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 +$as_echo " Using 64-bit $MACHINE mode" >&6; } + do64bit_ok="yes" + fi + fi + + if test "$doWince" != "no" ; then + if test "$do64bit" != "no" ; then + { { $as_echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 +$as_echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} + { (exit 1); exit 1; }; } + fi + if test "$GCC" = "yes" ; then + { { $as_echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 +$as_echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} + { (exit 1); exit 1; }; } + fi + + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-celib + + if test x"${no_celib}" = x ; then + # we reset no_celib in case something fails here + no_celib=true + +# Check whether --with-celib was given. +if test "${with_celib+set}" = set; then + withval=$with_celib; with_celibconfig=${withval} +fi + + { $as_echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 +$as_echo_n "checking for Windows/CE celib directory... " >&6; } + if test "${ac_cv_c_celibconfig+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + # First check to see if --with-celibconfig was specified. + if test x"${with_celibconfig}" != x ; then + if test -d "${with_celibconfig}/inc" ; then + ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` + else + { { $as_echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 +$as_echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + # then check for a celib library + if test x"${ac_cv_c_celibconfig}" = x ; then + for i in \ + ../celib-palm-3.0 \ + ../celib \ + ../../celib-palm-3.0 \ + ../../celib \ + `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ + ${srcdir}/../celib-palm-3.0 \ + ${srcdir}/../celib \ + `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ + ; do + if test -d "$i/inc" ; then + ac_cv_c_celibconfig=`(cd $i; pwd)` + break + fi + done + fi + +fi + + if test x"${ac_cv_c_celibconfig}" = x ; then + { { $as_echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 +$as_echo "$as_me: error: Cannot find celib support library directory" >&2;} + { (exit 1); exit 1; }; } + else + no_celib= + CELIB_DIR=${ac_cv_c_celibconfig} + CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` + { $as_echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 +$as_echo "found $CELIB_DIR" >&6; } + fi + fi + + # Set defaults for common evc4/PPC2003 setup + # Currently Tcl requires 300+, possibly 420+ for sockets + CEVERSION=420; # could be 211 300 301 400 420 ... + TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... + ARCH=ARM; # could be ARM MIPS X86EM ... + PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" + if test "$doWince" != "yes"; then + # If !yes then the user specified something + # Reset ARCH to allow user to skip specifying it + ARCH= + eval `echo $doWince | awk -F, '{ \ + if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ + if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ + if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ + if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ + if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ + }'` + if test "x${ARCH}" = "x" ; then + ARCH=$TARGETCPU; + fi + fi + OSVERSION=WCE$CEVERSION; + if test "x${WCEROOT}" = "x" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" + if test ! -d "${WCEROOT}" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded Tools" + fi + fi + if test "x${SDKROOT}" = "x" ; then + SDKROOT="C:/Program Files/Windows CE Tools" + if test ! -d "${SDKROOT}" ; then + SDKROOT="C:/Windows CE Tools" + fi + fi + WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` + SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` + if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ + -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then + { { $as_echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 +$as_echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} + { (exit 1); exit 1; }; } + doWince="no" + else + # We could PATH_NOSPACE these, but that's not important, + # as long as we quote them when used. + CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" + if test -d "${CEINCLUDE}/${TARGETCPU}" ; then + CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" + fi + CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" + fi + fi + + if test "$GCC" != "yes" ; then + if test "${SHARED_BUILD}" = "0" ; then + runtime=-MT + else + runtime=-MD + fi + + if test "$do64bit" != "no" ; then + # All this magic is necessary for the Win64 SDK RC1 - hobbs + CC="\"${PATH64}/cl.exe\"" + CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" + RC="\"${MSSDK}/bin/rc.exe\"" + lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + LINKBIN="\"${PATH64}/link.exe\"" + CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + # Avoid 'unresolved external symbol __security_cookie' + # errors, c.f. http://support.microsoft.com/?id=894573 + + vars="bufferoverflowU.lib" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + elif test "$doWince" != "no" ; then + CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" + if test "${TARGETCPU}" = "X86"; then + CC="\"${CEBINROOT}/cl.exe\"" + else + CC="\"${CEBINROOT}/cl${ARCH}.exe\"" + fi + CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" + RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" + arch=`echo ${ARCH} | awk '{print tolower($0)}'` + defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" + if test "${SHARED_BUILD}" = "1" ; then + # Static CE builds require static celib as well + defs="${defs} _DLL" + fi + for i in $defs ; do + +cat >>confdefs.h <<_ACEOF +#define $i 1 +_ACEOF + + done + +cat >>confdefs.h <<_ACEOF +#define _WIN32_WCE $CEVERSION +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define UNDER_CE $CEVERSION +_ACEOF + + CFLAGS_DEBUG="-nologo -Zi -Od" + CFLAGS_OPTIMIZE="-nologo -Ox" + lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` + lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" + LINKBIN="\"${CEBINROOT}/link.exe\"" + + else + RC="rc" + lflags="-nologo" + LINKBIN="link" + CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + fi + fi + + if test "$GCC" = "yes"; then + # mingw gcc mode + RC="windres" + CFLAGS_DEBUG="-g" + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + SHLIB_LD="$CC -shared" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" + LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" + else + SHLIB_LD="${LINKBIN} -dll ${lflags}" + # link -lib only works when -lib is the first arg + STLIB_LD="${LINKBIN} -lib ${lflags}" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' + PATHTYPE=-w + # For information on what debugtype is most useful, see: + # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp + # and also + # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx + # This essentially turns it all on. + LDFLAGS_DEBUG="-debug -debugtype:cv" + LDFLAGS_OPTIMIZE="-release" + if test "$doWince" != "no" ; then + LDFLAGS_CONSOLE="-link ${lflags}" + LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} + else + LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" + LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" + fi + fi + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dll" + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' + + TCL_LIB_VERSIONS_OK=nodots + # Bogus to avoid getting this turned off + DL_OBJS="tclLoadNone.obj" + ;; + AIX-*) + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then + + # AIX requires the _r compiler when gcc isn't being used + case "${CC}" in + *_r|*_r\ *) + # ok ... + ;; + *) + # Make sure only first arg gets _r + CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'` + ;; + esac + { $as_echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 +$as_echo "Using $CC for compiling with threads" >&6; } + +fi + + LIBS="$LIBS -lc" + SHLIB_CFLAGS="" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + DL_OBJS="tclLoadDl.o" + LD_LIBRARY_PATH_VAR="LIBPATH" + + # Check to enable 64-bit flags for compiler/linker on AIX 4+ + if test "$do64bit" = yes -a "`uname -v`" -gt 3; then + + if test "$GCC" = yes; then + + { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + +else + + do64bit_ok=yes + CFLAGS="$CFLAGS -q64" + LDFLAGS_ARCH="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + +fi + + +fi + + + if test "`uname -m`" = ia64; then + + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = yes; then + + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + +else + + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + +fi + + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + +else + + if test "$GCC" = yes; then + SHLIB_LD='${CC} -shared' +else + + SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + +fi + + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + # TEA specific: use PACKAGE_VERSION instead of VERSION + TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' + +fi + + + # AIX v<=4.1 has some different flags than 4.2+ + if test "$system" = "AIX-4.1" -o "`uname -v`" -lt 4; then + + case " $LIBOBJS " in + *" tclLoadAix.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" + ;; +esac + + DL_LIBS="-lld" + +fi + + + # On AIX <=v4 systems, libbsd.a has to be linked in to support + # non-blocking file IO. This library has to be linked in after + # the MATH_LIBS or it breaks the pow() function. The way to + # insure proper sequencing, is to add it to the tail of MATH_LIBS. + # This library also supplies gettimeofday. + # + # AIX does not have a timezone field in struct tm. When the AIX + # bsd library is used, the timezone global and the gettimeofday + # methods are to be avoided for timezone deduction instead, we + # deduce the timezone by comparing the localtime result on a + # known GMT value. + + { $as_echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 +$as_echo_n "checking for gettimeofday in -lbsd... " >&6; } +if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gettimeofday (); +int +main () +{ +return gettimeofday (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_bsd_gettimeofday=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_bsd_gettimeofday=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 +$as_echo "$ac_cv_lib_bsd_gettimeofday" >&6; } +if test "x$ac_cv_lib_bsd_gettimeofday" = x""yes; then + libbsd=yes +else + libbsd=no +fi + + if test $libbsd = yes; then + + MATH_LIBS="$MATH_LIBS -lbsd" + +cat >>confdefs.h <<\_ACEOF +#define USE_DELTA_FOR_TZ 1 +_ACEOF + + +fi + + ;; + BeOS*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD='${CC} -nostart' + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + + #----------------------------------------------------------- + # Check for inet_ntoa in -lbind, for BeOS (which also needs + # -lsocket, even if the network functions are in -lnet which + # is always linked to, for compatibility. + #----------------------------------------------------------- + { $as_echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 +$as_echo_n "checking for inet_ntoa in -lbind... " >&6; } +if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbind $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char inet_ntoa (); +int +main () +{ +return inet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_bind_inet_ntoa=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_bind_inet_ntoa=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 +$as_echo "$ac_cv_lib_bind_inet_ntoa" >&6; } +if test "x$ac_cv_lib_bind_inet_ntoa" = x""yes; then + LIBS="$LIBS -lbind -lsocket" +fi + + ;; + BSD/OS-2.1*|BSD/OS-3*) + SHLIB_CFLAGS="" + SHLIB_LD="shlicc -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + BSD/OS-4.*) + SHLIB_CFLAGS="-export-dynamic -fPIC" + SHLIB_LD='${CC} -shared' + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + dgux*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + HP-UX-*.11.*) + # Use updated header definitions where possible + +cat >>confdefs.h <<\_ACEOF +#define _XOPEN_SOURCE_EXTENDED 1 +_ACEOF + + # TEA specific: Needed by Tcl, but not most extensions + #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) + #LIBS="$LIBS -lxnet" # Use the XOPEN network library + + if test "`uname -m`" = ia64; then + + SHLIB_SUFFIX=".so" + # Use newer C++ library for C++ extensions + #if test "$GCC" != "yes" ; then + # CPPFLAGS="-AA" + #fi + +else + + SHLIB_SUFFIX=".sl" + +fi + + { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dld_shl_load=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_shl_load=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = yes; then + + SHLIB_LD_LIBS='${LIBS}' + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + +fi + + if test "$GCC" = yes; then + + SHLIB_LD='${CC} -shared' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + +else + + CFLAGS="$CFLAGS -z" + # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc + #CFLAGS="$CFLAGS +DAportable" + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + +fi + + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes"; then + + if test "$GCC" = yes; then + + case `${CC} -dumpmachine` in + hppa64*) + # 64-bit gcc in use. Fix flags for GNU ld. + do64bit_ok=yes + SHLIB_LD='${CC} -shared' + SHLIB_LD_LIBS='${LIBS}' + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' +fi + + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ;; + *) + { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + ;; + esac + +else + + do64bit_ok=yes + CFLAGS="$CFLAGS +DD64" + LDFLAGS_ARCH="+DD64" + +fi + + +fi + ;; + HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) + SHLIB_SUFFIX=".sl" + { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dld_shl_load=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_shl_load=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = yes; then + + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS="" + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + +fi + ;; + IRIX-5.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' +fi + + ;; + IRIX-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' +fi + + if test "$GCC" = yes; then + + CFLAGS="$CFLAGS -mabi=n32" + LDFLAGS="$LDFLAGS -mabi=n32" + +else + + case $system in + IRIX-6.3) + # Use to build 6.2 compatible binaries on 6.3. + CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" + ;; + *) + CFLAGS="$CFLAGS -n32" + ;; + esac + LDFLAGS="$LDFLAGS -n32" + +fi + + ;; + IRIX64-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' +fi + + + # Check to enable 64-bit flags for compiler/linker + + if test "$do64bit" = yes; then + + if test "$GCC" = yes; then + + { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} + +else + + do64bit_ok=yes + SHLIB_LD="ld -64 -shared -rdata_shared" + CFLAGS="$CFLAGS -64" + LDFLAGS_ARCH="-64" + +fi + + +fi + + ;; + Linux*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + # TEA specific: + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings + # when you inline the string and math operations. Turn this off to + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS + SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' +fi + + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "`uname -m`" = "alpha"; then + CFLAGS="$CFLAGS -mieee" +fi + + if test $do64bit = yes; then + + { $as_echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 +$as_echo_n "checking if compiler accepts -m64 flag... " >&6; } +if test "${tcl_cv_cc_m64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -m64" + 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 conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_cc_m64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_cc_m64=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 +$as_echo "$tcl_cv_cc_m64" >&6; } + if test $tcl_cv_cc_m64 = yes; then + + CFLAGS="$CFLAGS -m64" + do64bit_ok=yes + +fi + + +fi + + + # The combo of gcc + glibc has a bug related to inlining of + # functions like strtod(). The -fno-builtin flag should address + # this problem but it does not work. The -fno-inline flag is kind + # of overkill but it works. Disable inlining only when one of the + # files in compat/*.c is being linked in. + + if test x"${USE_COMPAT}" != x; then + CFLAGS="$CFLAGS -fno-inline" +fi + + + ;; + GNU*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + SHLIB_LD='${CC} -shared' + DL_OBJS="" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + if test "`uname -m`" = "alpha"; then + CFLAGS="$CFLAGS -mieee" +fi + + ;; + Lynx*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + CFLAGS_OPTIMIZE=-02 + SHLIB_LD='${CC} -shared' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-mshared -ldl" + LD_FLAGS="-Wl,--export-dynamic" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' +fi + + ;; + MP-RAS-02*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + MP-RAS-*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,-Bexport" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + NetBSD-1.*|FreeBSD-[1-2].*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' +fi + + { $as_echo "$as_me:$LINENO: checking for ELF" >&5 +$as_echo_n "checking for ELF... " >&6; } +if test "${tcl_cv_ld_elf+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef __ELF__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + tcl_cv_ld_elf=yes +else + tcl_cv_ld_elf=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 +$as_echo "$tcl_cv_ld_elf" >&6; } + if test $tcl_cv_ld_elf = yes; then + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + +else + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' + +fi + + + # Ancient FreeBSD doesn't handle version numbers with dots. + + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + OpenBSD-*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' +fi + + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' + { $as_echo "$as_me:$LINENO: checking for ELF" >&5 +$as_echo_n "checking for ELF... " >&6; } +if test "${tcl_cv_ld_elf+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef __ELF__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + tcl_cv_ld_elf=yes +else + tcl_cv_ld_elf=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 +$as_echo "$tcl_cv_ld_elf" >&6; } + if test $tcl_cv_ld_elf = yes; then + + LDFLAGS=-Wl,-export-dynamic + +else + LDFLAGS="" +fi + + + # OpenBSD doesn't do version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + NetBSD-*|FreeBSD-*) + # FreeBSD 3.* and greater have ELF. + # NetBSD 2.* has ELF and can use 'cc -shared' to build shared libs + SHLIB_CFLAGS="-fPIC" + SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS -export-dynamic" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' +fi + + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "${TCL_THREADS}" = "1"; then + + # The -pthread needs to go in the CFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + +fi + + case $system in + FreeBSD-3.*) + # FreeBSD-3 doesn't handle version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + TCL_LIB_VERSIONS_OK=nodots + ;; + esac + ;; + Darwin-*) + CFLAGS_OPTIMIZE="-Os" + SHLIB_CFLAGS="-fno-common" + # To avoid discrepancies between what headers configure sees during + # preprocessing tests and compiling tests, move any -isysroot and + # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: + CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" + CFLAGS="`echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" + if test $do64bit = yes; then + + case `arch` in + ppc) + { $as_echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 +$as_echo_n "checking if compiler accepts -arch ppc64 flag... " >&6; } +if test "${tcl_cv_cc_arch_ppc64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + 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 conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_cc_arch_ppc64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_cc_arch_ppc64=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 +$as_echo "$tcl_cv_cc_arch_ppc64" >&6; } + if test $tcl_cv_cc_arch_ppc64 = yes; then + + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + do64bit_ok=yes + +fi +;; + i386) + { $as_echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 +$as_echo_n "checking if compiler accepts -arch x86_64 flag... " >&6; } +if test "${tcl_cv_cc_arch_x86_64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch x86_64" + 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 conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_cc_arch_x86_64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_cc_arch_x86_64=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 +$as_echo "$tcl_cv_cc_arch_x86_64" >&6; } + if test $tcl_cv_cc_arch_x86_64 = yes; then + + CFLAGS="$CFLAGS -arch x86_64" + do64bit_ok=yes + +fi +;; + *) + { $as_echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 +$as_echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; + esac + +else + + # Check for combined 32-bit and 64-bit fat build + if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \ + && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then + + fat_32_64=yes +fi + + +fi + + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS + SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' + { $as_echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 +$as_echo_n "checking if ld accepts -single_module flag... " >&6; } +if test "${tcl_cv_ld_single_module+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_ld_single_module=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_ld_single_module=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 +$as_echo "$tcl_cv_ld_single_module" >&6; } + if test $tcl_cv_ld_single_module = yes; then + + SHLIB_LD="${SHLIB_LD} -Wl,-single_module" + +fi + + # TEA specific: link shlib with current and compatiblity version flags + vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([0-9]\{1,5\}\)\(\(\.[0-9]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d` + SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dylib" + DL_OBJS="tclLoadDyld.o" + DL_LIBS="" + # Don't use -prebind when building for Mac OS X 10.4 or later only: + if test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ + "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then + + LDFLAGS="$LDFLAGS -prebind" +fi + + LDFLAGS="$LDFLAGS -headerpad_max_install_names" + { $as_echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 +$as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; } +if test "${tcl_cv_ld_search_paths_first+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_ld_search_paths_first=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_ld_search_paths_first=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 +$as_echo "$tcl_cv_ld_search_paths_first" >&6; } + if test $tcl_cv_ld_search_paths_first = yes; then + + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + +fi + + if test "$tcl_cv_cc_visibility_hidden" != yes; then + + +cat >>confdefs.h <<\_ACEOF +#define MODULE_SCOPE __private_extern__ +_ACEOF + + +fi + + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" + # TEA specific: for combined 32 & 64 bit fat builds of Tk + # extensions, verify that 64-bit build is possible. + if test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"; then + + if test "${TEA_WINDOWINGSYSTEM}" = x11; then + + { $as_echo "$as_me:$LINENO: checking for 64-bit X11" >&5 +$as_echo_n "checking for 64-bit X11... " >&6; } +if test "${tcl_cv_lib_x11_64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' + done + CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" + LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +XrmInitialize(); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_lib_x11_64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_lib_x11_64=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="$hold_'$v'"' + done +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_lib_x11_64" >&5 +$as_echo "$tcl_cv_lib_x11_64" >&6; } + +fi + + if test "${TEA_WINDOWINGSYSTEM}" = aqua; then + + { $as_echo "$as_me:$LINENO: checking for 64-bit Tk" >&5 +$as_echo_n "checking for 64-bit Tk... " >&6; } +if test "${tcl_cv_lib_tk_64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' + done + CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}" + LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +Tk_InitStubs(NULL, "", 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_lib_tk_64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_lib_tk_64=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="$hold_'$v'"' + done +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_lib_tk_64" >&5 +$as_echo "$tcl_cv_lib_tk_64" >&6; } + +fi + + # remove 64-bit arch flags from CFLAGS et al. if configuration + # does not support 64-bit. + if test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no; then + + { $as_echo "$as_me:$LINENO: Removing 64-bit architectures from compiler & linker flags" >&5 +$as_echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;} + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' + done +fi + + +fi + + ;; + NEXTSTEP-*) + SHLIB_CFLAGS="" + SHLIB_LD='${CC} -nostdlib -r' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadNext.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OS/390-*) + CFLAGS_OPTIMIZE="" # Optimizer is buggy + +cat >>confdefs.h <<\_ACEOF +#define _OE_SOCKETS 1 +_ACEOF + + ;; + OSF1-1.0|OSF1-1.1|OSF1-1.2) + # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 + SHLIB_CFLAGS="" + # Hack: make package name same as library name + SHLIB_LD='ld -R -export :' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadOSF.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-1.*) + # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 + SHLIB_CFLAGS="-fPIC" + if test "$SHARED_BUILD" = 1; then + SHLIB_LD="ld -shared" +else + + SHLIB_LD="ld -non_shared" + +fi + + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-V*) + # Digital OSF/1 + SHLIB_CFLAGS="" + if test "$SHARED_BUILD" = 1; then + + SHLIB_LD='ld -shared -expect_unresolved "*"' + +else + + SHLIB_LD='ld -non_shared -expect_unresolved "*"' + +fi + + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + if test $doRpath = yes; then + + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' +fi + + if test "$GCC" = yes; then + CFLAGS="$CFLAGS -mieee" +else + + CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" +fi + + # see pthread_intro(3) for pthread support on osf1, k.furukawa + if test "${TCL_THREADS}" = 1; then + + CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" + CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" + LIBS=`echo $LIBS | sed s/-lpthreads//` + if test "$GCC" = yes; then + + LIBS="$LIBS -lpthread -lmach -lexc" + +else + + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + +fi + + +fi + + ;; + QNX-6*) + # QNX RTP + # This may work for all QNX, but it was only reported for v6. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + # dlopen is in -lc on QNX + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SCO_SV-3.2*) + # Note, dlopen is available only on SCO 3.2.5 and greater. However, + # this test works, since "uname -s" was non-standard in 3.2.4 and + # below. + if test "$GCC" = yes; then + + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" + +else + + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" + +fi + + SHLIB_LD="ld -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SINIX*5.4*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SunOS-4*) + SHLIB_CFLAGS="-PIC" + SHLIB_LD="ld" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + + # SunOS can't handle version numbers with dots in them in library + # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it + # requires an extra version number at the end of .so file names. + # So, the library has to have a name like libtcl75.so.1.0 + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + SunOS-5.[0-6]) + # Careful to not let 5.10+ fall into this case + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + + SHLIB_CFLAGS="-KPIC" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = yes; then + + SHLIB_LD='${CC} -shared' + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + +else + + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + +fi + + ;; + SunOS-5*) + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + + SHLIB_CFLAGS="-KPIC" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = yes; then + + arch=`isainfo` + if test "$arch" = "sparcv9 sparc"; then + + if test "$GCC" = yes; then + + if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then + + { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} + +else + + do64bit_ok=yes + CFLAGS="$CFLAGS -m64 -mcpu=v9" + LDFLAGS="$LDFLAGS -m64 -mcpu=v9" + SHLIB_CFLAGS="-fPIC" + +fi + + +else + + do64bit_ok=yes + if test "$do64bitVIS" = yes; then + + CFLAGS="$CFLAGS -xarch=v9a" + LDFLAGS_ARCH="-xarch=v9a" + +else + + CFLAGS="$CFLAGS -xarch=v9" + LDFLAGS_ARCH="-xarch=v9" + +fi + + # Solaris 64 uses this as well + #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" + +fi + + +else + if test "$arch" = "amd64 i386"; then + + if test "$GCC" = yes; then + + case $system in + SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) + do64bit_ok=yes + CFLAGS="$CFLAGS -m64" + LDFLAGS="$LDFLAGS -m64";; + *) + { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; + esac + +else + + do64bit_ok=yes + case $system in + SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) + CFLAGS="$CFLAGS -m64" + LDFLAGS="$LDFLAGS -m64";; + *) + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64";; + esac + +fi + + +else + { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} +fi + +fi + + +fi + + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = yes; then + + SHLIB_LD='${CC} -shared' + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "$do64bit_ok" = yes; then + + if test "$arch" = "sparcv9 sparc"; then + + # We need to specify -static-libgcc or we need to + # add the path to the sparv9 libgcc. + # JH: static-libgcc is necessary for core Tcl, but may + # not be necessary for extensions. + SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" + # for finding sparcv9 libgcc, get the regular libgcc + # path, remove so name and append 'sparcv9' + #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." + #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + +else + if test "$arch" = "amd64 i386"; then + + # JH: static-libgcc is necessary for core Tcl, but may + # not be necessary for extensions. + SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" + +fi + +fi + + +fi + + +else + + case $system in + SunOS-5.[1-9][0-9]*) + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS + SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';; + *) + SHLIB_LD='/usr/ccs/bin/ld -G -z text';; + esac + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + +fi + + ;; + UNIX_SV* | UnixWare-5*) + SHLIB_CFLAGS="-KPIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers + # that don't grok the -Bexport option. Test that it does. + { $as_echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 +$as_echo_n "checking for ld accepts -Bexport flag... " >&6; } +if test "${tcl_cv_ld_Bexport+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-Bexport" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + tcl_cv_ld_Bexport=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_ld_Bexport=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 +$as_echo "$tcl_cv_ld_Bexport" >&6; } + if test $tcl_cv_ld_Bexport = yes; then + + LDFLAGS="$LDFLAGS -Wl,-Bexport" + +fi + + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + esac + + if test "$do64bit" = yes -a "$do64bit_ok" = no; then + + { $as_echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 +$as_echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} + +fi + + + + + # Step 4: disable dynamic loading if requested via a command-line switch. + + # Check whether --enable-load was given. +if test "${enable_load+set}" = set; then + enableval=$enable_load; tcl_ok=$enableval +else + tcl_ok=yes +fi + + if test "$tcl_ok" = no; then + DL_OBJS="" +fi + + + if test "x$DL_OBJS" != x; then + BUILD_DLTEST="\$(DLTEST_TARGETS)" +else + + { $as_echo "$as_me:$LINENO: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5 +$as_echo "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;} + SHLIB_CFLAGS="" + SHLIB_LD="" + SHLIB_SUFFIX="" + DL_OBJS="tclLoadNone.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS_ORIG" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + BUILD_DLTEST="" + +fi + + LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" + + # If we're running gcc, then change the C flags for compiling shared + # libraries to the right flags for gcc, instead of those for the + # standard manufacturer compiler. + + if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes; then + + case $system in + AIX-*) ;; + BSD/OS*) ;; + IRIX*) ;; + NetBSD-*|FreeBSD-*) ;; + Darwin-*) ;; + SCO_SV-3.2*) ;; + windows) ;; + *) SHLIB_CFLAGS="-fPIC" ;; + esac +fi + + + if test "$SHARED_LIB_SUFFIX" = ""; then + + # TEA specific: use PACKAGE_VERSION instead of VERSION + SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' +fi + + if test "$UNSHARED_LIB_SUFFIX" = ""; then + + # TEA specific: use PACKAGE_VERSION instead of VERSION + UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' +fi + + + + + + + + + + + + + + + + + # These must be called after we do the basic CFLAGS checks and + # verify any possible 64-bit or similar switches are necessary + + { $as_echo "$as_me:$LINENO: checking for required early compiler flags" >&5 +$as_echo_n "checking for required early compiler flags... " >&6; } + tcl_flags="" + + if test "${tcl_cv_flag__isoc99_source+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *)strtoll; char *q = (char *)strtoull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_flag__isoc99_source=no +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _ISOC99_SOURCE 1 +#include +int +main () +{ +char *p = (char *)strtoll; char *q = (char *)strtoull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_flag__isoc99_source=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_flag__isoc99_source=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _ISOC99_SOURCE 1 +_ACEOF + + tcl_flags="$tcl_flags _ISOC99_SOURCE" + fi + + + if test "${tcl_cv_flag__largefile64_source+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +struct stat64 buf; int i = stat64("/", &buf); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_flag__largefile64_source=no +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE64_SOURCE 1 +#include +int +main () +{ +struct stat64 buf; int i = stat64("/", &buf); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_flag__largefile64_source=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_flag__largefile64_source=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _LARGEFILE64_SOURCE 1 +_ACEOF + + tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" + fi + + + if test "${tcl_cv_flag__largefile_source64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *)open64; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_flag__largefile_source64=no +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE64 1 +#include +int +main () +{ +char *p = (char *)open64; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_flag__largefile_source64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_flag__largefile_source64=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _LARGEFILE_SOURCE64 1 +_ACEOF + + tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" + fi + + if test "x${tcl_flags}" = "x" ; then + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } + else + { $as_echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 +$as_echo "${tcl_flags}" >&6; } + fi + + + { $as_echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 +$as_echo_n "checking for 64-bit integer type... " >&6; } + if test "${tcl_cv_type_64bit+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +__int64 value = (__int64) 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_type_64bit=__int64 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_type_64bit="long long" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +switch (0) { + case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; + } + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_type_64bit=${tcl_type_64bit} +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "${tcl_cv_type_64bit}" = none ; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_WIDE_INT_IS_LONG 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: using long" >&5 +$as_echo "using long" >&6; } + elif test "${tcl_cv_type_64bit}" = "__int64" \ + -a "${TEA_PLATFORM}" = "windows" ; then + # TEA specific: We actually want to use the default tcl.h checks in + # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* + { $as_echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 +$as_echo "using Tcl header defaults" >&6; } + else + +cat >>confdefs.h <<_ACEOF +#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} +_ACEOF + + { $as_echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 +$as_echo "${tcl_cv_type_64bit}" >&6; } + + # Now check for auxiliary declarations + { $as_echo "$as_me:$LINENO: checking for struct dirent64" >&5 +$as_echo_n "checking for struct dirent64... " >&6; } +if test "${tcl_cv_struct_dirent64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +struct dirent64 p; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_struct_dirent64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_struct_dirent64=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 +$as_echo "$tcl_cv_struct_dirent64" >&6; } + if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_DIRENT64 1 +_ACEOF + + fi + + { $as_echo "$as_me:$LINENO: checking for struct stat64" >&5 +$as_echo_n "checking for struct stat64... " >&6; } +if test "${tcl_cv_struct_stat64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +struct stat64 p; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_struct_stat64=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_struct_stat64=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 +$as_echo "$tcl_cv_struct_stat64" >&6; } + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_STAT64 1 +_ACEOF + + fi + + + +for ac_func in open64 lseek64 +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + { $as_echo "$as_me:$LINENO: checking for off64_t" >&5 +$as_echo_n "checking for off64_t... " >&6; } + if test "${tcl_cv_type_off64_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +off64_t offset; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + tcl_cv_type_off64_t=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + tcl_cv_type_off64_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_type_off64_t}" = "xyes" && \ + test "x${ac_cv_func_lseek64}" = "xyes" && \ + test "x${ac_cv_func_open64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_TYPE_OFF64_T 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + fi + fi + + + +#-------------------------------------------------------------------- +# Set the default compiler switches based on the --enable-symbols option. +#-------------------------------------------------------------------- + + + + { $as_echo "$as_me:$LINENO: checking for build with symbols" >&5 +$as_echo_n "checking for build with symbols... " >&6; } + # Check whether --enable-symbols was given. +if test "${enable_symbols+set}" = set; then + enableval=$enable_symbols; tcl_ok=$enableval +else + tcl_ok=no +fi + + DBGX="" + if test "$tcl_ok" = "no"; then + CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" + LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + else + CFLAGS_DEFAULT="${CFLAGS_DEBUG}" + LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" + if test "$tcl_ok" = "yes"; then + { $as_echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 +$as_echo "yes (standard debugging)" >&6; } + fi + fi + # TEA specific: + if test "${TEA_PLATFORM}" != "windows" ; then + LDFLAGS_DEFAULT="${LDFLAGS}" + fi + + + + + if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_MEM_DEBUG 1 +_ACEOF + + fi + + if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then + if test "$tcl_ok" = "all"; then + { $as_echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 +$as_echo "enabled symbols mem debugging" >&6; } + else + { $as_echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 +$as_echo "enabled $tcl_ok debugging" >&6; } + fi + fi + + +#-------------------------------------------------------------------- +# Everyone should be linking against the Tcl stub library. If you +# can't for some reason, remove this definition. If you aren't using +# stubs, you also need to modify the SHLIB_LD_LIBS setting below to +# link against the non-stubbed Tcl library. Add Tk too if necessary. +#-------------------------------------------------------------------- + + +cat >>confdefs.h <<\_ACEOF +#define USE_TCL_STUBS 1 +_ACEOF + +#AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) + +#-------------------------------------------------------------------- +# This macro generates a line to use when building a library. It +# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, +# and TEA_LOAD_TCLCONFIG macros above. +#-------------------------------------------------------------------- + + + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then + MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" + MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" + else + MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" + MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" + fi + + if test "${SHARED_BUILD}" = "1" ; then + MAKE_LIB="${MAKE_SHARED_LIB} " + else + MAKE_LIB="${MAKE_STATIC_LIB} " + fi + + #-------------------------------------------------------------------- + # Shared libraries and static libraries have different names. + # Use the double eval to make sure any variables in the suffix is + # substituted. (@@@ Might not be necessary anymore) + #-------------------------------------------------------------------- + + if test "${TEA_PLATFORM}" = "windows" ; then + if test "${SHARED_BUILD}" = "1" ; then + # We force the unresolved linking of symbols that are really in + # the private libraries of Tcl and Tk. + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" + fi + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + else + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + if test "$GCC" = "yes"; then + PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} + fi + # These aren't needed on Windows (either MSVC or gcc) + RANLIB=: + RANLIB_STUB=: + else + RANLIB_STUB="${RANLIB}" + if test "${SHARED_BUILD}" = "1" ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" + fi + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + fi + + # These are escaped so that only CFLAGS is picked up at configure time. + # The other values will be substituted at make time. + CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" + if test "${SHARED_BUILD}" = "1" ; then + CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" + fi + + + + + + + + +#-------------------------------------------------------------------- +# Determine the name of the tclsh and/or wish executables in the +# Tcl and Tk build directories or the location they were installed +# into. These paths are used to support running test cases only, +# the Makefile should not be making use of these paths to generate +# a pkgIndex.tcl file or anything else at extension build time. +#-------------------------------------------------------------------- + + + { $as_echo "$as_me:$LINENO: checking for tclsh" >&5 +$as_echo_n "checking for tclsh... " >&6; } + if test -f "${TCL_BIN_DIR}/Makefile" ; then + # tclConfig.sh is in Tcl build directory + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="${TCL_BIN_DIR}/tclsh" + fi + else + # tclConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" + fi + list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${TCLSH_PROG}" ; then + REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" + fi + { $as_echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 +$as_echo "${TCLSH_PROG}" >&6; } + + +#TEA_PROG_WISH + +#-------------------------------------------------------------------- +# Finally, substitute all of the various values into the Makefile. +# You may alternatively have a special pkgIndex.tcl.in or other files +# which require substituting th AC variables in. Include these here. +#-------------------------------------------------------------------- + +ac_config_files="$ac_config_files Makefile pkgIndex.tcl" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by TclCurl $as_me 7.19.6, which was +generated by GNU Autoconf 2.63. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="`echo $ac_config_files`" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTION]... [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet, --silent + 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 + +Configuration files: +$config_files + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_version="\\ +TclCurl config.status 7.19.6 +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { $as_echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "pkgIndex.tcl") CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;; + + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_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 +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + $as_echo "$as_me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=' ' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_ACEOF + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + ;; + + + + esac + +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + +# 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 +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/configure.in b/configure.in new file mode 100755 index 0000000..6a974ae --- /dev/null +++ b/configure.in @@ -0,0 +1,248 @@ +#!/bin/bash -norc +dnl This file is an input file used by the GNU "autoconf" program to +dnl generate the file "configure", which is run during Tcl installation +dnl to configure the system for the local environment. +# +# RCS: @(#) $Id: configure.in,v 1.48 2008/11/05 00:13:00 hobbs Exp $ + +#----------------------------------------------------------------------- +# Sample configure.in for Tcl Extensions. The only places you should +# need to modify this file are marked by the string __CHANGE__ +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- +# __CHANGE__ +# Set your package name and version numbers here. +# +# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION +# set as provided. These will also be added as -D defs in your Makefile +# so you can encode the package version directly into the source files. +#----------------------------------------------------------------------- + +AC_INIT([TclCurl], [7.19.6]) + +#-------------------------------------------------------------------- +# Call TEA_INIT as the first TEA_ macro to set up initial vars. +# This will define a ${TEA_PLATFORM} variable == "unix" or "windows" +# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. +#-------------------------------------------------------------------- + +TEA_INIT([3.7]) + +AC_CONFIG_AUX_DIR(tclconfig) + +#-------------------------------------------------------------------- +# Load the tclConfig.sh file +#-------------------------------------------------------------------- + +TEA_PATH_TCLCONFIG +TEA_LOAD_TCLCONFIG + +#-------------------------------------------------------------------- +# Load the tkConfig.sh file if necessary (Tk extension) +#-------------------------------------------------------------------- + +#TEA_PATH_TKCONFIG +#TEA_LOAD_TKCONFIG + +#----------------------------------------------------------------------- +# Handle the --prefix=... option by defaulting to what Tcl gave. +# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. +#----------------------------------------------------------------------- + +TEA_PREFIX + +#----------------------------------------------------------------------- +# Standard compiler checks. +# This sets up CC by using the CC env var, or looks for gcc otherwise. +# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create +# the basic setup necessary to compile executables. +#----------------------------------------------------------------------- + +TEA_SETUP_COMPILER + +#----------------------------------------------------------------------- +# __CHANGE__ +# Specify the C source files to compile in TEA_ADD_SOURCES, +# public headers that need to be installed in TEA_ADD_HEADERS, +# stub library C source files to compile in TEA_ADD_STUB_SOURCES, +# and runtime Tcl library files in TEA_ADD_TCL_SOURCES. +# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS +# and PKG_TCL_SOURCES. +#----------------------------------------------------------------------- + +TEA_ADD_SOURCES([tclcurl.c multi.c]) +TCLCURL_SCRIPTS=tclcurl.tcl +AC_SUBST(TCLCURL_SCRIPTS) + +#-------------------------------------------------------------------- +# Find libcurl, if it's not present, it makes no sense to compile +# this. +#-------------------------------------------------------------------- + +AC_ARG_WITH(curlprefix, + [ --with-curlprefix base directory for the cURL install '/usr', '/usr/local',...], + [ + curlprefix=$withval + curlpath=$curlprefix/bin + AC_CHECK_PROG(curl,curl,yes,no,$curlpath) + if test "x$curl" = xno ; then + AC_MSG_ERROR([can not find cURL in $curlpath]) + fi + ],[ + AC_CHECK_PROG(curl,curl-config,yes,no) + if test "x$curl" = xno ; then + AC_MSG_ERROR([can not find cURL or libcurl... go to http://curl.haxx.se/ to download and then install it first]) + else + curlprefix=`curl-config --prefix` + curlpath=$curlprefix/bin + fi +]) + +AC_ARG_WITH(curlinclude, + [ --with-curlinclude directory containing the public libcurl header files],[ + TEA_ADD_INCLUDES([-I$withval]) + curlinclude=$withval + ], + [ + TEA_ADD_INCLUDES([-I$curlprefix/include]) + curlinclude=$curlprefix/include + ]) + +AC_CHECK_HEADER(curl/curl.h,headercurl=yes, headercurl=no) +if test "x$headercurl" = xno ; then + AC_MSG_CHECKING([checking for headers at $curlinclude]) + if test [ ! -r $curlinclude/curl/curl.h ] ; then + AC_MSG_ERROR([cURL headers not found, you may need to install a curl-devel package]) + fi + AC_MSG_RESULT([found]) +fi + +AC_ARG_WITH(libcurl, + [ --with-libcurl directory containing libcurl],[ + TEA_ADD_LIBS([-L$withval]) + ], + [ + TEA_ADD_LIBS([-L$curlprefix/lib]) + ]) + +AC_MSG_CHECKING([if libcurl version is recent enough]) +CURL_VERSION=`$curlpath/curl-config --checkfor 7.19.6` +if test "${CURL_VERSION}" != "" ; then + echo ${CURL_VERSION} + AC_MSG_ERROR([libcurl version too old, please upgrade]) +fi +AC_MSG_RESULT(yes) + +TEA_ADD_LIBS([`$curlpath/curl-config --libs`]) + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_sample in this case) so +# that we create the export library with the dll. +# +# Windows creates a few extra files that need to be cleaned up. +# You can add more files to clean if your extension creates any extra +# files. +# +# TEA_ADD_* any platform specific compiler/build info here. +#-------------------------------------------------------------------- + +# Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure +# and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var. +#CLEANFILES="pkgIndex.tcl" +if test "${TEA_PLATFORM}" = "windows" ; then + AC_DEFINE(BUILD_sample, 1, [Build windows export dll]) + CLEANFILES="$CLEANFILES *.lib *.dll *.exp *.ilk *.pdb vc*.pch" + #TEA_ADD_SOURCES([win/winFile.c]) + #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) +else + # Ensure no empty else clauses + : + #TEA_ADD_SOURCES([unix/unixFile.c]) + #TEA_ADD_LIBS([-lsuperfly]) +fi +AC_SUBST(CLEANFILES) + +#-------------------------------------------------------------------- +# __CHANGE__ +# Choose which headers you need. Extension authors should try very +# hard to only rely on the Tcl public header files. Internal headers +# contain private data structures and are subject to change without +# notice. +# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG +#-------------------------------------------------------------------- + +TEA_PUBLIC_TCL_HEADERS +#TEA_PRIVATE_TCL_HEADERS + +#TEA_PUBLIC_TK_HEADERS +#TEA_PRIVATE_TK_HEADERS +#TEA_PATH_X + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +# This auto-enables if Tcl was compiled threaded. +#-------------------------------------------------------------------- + +TEA_ENABLE_THREADS + +#-------------------------------------------------------------------- +# The statement below defines a collection of symbols related to +# building as a shared library instead of a static library. +#-------------------------------------------------------------------- + +TEA_ENABLE_SHARED + +#-------------------------------------------------------------------- +# This macro figures out what flags to use with the compiler/linker +# when building shared/static debug/optimized objects. This information +# can be taken from the tclConfig.sh file, but this figures it all out. +#-------------------------------------------------------------------- + +TEA_CONFIG_CFLAGS + +#-------------------------------------------------------------------- +# Set the default compiler switches based on the --enable-symbols option. +#-------------------------------------------------------------------- + +TEA_ENABLE_SYMBOLS + +#-------------------------------------------------------------------- +# Everyone should be linking against the Tcl stub library. If you +# can't for some reason, remove this definition. If you aren't using +# stubs, you also need to modify the SHLIB_LD_LIBS setting below to +# link against the non-stubbed Tcl library. Add Tk too if necessary. +#-------------------------------------------------------------------- + +AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) +#AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) + +#-------------------------------------------------------------------- +# This macro generates a line to use when building a library. It +# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, +# and TEA_LOAD_TCLCONFIG macros above. +#-------------------------------------------------------------------- + +TEA_MAKE_LIB + +#-------------------------------------------------------------------- +# Determine the name of the tclsh and/or wish executables in the +# Tcl and Tk build directories or the location they were installed +# into. These paths are used to support running test cases only, +# the Makefile should not be making use of these paths to generate +# a pkgIndex.tcl file or anything else at extension build time. +#-------------------------------------------------------------------- + +TEA_PROG_TCLSH +#TEA_PROG_WISH + +#-------------------------------------------------------------------- +# Finally, substitute all of the various values into the Makefile. +# You may alternatively have a special pkgIndex.tcl.in or other files +# which require substituting th AC variables in. Include these here. +#-------------------------------------------------------------------- + +AC_OUTPUT([Makefile pkgIndex.tcl]) diff --git a/doc/OpenSSL-LICENSE.txt b/doc/OpenSSL-LICENSE.txt new file mode 100755 index 0000000..3fd259a --- /dev/null +++ b/doc/OpenSSL-LICENSE.txt @@ -0,0 +1,127 @@ + + LICENSE ISSUES + ============== + + The OpenSSL toolkit stays under a dual license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. Actually both licenses are BSD-style + Open Source licenses. In case of any license issues related to OpenSSL + please contact openssl-core@openssl.org. + + OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + diff --git a/doc/SinComprimir/tclcurl.n b/doc/SinComprimir/tclcurl.n new file mode 100644 index 0000000..cb51d82 --- /dev/null +++ b/doc/SinComprimir/tclcurl.n @@ -0,0 +1,2078 @@ +.\" You can view this file with: +.\" nroff -man [file] +.\" Adapted from libcurl docs by fandom@telefonica.net +.TH TclCurl n "8 September 2008" "TclCurl 7.19.0 "TclCurl Easy Interface" +.SH NAME +TclCurl: - get a URL with FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE or LDAP syntax. +.SH SYNOPSIS +.BI "curl::init" +.sp +.IB curlHandle " configure " "?options?" +.sp +.IB curlHandle " perform" +.sp +.IB curlHandle " getinfo " curlinfo_option +.sp +.IB curlhandle " cleanup" +.sp +.IB curlhandle " reset" +.sp +.IB curlHandle " duhandle" +.sp +.IB curlHandle " pause" +.sp +.IB curlHandle " resume" +.sp +.BI curl::transfer " ?options?" +.sp +.BI curl::version +.sp +.BI "curl::escape " url +.sp +.BI "curl::unescape " url +.sp +.BI "curl::curlConfig " option +.sp +.BI "curl::versioninfo " option +.sp +.BI "curl::easystrerror " errorCode + +.SH DESCRIPTION +The TclCurl extension gives Tcl programmers access to the libcurl +library written by \fBDaniel Stenberg\fP, with it you can download urls, +upload them and many other neat tricks, for more information check +.I http://curl.haxx.se +.SH curl::init +This procedure must be the first one to call, it returns a +.I curlHandle +that you need to use to invoke TclCurl procedures. The init calls intializes +curl and this call MUST have a corresponding call to +.I cleanup +when the operation is completed. +You should perform all your sequential file transfers using the same +curlHandle. This enables TclCurl to use persistant connections when +possible. +.sp +.B RETURN VALUE +.sp +.I curlHandle +to use. +.SH curlHandle configure ?options? +.sp +.B configure +is called to set the options for the transfer. Most operations in TclCurl +have default actions, and by using the appropriate options you can +make them behave differently (as documented). All options are set with +the \fIoption\fP followed by a parameter. +.sp +.B Notes: +the options set with this procedure are valid for the +forthcoming data transfers that are performed when you invoke +.I perform +.sp +The options are not reset between transfers (except where noted), so if +you want subsequent transfers with different options, you must change them +between the transfers. You can optionally reset all options back to the internal +default with \fBcurlHandle reset\fP. +.sp +.I "curlHandle" +is the return code from the +.I "curl::init" +call. +.sp + +.B OPTIONS +.sp +.SH Behaviour options + +.TP +.B -verbose +Set the parameter to 1 to get the library to display a lot of verbose +information about its operations. Very useful for libcurl and/or protocol +debugging and understanding. + +You hardly ever want this set in production use, you will almost always want +this when you debug/report problems. Another neat option for debugging is +.B -debugproc + +.TP +.B -header +A 1 tells the extension to include the headers in the body output. This is +only relevant for protocols that actually have headers preceding the data (like HTTP). + +.TP +.B -noprogress +A 1 tells the extension to turn on the built-in progress meter. +Nowadays it is turn off by default. + +.TP +.B -nosignal +A 1 tells TclCurl not use any functions that install signal +handlers or any functions that cause signals to be sent to the process. This +option is mainly here to allow multi-threaded unix applications to still +set/use all timeout options etc, without risking getting signals. + + +.SH Callback options + +.TP +.B -writeproc +Use it to set a Tcl procedure that will be invoked by TclCurl as soon as +there is received data that needs to be saved. The procedure will receive +a single parameter with the data to be saved. + +NOTE: you will be passed as much data as possible in all invokes, but you +cannot possibly make any assumptions. It may be nothing if the file is +empty or it may be thousands of bytes. + +.TP +.B -file +File in which the transfered data will be saved. + +.TP +.B -readproc +Sets a Tcl procedure to be called by TclCurl as soon as it needs to read +data in order to send it to the peer. The procedure has to take one +parameter, which will contain the maximun numbers of bytes to read. It +should return the actual number of bytes read, or '0' if you want to +stop the transfer. + +.TP +.B -infile +File from which the data will be transfered. + +.TP +.B -progressproc +Name of the Tcl procedure that will invoked by TclCurl with a frequent +interval during operation (roughly once per second), no matter if data +is being transfered or not. Unknown/unused +argument values passed to the callback will be set to zero (like if you +only download data, the upload size will remain 0), the prototype of the +procedure must be: +.sp +.B proc ProgressCallback {dltotal dlnow ultotal ulnow} +.sp +In order to this option to work you have to set the \fBnoprogress\fP +option to '0'. Setting this option to the empty string will restore the +original progress function. + +If you transfer data with the multi interface, this procedure will not be +called during periods of idleness unless you call the appropriate procedure +that performs transfers. + +You can pause and resume a transfer from within this procedure using the +\fBpause\fP and \fBresume\fP commands. + +.TP +.B -writeheader +Pass a the file name to be used to write the header part of the received data to. +The headers are guaranteed to be written one-by-one to this file and +only complete lines are written. Parsing headers should be easy enough using +this. + +.TP +.B -debugproc +Name of the procedure that will receive the debug data produced by the +.B -verbose +option, it should match the following prototype: +.sp +.B debugProc {infoType data} +.sp +where \fBinfoType\fP specifies what kind of information it is (0 text, +1 incoming header, 2 outgoing header, 3 incoming data, 4 outgoing data, +5 incoming SSL data, 6 outgoing SSL data). + +.SH Error Options + +.TP +.B -errorbuffer +Pass a variable name where TclCurl may store human readable error +messages in. This may be more helpful than just the return code from the +command. + +.TP +.B -stderr +Pass a file name as parameter. This is the stream to use internally instead +of stderr when reporting errors. +.TP +.B -failonerror +A 1 parameter tells the extension to fail silently if the HTTP code +returned is equal or larger than 400. The default action would be to return +the page normally, ignoring that code. + +This method is not fail-safe and there are occasions where non-successful response +codes will slip through, especially when authentication is involved +(response codes 401 and 407). + +You might get some amounts of headers transferred before this situation is detected, +like for when a "100-continue" is received as a response to a POST/PUT and a 401 +or 407 is received immediately afterwards. + +.SH Network options + +.TP +.B -url +The actual URL to deal with. + +If the given URL lacks the protocol part ("http://" or "ftp://" etc), it will +attempt to guess which protocol to use based on the given host name. If the +given protocol of the set URL is not supported, TclCurl will return the +\fBunsupported protocol\fP error when you call \fBperform\fP. Use +\fBcurl::versioninfo\fP for detailed info on which protocols that are supported. + +\fBNOTE\fP: this the one option required to be set +before +.B perform +is called. + +.TP +.B -proxy +If you need to use a http proxy to access the outside world, set the +proxy string with this option. To specify port number in this string, +append :[port] to the end of the host name. The proxy string may be +prefixed with [protocol]:// since any such prefix will be ignored. + +When you tell the extension to use a HTTP proxy, TclCurl will +transparently convert operations to HTTP even if you specify a FTP +URL etc. This may have an impact on what other features of the library +you can use, such as +.B quote +and similar FTP specifics that will not work unless you tunnel through +the HTTP proxy. Such tunneling is activated with +.B proxytunnel + +TclCurl respects the environment variables http_proxy, ftp_proxy, +all_proxy etc, if any of those are set. The use of this option does +however override any possibly set environment variables. + +Setting the proxy string to "" (an empty string) will explicitly disable +the use of a proxy, even if there is an environment variable set for it. + +The proxy host string can be specified the exact same way as the proxy +environment variables, include protocol prefix (http://) and embedded +user + password. + +.TP +.B -proxyport +Use this option to set the proxy port to use unless it is specified in +the proxy string by \fB-proxy\fP. + +.TP +.B -proxytype +Pass the type of the proxy. Available options are 'http', 'socks4', 'socks4a' +and 'socks5', with the HTTP one being default. + +.TP +.B -httpproxytunnel +Set the parameter to 1 to get the extension to tunnel all non-HTTP +operations through the given HTTP proxy. Do note that there is a big +difference between using a proxy and tunneling through it. If you don't know what +this means, you probably don't want this tunnel option. + +.TP +.B -interface +Pass the interface name to use as outgoing +network interface. The name can be an interface name, an IP address or a host +name. + +.TP +.B -localport +This sets the local port number of the socket used for connection. This can +be used in combination with \fB-interface\fP and you are recommended to use +\fBlocalportrange\fP as well when this is set. Note the only valid port numbers +are 1 - 65535. + +.TP +.B -localportrange +This is the number of attempts TclCurl should do to find a working local port +number. It starts with the given \fB-localport\fP and adds +one to the number for each retry. Setting this value to 1 or below will make +TclCurl do only one try for exact port number. Note that port numbers by nature +are a scarce resource that will be busy at times so setting this value to something +too low might cause unnecessary connection setup failures. + +.TP +.B -dnscachetimeout +Pass the timeout in seconds. Name resolves will be kept in memory for this number +of seconds. Set to '0' to completely disable caching, or '-1' to make the +cached entries remain forever. By default, TclCurl caches this info for 60 seconds. + +.TP +.B -dnsuseglobalcache +If the value passed is 1, it tells TclCurl to use a global DNS cache that +will survive between curl handles creations and deletions. This is not thread-safe +as it uses a global varible. + +\fBWARNING:\fP this option is considered obsolete. Stop using it. Switch over +to using the share interface instead! See \fItclcurl_share\fP. + +.TP +.B -buffersize +Pass your prefered size for the receive buffer in TclCurl. The main point of this +would be that the write callback gets called more often and with smaller chunks. +This is just treated as a request, not an order. You cannot be guaranteed to +actually get the given size. + +.TP +.B -port + +Pass the number specifying what remote port to connect to, instead of the one specified +in the URL or the default port for the used protocol. + +.TP +.B -tcpnodelay + +Pass a number to specify whether the TCP_NODELAY option should be set or cleared (1 = set, 0 = clear). +The option is cleared by default. This will have no effect after the connection has been established. + +Setting this option will disable TCP's Nagle algorithm. The purpose of this algorithm is to try to +minimize the number of small packets on the network (where "small packets" means TCP segments less +than the Maximum Segment Size (MSS) for the network). + +Maximizing the amount of data sent per TCP segment is good because it amortizes the overhead of the +send. However, in some cases (most notably telnet or rlogin) small segments may need to be sent without +delay. This is less efficient than sending larger amounts of data at a time, and can contribute to +congestion on the network if overdone. + +.TP +.B -addressscope +Pass a number specifying the scope_id value to use when connecting to IPv6 link-local or site-local +addresses. + +.SH Names and Passwords options + +.TP +.B -netrc +A 1 parameter tells the extension to scan your +.B ~/.netrc +file to find user name and password for the remote site you are about to +access. Do note that TclCurl does not verify that the file has the correct +properties set (as the standard unix ftp client does), and that only machine +name, user name and password is taken into account (init macros and similar +things are not supported). + +You can set it to the following values: +.RS +.TP 5 +.B optional +The use of your ~/.netrc file is optional, and information in the URL is to +be preferred. The file will be scanned with the host and user name (to find +the password only) or with the host only, to find the first user name and +password after that machine, which ever information is not specified in +the URL. + +Undefined values of the option will have this effect. +.TP +.B ignored +The extension will ignore the file and use only the information in the URL. +This is the default. +.TP +.B required +This value tells the library that use of the file is required, to ignore +the information in the URL, and to search the file with the host only. +.RE + +.TP +.B -netrcfile +Pass a string containing the full path name to the file you want to use as .netrc +file. For the option to work, you have to set the \fBnetrc\fP option to +\fBrequired\fP. If this option is omitted, and \fBnetrc\fP is set, TclCurl +will attempt to find the a .netrc file in the current user's home directory. + +.TP +.B -userpwd +Pass a string as parameter, which should be [username]:[password] to use for +the connection. Use \fBhttpauth\fP to decide authentication method. + +When using NTLM, you can set domain by prepending it to the user name and +separating the domain and name with a forward (/) or backward slash (\\). Like +this: "domain/user:password" or "domain\\user:password". Some HTTP servers (on +Windows) support this style even for Basic authentication. + +When using HTTP and \fB-followlocation\fP, TclCurl might perform several +requests to possibly different hosts. TclCurl will only send this user and +password information to hosts using the initial host name (unless +\fB-unrestrictedauth\fP is set), so if TclCurl follows locations to other +hosts it will not send the user and password to those. This is enforced to +prevent accidental information leakage. + +.TP +.B -proxyuserpwd +Pass a string as parameter, which should be [username]:[password] to use for +the connection to the HTTP proxy. + +.TP +.B -httpauth +Set to the authentication method you want, the available ones are: +.RS +.TP 5 +.B basic +HTTP Basic authentication. This is the default choice, and the only +method that is in widespread use and supported virtually everywhere. +It sends the user name and password over the network in plain text, +easily captured by others. + +.TP +.B digest +HTTP Digest authentication. Digest authentication is a more secure +way to do authentication over public networks than the regular +old-fashioned Basic method. + +.TP +.B gssnegotiate +HTTP GSS-Negotiate authentication. The GSS-Negotiate method, also known as +plain "Negotiate",was designed by Microsoft and is used in their web +applications. It is primarily meant as a support for Kerberos5 authentication +but may be also used along with another authentication methods. + +.TP +.B ntlm +HTTP NTLM authentication. A proprietary protocol invented and used by Microsoft. +It uses a challenge-response and hash concept similar to Digest, to prevent the +password from being eavesdropped. + +.TP +.B any +TclCurl will automatically select the one it finds most secure. + +.TP +.B anysafe +It may use anything but basic, TclCurl will automaticly select the +one it finds most secure. +.RE + +.TP +.B -proxyauth +Use it to tell TclCurl which authentication method(s) you want it to use for +your proxy authentication. Note that for some methods, this will induce an +extra network round-trip. Set the actual name and password with the +\fBproxyuserpwd\fP option. + +The methods are those listed above for the \fBhttpauth\fP option. As of this +writing, only Basic and NTLM work. + +.SH HTTP options + +.TP +.B -autoreferer +Pass an 1 parameter to enable this. When enabled, TclCurl will +automatically set the Referer: field in requests where it follows a Location: +redirect. + +.TP +.B -encoding +Sets the contents of the Accept-Encoding: header sent in an HTTP +request, and enables decoding of a response when a Content-Encoding: +header is received. Three encodings are supported: \fIidentity\fP, +which does nothing, \fIdeflate\fP which requests the server to +compress its response using the zlib algorithm, and \fIgzip\fP which +requests the gzip algorithm. Use \fIall\fP to send an +Accept-Encoding: header containing all supported encodings. + +This is a request, not an order; the server may or may not do it. This +option must be set or else any unsolicited +encoding done by the server is ignored. See the special file +lib/README.encoding in libcurl docs for details. + +.TP +.B -followlocation +An 1 tells the library to follow any +.B Location: header +that the server sends as part of a HTTP header. + +\fBNOTE\fP: this means that the extension will re-send the same +request on the new location and follow new \fBLocation: headers\fP +all the way until no more such headers are returned. +\fB-maxredirs\fP can be used to limit the number of redirects +TclCurl will follow. + +.TP +.B -unrestrictedauth +An 1 parameter tells the extension it can continue +to send authentication (user+password) when following +locations, even when hostname changed. Note that this +is meaningful only when setting \fB-followlocation\fP. + +.TP +.B -maxredirs +Sets the redirection limit. If that many redirections have been followed, +the next redirect will cause an error. This option only makes sense if the +\fB-followlocation\fP option is used at the same time. Setting the limit +to 0 will make libcurl refuse any redirect. Set it to -1 for an infinite +number of redirects (which is the default) + +.TP +.B -post301 +An 1 tells TclCurl to respect RFC 2616/10.3.2 and not +convert POST requests into GET requests when following a 301 redirection. The +non-RFC behaviour is ubiquitous in web browsers, so the conversion is done +by default to maintain consistency. However, a server may require +a POST to remain a POST after such a redirection. This option is meaningful +only when setting \fB-followlocation\fP. + +.TP +.B -put +An 1 parameter tells the extension to use HTTP PUT a file. The file to put +must be set with \fB-infile\fP and \fB-infilesize\fP. + +This option is deprecated starting with version 0.12.1, you should use \fB-upload\fP. + +.TP +.B -post +An 1 parameter tells the library to do a regular HTTP post. This is a +normal application/x-www-form-urlencoded kind, which is the most commonly used +one by HTML forms. See the \fB-postfields\fP option for how to specify the +data to post and \fB-postfieldsize\fP about how to set the data size. + +Use the \fB-postfields\fP option to specify what data to post and \fB-postfieldsize\fP +to set the data size. Optionally, you can provide data to POST using the \fB-readproc\fP +options. + +You can override the default POST Content-Type: header by setting your own with +\fB-httpheader\fP. + +Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. +You can disable this header with \fB-httpheader\fP as usual. + +If you use POST to a HTTP 1.1 server, you can send data without knowing the +size before starting the POST if you use chunked encoding. You enable this +by adding a header like "Transfer-Encoding: chunked" with \fB-httpheader\fP. +With HTTP 1.0 or without chunked transfer, you must specify the size in the +request. + +When setting \fBpost\fP to an 1 value, it will automatically set +\fBnobody\fP to 0. + +NOTE: if you have issued a POST request and want to make a HEAD or GET instead, you must +explicitly pick the new request type using \fB-nobody\fP or \fB-httpget\fP or similar. + +.TP +.B -postfields +Pass a string as parameter, which should be the full data to post in a HTTP +POST operation. You must make sure that the data is formatted the way you +want the server to receive it. TclCurl will not convert or encode it for you. +Most web servers will assume this data to be url-encoded. + +This is a normal application/x-www-form-urlencoded kind, +which is the most commonly used one by HTML forms. + +If you want to do a zero-byte POST, you need to set +\fB-postfieldsize\fP explicitly to zero, as simply setting +\fB-postfields\fP to NULL or "" just effectively disables the sending +of the specified string. TclCurl will instead assume that the POST +data will be send using the read callback! + +Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. +You can disable this header with \fB-httpheader\fP as usual. + +\fBNote\fP: to make multipart/formdata posts (aka rfc1867-posts), check out +\fB-httppost\fP option. + +.TP +.B -postfieldsize +If you want to post data to the server without letting TclCurl do a strlen() +to measure the data size, this option must be used. Also, when this option is +used, you can post fully binary data which otherwise is likely to fail. If +this size is set to zero, the library will use strlen() to get the data +size. + +.TP +.B -httppost +Tells TclCurl you want a multipart/formdata HTTP POST to be made and you +instruct what data to pass on to the server through a +.B Tcl list. + +\fBThis is the only case where the data is reset after a transfer.\fP + +First, there are some basics you need to understand about multipart/formdata +posts. Each part consists of at least a \fBNAME\fP and a \fBCONTENTS\fP part. If the part +is made for file upload, there are also a stored \fBCONTENT-TYPE\fP and a +\fBFILENAME\fP. Below, we'll discuss on what options you use to set these +properties in the parts you want to add to your post. + +The list must contain a \fB'name'\fP tag with the name of the section followed +by a string with the name, there are three tags to indicate the value of +the section: \fB'value'\fP followed by a string with the data to post, \fB'file'\fP +followed by the name of the file to post and \fB'contenttype'\fP with the +type of the data (text/plain, image/jpg, ...), you can also indicate a \fIfalse\fP +file name with \fB'filename'\fP, this is useful in case the server checks if the given +file name is valid, for example, by testing if it starts with 'c:\\' as any real file +name does or if you want to include the full path of the file to post. You can also post +the content of a variable as if it were a file with the options \fB'bufferName'\fP and +\fB'buffer'\fP or use \fB'filecontent'\fP followed by a file name to read that file and +use the contents as data. + +Should you need to specify extra headers for the form POST section, use +\fB'contentheader\fP' followed by a list with the headers to post. + +Please see 'httpPost.tcl' and 'httpBufferPost.tcl' for examples. + +If TclCurl can't set the data to post an error will be returned: +.RS +.TP 5 +.B 1 +If the memory allocation fails. +.TP +.B 2 +If one option is given twice for one form. +.TP +.B 3 +If an empty string was given. +.TP +.B 4 +If an unknown option was used. +.TP +.B 5 +If the some form info is not complete (or error) +.TP +.B 6 +If an illegal option is used in an array. +.TP +.B 7 +TclCurl has no http support. +.RE + +.TP +.B -referer +Pass a string as parameter. It will be used to set the +.B referer +header in the http request sent to the remote server. This can be used to +fool servers or scripts. You can also set any custom header with +.B -httpheader. + +.TP +.B -useragent +Pass a string as parameter. It will be used to set the +.B user-agent: +header in the http request sent to the remote server. This can be used to fool +servers or scripts. You can also set any custom header with +.B -httpheader. + +.TP +.B -httpheader +Pass a +.B list +with the HTTP headers to pass to the server in your request. +If you add a header that is otherwise generated +and used by TclCurl internally, your added one will be used instead. If you +add a header with no contents as in 'Accept:', the internally used header will +just get disabled. Thus, using this option you can add new headers, replace +and remove internal headers. + +The headers included in the linked list must not be CRLF-terminated, because +TclCurl adds CRLF after each header item. Failure to comply with this will +result in strange bugs because the server will most likely ignore part of the +headers you specified. + +The first line in a request (containing the method, usually a GET or POST) is +not a header and cannot be replaced using this option. Only the lines +following the request-line are headers. Adding this method line in this list +of headers will only cause your request to send an invalid header. + +\fBNOTE\fP:The most commonly replaced headers have "shortcuts" in the options: +.B cookie, useragent, +and +.B referer. + +.TP +.B -http200aliases +Pass a list of aliases to be treated as valid HTTP 200 responses. Some servers +respond with a custom header response line. For example, IceCast servers respond +with "ICY 200 OK". By including this string in your list of aliases, the +response will be treated as a valid HTTP header line such as "HTTP/1.0 200 OK". + +\fBNOTE\fP:The alias itself is not parsed for any version strings. Before version +7.16.3, TclCurl used the value set by option \fBhttpversion\fP, but starting with +7.16.3 the protocol is assumed to match HTTP 1.0 when an alias matched. + +.TP +.B -cookie +Pass a string as parameter. It will be used to +set a cookie in the http request. The format of the string should be +'[NAME]=[CONTENTS];'. Where NAME is the cookie name and CONTENTS is +what the cookie should contain. + +If you need to set mulitple cookies, you need to set them all using +a single option and thus you need to concatenate them all in one single string. +Set multiple cookies in one string like this: "name1=content1; name2=content2;" +etc. + +Note that this option sets the cookie header explictly in the outgoing request(s). +If multiple requests are done due to authentication, followed redirections or similar, +they will all get this cookie passed on. + +Using this option multiple times will only make the latest string override +the previous ones. + +.TP +.B -cookiefile +Pass a string as parameter. It should contain the name of your file holding +cookie data. The cookie data may be in netscape cookie data format or just +regular HTTP-style headers dumped to a file. + +Given an empty or non-existing file, this option will enable cookies for this +curl handle, making it understand and parse received cookies and then use +matching cookies in future requests. + +If you use this option multiple times, you add more files to read. + +.TP +.B -cookiejar +Pass a file name in which TclCurl will dump all internally known cookies +when +.B curlHandle cleanup +is called. If no cookies are known, no file will be created. +Specify "-" to have the cookies written to stdout. + +Using this option also enables cookies for this session, so if you, for +example, follow a location it will make matching cookies get sent accordingly. + +TclCurl will not and cannot report an error for this. Using '\fBverbose\fP' +will get a warning to display, but that is the only visible feedback you get +about this possibly lethal situation. + +.TP +.B -cookiesession +Pass an 1 to mark this as a new cookie "session". It will +force TclCurl to ignore all cookies it is about to load that are "session +cookies" from the previous session. By default, TclCurl always stores and +loads all cookies, independent of whether they are session cookies are not. +Session cookies are cookies without expiry date and they are meant to be +alive and existing for this "session" only. + +.TP +.B -cookielist +Pass a string with a cookie. The cookie can be either in Netscape / Mozilla +format or just regular HTTP-style header (Set-Cookie: ...) format. If the +cookie engine was not enabled it will be enabled. Passing a +magic string "ALL" will erase all known cookies while "FLUSH" will write +all cookies known by TclCurl to the file specified by \fB-cookiejar\fP. + +.TP +.B -httpget +If set to 1 forces the HTTP request to get back to GET, usable if +POST, PUT or a custom request have been used previously with the +same handle. + +When setting \fBhttpget\fP to 1, \fBnobody\fP will automatically be set to 0. + +.TP +.B -httpversion +Set to one of the values decribed below, they force TclCurl to use the +specific http versions. It should only be used if you really MUST do +that because of a silly remote server. +.RS +.TP 5 +.B none +We do not care about what version the library uses. TclCurl will use whatever +it thinks fit. +.TP +.B 1.0 +Enforce HTTP 1.0 requests. +.TP +.B 1.1 +Enforce HTTP 1.1 requests. +.RE + +.TP +.B -ignorecontentlength +Ignore the Content-Length header. This is useful for Apache 1.x (and similar +servers) which will report incorrect content length for files over 2 +gigabytes. If this option is used, TclCurl will not be able to accurately +report progress, and will simply stop the download when the server ends the +connection. + +.TP +.B -httpcontentdecoding +Set to zero to disable content decoding. If set to 1 it is enabled. Note however +that TclCurl has no default content decoding but requires you to use \fBencoding\fP for that. + +.TP +.B -httptransferencoding +Set to zero to disable transfer decoding, if set to 1 it is enabled (default). TclCurl does +chunked transfer decoding by default unless this option is set to zero. + +.SH FTP options + +.TP +.B -ftpport +Pass a string as parameter. It will be used to +get the IP address to use for the ftp PORT instruction. The PORT instruction +tells the remote server to connect to our specified IP address. The string may +be a plain IP address, a host name, a network interface name (under unix) or +just a '-' to let the library use your systems default IP address. Default FTP +operations are passive, and thus will not use PORT. + +.TP +.B -quote +Pass a \fBlist\fP list with the FTP or SFTP commands to pass to the server prior to your +ftp request. This will be done before any other FTP commands are issued (even +before the CWD command).If you do not want to transfer any files, set +\fBnobody\fP to '1' and \fBheader\fP to '0'. + +Keep in mind the commands to send must be 'raw' ftp commands, for example, to +create a directory you need to send \fBmkd Test\fP, not \fBmkdir Test\fP. + +Valid SFTP commands are: chgrp, chmod, chown, ln, mkdir, pwd, rename, rm, +rmdir and symlink. + +.TP +.B -postquote +Pass a \fBlist\fP with the FTP commands to pass to the server after your +ftp transfer request. If you do not want to transfer any files, set +\fBnobody\fP to '1' and \fBheader\fP to '0'. + +.TP +.B -prequote +Pass a \fBlist\fP of FTP or SFTP commands to pass to the server after the +transfer type is set. + +.TP +.B -dirlistonly +A 1 tells the library to just list the names of files in a +directory, instead of doing a full directory listing that would include file +sizes, dates etc. It works with both FTP and SFTP urls. + +This causes an FTP NLST command to be sent. Beware that some FTP servers list +only files in their response to NLST, they might not include subdirectories +and symbolic links. + +.TP +.B -append +A 1 parameter tells the extension to append to the remote file instead of +overwriting it. This is only useful when uploading to a ftp site. + +.TP +.B -ftpuseeprt +Set to 1 to tell TclCurl to use the EPRT (and LPRT) command when doing +active FTP downloads (which is enabled by '\fBftpport\fP'). Using EPRT means +that it will first attempt to use EPRT and then LPRT before using PORT, if +you pass zero to this option, it will not try using EPRT or LPRT, only plain PORT. + +.TP +.B -ftpuseepvs +Set to one to tell TclCurl to use the EPSV command when doing passive FTP +downloads (which it always does by default). Using EPSV means that it will +first attempt to use EPSV before using PASV, but if you pass a zero to this +option, it will not try using EPSV, only plain PASV. + +.TP +.B -ftpcreatemissingdirs +If set to 1, TclCurl will attempt to create any remote directory that it +fails to CWD into. CWD is the command that changes working directory. + +This setting also applies to SFTP-connections. TclCurl will attempt to create +the remote directory if it can't obtain a handle to the target-location. The +creation will fail if a file of the same name as the directory to create +already exists or lack of permissions prevents creation. + +.TP +.B -ftpresponsetimeout +Causes TclCurl to set a timeout period (in seconds) on the amount of time that +the server is allowed to take in order to generate a response message for a +command before the session is considered hung. Note that while TclCurl is waiting +for a response, this value overrides \fBtimeout\fP. It is recommended that if used +in conjunction with \fBtimeout\fP, you set it to a value smaller than \fBtimeout\fP. + +.TP +.B -ftpalternativetouser +Pass a string which will be used to authenticate if the usual FTP "USER user" and +"PASS password" negotiation fails. This is currently only known to be required when +connecting to Tumbleweed's Secure Transport FTPS server using client certificates for +authentication. + +.TP +.B -ftpskippasvip +If set to 1, it instructs TclCurl not to use the IP address the +server suggests in its 227-response to TclCurl's PASV command when TclCurl +connects the data connection. Instead TclCurl will re-use the same IP address +it already uses for the control connection. But it will use the port number +from the 227-response. + +This option has no effect if PORT, EPRT or EPSV is used instead of PASV. + +.TP +.B -usessl +You can use ftps:// URLs to explicitly switch on SSL/TSL for the control +connection and the data connection. + +Alternatively, and what seems to be the recommended way, you can set the +option to one of these values: + +.RS +.TP 5 +.B nope +Do not attempt to use SSL +.TP +.B try +Try using SSL, proceed anyway otherwise. +.TP +.B control +Use SSL for the control conecction or fail with "use ssl failed" (64). +.TP +.B all +Use SSL for all communication or fail with "use ssl failed" (64). +.RE + +.TP +.B -ftpsslauth + +Pass TclCurl one of the values from below, to alter how TclCurl issues +"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see \fB-ftpssl\fP). + +You may need this option because of servers like BSDFTPD-SSL from +http://bsdftpd-ssl.sc.ru/ "which won't work properly when "AUTH SSL" is issued +(although the server responds fine and everything) but requires "AUTH TLS" +instead". + +.RS +.TP 5 +.B default +Allows TclCurl to decide. +.TP +.B ssl +Try "AUTH SSL" first, and only if that fails try "AUTH TLS". +.TP +.B tls +Try "AUTH TLS" first, and only if that fails try "AUTH SSL". +.RE + +.TP +.B -ftpsslccc +Set it to make TclCurl use CCC (Clear Command Channel). It shuts down the +SSL/TLS layer after authenticating. The rest of the control channel +communication will be unencrypted. This allows NAT routers to follow the +FTP transaction. Possible values are: + +.RS +.TP 5 +.B none +Do not attempt to use CCC. +.TP +.B passive +Do not initiate the shutdown, wait for the server to do it. Do not send a reply. +.TP +.B active +Initiate the shutdown and wait for a reply. +.RE + +.TP +.B -ftpaccount +Pass string (or "" to disable). When an FTP server asks for "account data" after +user name and password has been provided, this data is sent off using the ACCT +command. + +.TP +.B -ftpfilemethod +It allows three values: +.RS +.TP 5 +.B multicwd +The default, TclCurl will do a single CWD operation for each path part in the given +URL. For deep hierarchies this means very many commands. This is how RFC1738 says it +should be done. +.TP +.B nocwd +No CWD at all is done, TclCurl will do SIZE, RETR, STOR, etc and give a full path to +the server. +.TP +.B singlecwd +Make one CWD with the full target directory and then operate on the file "normally". +This is somewhat more standards compliant than 'nocwd' but without the full penalty of 'multicwd'. +.RE + +.SH Protocol options + +.TP +.B -transfertext +A 1 tells the extension to use ASCII mode for ftp transfers, +instead of the default binary transfer. For win32 systems it does not set the +stdout to binary mode. This option can be usable when transferring text data +between systems with different views on certain characters, such as newlines +or similar. + +\fBNOTE:\fP TclCurl does not do a complete ASCII conversion when doing ASCII +transfers over FTP. This is a known limitation/flaw that nobody has +rectified. TclCurl simply sets the mode to ascii and performs a standard +transfer. + +.TP +.B -proxytransfermode +If set to 1, TclCurl sets the transfer mode (binary or ASCII) for FTP transfers +done via an HTTP proxy, by appending ;type=a or ;type=i to the URL. +Without this setting, or it being set to 0, the default, \fB-transfertext\fP has +no effect when doing FTP via a proxy. Beware that not all proxies support this feature. + +.TP +.B -crlf +Convert unix newlines to CRLF newlines on FTP transfers. + +.TP +.B -range +Pass a string as parameter, which should contain the specified range you +want. It should be in the format +.I "X-Y" +, where X or Y may be left out. HTTP +transfers also support several intervals, separated with commas as in +.I "X-Y,N-M" +Using this kind of multiple intervals will cause the HTTP server to send the +response document in pieces (using standard MIME separation techniques). + +Ranges only work on HTTP, FTP and FILE transfers. + +.TP +.B -resumefrom +Pass the offset in number of bytes that you want the transfer to start from. +Set this option to 0 to make the transfer start from the beginning +(effectively disabling resume). + +For FTP, set this option to -1 to make the transfer start from the end of the +target file (useful to continue an interrupted upload). + +.TP +.B -customrequest +Pass a string as parameter. It will be used instead of GET or HEAD when doing +the HTTP request. This is useful for doing DELETE or other more obscure HTTP +requests. Do not do this at will, make sure your server supports the command first. + +Note that TclCurl will still act and assume the keyword it would use if you +do not set your custom and it will act according to that. Thus, changing this +to a HEAD when TclCurl otherwise would do a GET might cause TclCurl to act funny, +and similar. To switch to a proper HEAD, use \fB-nobody\fP, to switch to a proper +POST, use \fB-post\fP or \fB-postfields\fP and so on. + +.TP +.B -filetime +If you pass a 1, TclCurl will attempt to get the +modification date of the remote document in this operation. This requires that +the remote server sends the time or replies to a time querying command. The +getinfo procedure with the +.I filetime +argument can be used after a transfer to extract the received time (if any). + +.TP +.B -nobody +A 1 tells the library not to include the body-part in the +output. This is only relevant for protocols that have a separate header and +body part. On HTTP(S) servers, this will make TclCurl do a HEAD request. + +To change request to GET, you should use \fBhttpget\fP. Change request +to POST with \fBpost\fP etc. + +.TP +.B -infilesize +When uploading a file to a remote site, this option should be used to tell +TclCurl what the expected size of the infile is. + +This option is mandatory for uploading using SCP. + +.TP +.B -upload +A 1 tells the library to prepare for an upload. The +\fB-infile\fP and \fB-infilesize\fP options are also interesting for uploads. +If the protocol is HTTP, uploading means using the PUT request unless you tell +TclCurl otherwise. + +Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header. +You can disable this header with \fB-httpheader\fP as usual. + +If you use PUT to a HTTP 1.1 server, you can upload data without knowing the +size before starting the transfer if you use chunked encoding. You enable this +by adding a header like "Transfer-Encoding: chunked" with \fB-httpheader\fP. +With HTTP 1.0 or without chunked transfer, you must specify the size. + +.TP +.B -maxfilesize +This allows you to specify the maximum size (in bytes) of a file to download. +If the file requested is larger than this value, the transfer will not start +and error 'filesize exceeded' (63) will be returned. + +NOTE: The file size is not always known prior to download, and for such files +this option has no effect even if the file transfer ends up being larger than +this given limit. This concerns both FTP and HTTP transfers. + +.TP +.B -timecondition +This defines how the \fBtimevalue\fP value is treated. You can set this +parameter to \fBifmodsince\fP or \fBifunmodsince\fP. This feature applies to +HTTP and FTP. + +.TP +.B -timevalue +This should be the time in seconds since 1 jan 1970, and the time will be +used in a condition as specified with \fBtimecondition\fP. + + +.SH Connection options + +.TP +.B -timeout +Pass the maximum time in seconds that you allow +the TclCurl transfer operation to take. Do note that normally, name lookups +may take a considerable time and that limiting the operation to less than a +few minutes risks aborting perfectly normal operations. This option will +cause libcurl to use the SIGALRM to enable time-outing system calls. + +In unix-like systems, this might cause signals to be used unless +\fB-nosignal\fP is used. + +.TP +.B -timeoutms +Like \fBtimeout\fP but takes a number of milliseconds instead. If libcurl is +built to use the standard system name resolver, that part will still use +full-second resolution for timeouts. + +.TP +.B -lowspeedlimit +Pass the speed in bytes per second that the transfer should be below during +.B lowspeedtime +seconds for the extension to consider it too slow and abort. + +.TP +.B -lowspeedtime +Pass the time in seconds that the transfer should be below the +.B lowspeedlimit +for the extension to consider it too slow and abort. + +.TP +.B -maxsendspeed +Pass a speed in bytes per seconds. If an upload exceeds this speed on cumulative +average during the transfer, the transfer will pause to keep the average rate less +than or equal to the parameter value. Defaults to unlimited speed. + +.TP +.B -maxrecvspeed +Pass a speed in bytes per second. If a download exceeds this speed on cumulative +average during the transfer, the transfer will pause to keep the average rate less +than or equal to the parameter value. Defaults to unlimited speed. + +.TP +.B -maxconnects +Sets the persistant connection cache size in all the protocols that support +persistent conecctions. The set amount will be the maximum amount of simultaneous +connections that TclCurl may cache in this easy handle. Default is 5, and there +isn't much point in changing this value unless you are perfectly aware of how this +work and changes TclCurl's behaviour. + +When reaching the maximum limit, TclCurl closes the oldest connection in the cache +to prevent the number of open connections to increase. + +\fBNote\fP: if you have already performed transfers with this curl handle, +setting a smaller +.B maxconnects +than before may cause open connections to unnecessarily get closed. + +\fBNote\fP that if you add this easy handle to a multi handle, this setting is not +being acknowledged, instead you must configure the multi handle its own +\fBmaxconnects\fP option. + +.TP +.B -connecttimeout +Maximum time in seconds that you allow the +connection to the server to take. This only limits the connection phase, once +it has connected, this option is of no more use. Set to zero to disable +connection timeout (it will then only timeout on the internal timeouts). + +In unix-like systems, this might cause signals to be used unless +\fB-nosignal\fP is set. + +.TP +.B -connecttimeoutms +Like \fBconnecttimeout\fP but takes a number of milliseconds instead. If libcurl +is built to use the standard system name resolver, that part will still use +full-second resolution for timeouts. + +.TP +.B -ipresolve +Allows an application to select what kind of IP addresses to use when +resolving host names. This is only interesting when using host names +that resolve addresses using more than one version of IP. The allowed +values are: +.RS +.TP 5 +.B whatever +Default, resolves addresses to all IP versions that your system allows. +.TP +.B v4 +Resolve to ipv4 addresses. +.TP +.B v6 +Resolve to ipv6 addresses. +.RE + +.SH SSL and security options + +.TP +.B -sslcert +Pass a string as parameter. The string should be the file name of your certificate. +The default format is "PEM" and can be changed with \fB-sslcerttype\fP. + +With NSS this is the nickname of the certificate you wish to authenticate with. + +.TP +.B -sslcerttype +Pass a string as parameter. The string should be the format of your certificate. +Supported formats are "PEM" and "DER". + +.TP +.B -sslkey +Pass a pointer to a zero terminated string as parameter. The string should be +the file name of your private key. The default format is "PEM" and can be +changed with \fB-sslkeytype\fP. + +.TP +.B -sslkeytype +Pass a pointer to a zero terminated string as parameter. The string should be +the format of your private key. Supported formats are "PEM", "DER" and "ENG" + +\fBNOTE:\fPThe format "ENG" enables you to load the private key from a crypto +engine. in this case \fB-sslkey\fP is used as an identifier passed to +the engine. You have to set the crypto engine with \fB-sslengine\fP. The "DER" +format key file currently does not work because of a bug in OpenSSL. + +.TP +.B -keypasswd +Pass a string as parameter. It will be used as the password required to use the +\fB-sslkey\fP or \fB-sshprivatekeyfile\fP private key. + +You never need a pass phrase to load a certificate but you need one to load you +private key. + +This option used to be known as \fB-sslkeypasswd\fP and \fB-sslcertpasswd\fP. + +.TP +.B -sslengine +Pass a string as parameter. It will be used as the identifier for the crypto +engine you want to use for your private key. + +\fBNOTE:\fPIf the crypto device cannot be loaded, an error will be returned. + +.TP +.B -sslenginedefault +Pass a 1 to set the actual crypto engine as the default for (asymmetric) crypto operations. + +\fBNOTE:\fPIf the crypto device cannot be set, an error will be returned. + +.TP +.B -sslversion +Use it to set what version of SSL/TLS to use. The available options are: +.RS +.TP 5 +.B default +The default action. This will attempt to figure out the remote SSL protocol version, +i.e. either SSLv3 or TLSv1 (but not SSLv2, which became disabled by default with 7.18.1). +.TP +.B tlsv1 +Force TLSv1 +.TP +.B sslv2 +Force SSLv2 +.TP +.B sslv3 +Force SSLv3 +.RE + +.TP +.B -sslverifypeer +This option determines whether TclCurl verifies the authenticity of the peer's certificate. +A 1 means it verifies; zero means it doesn't. The default is 1. + +When negotiating an SSL connection, the server sends a certificate indicating its identity. +TclCurl verifies whether the certificate is authentic, i.e. that you can trust that the +server is who the certificate says it is. This trust is based on a chain of digital signatures, +rooted in certification authority (CA) certificates you supply. + +TclCurl uses a default bundle of CA certificates that comes with libcurl but you can specify +alternate certificates with the \fB-cainfo\fP or the \fB-capath\fP options. + +When \fB-sslverifypeer\fP is nonzero, and the verification fails to prove that the certificate +is authentic, the connection fails. When the option is zero, the connection succeeds regardless. + +Authenticating the certificate is not by itself very useful. You typically want to ensure +that the server, as authentically identified by its certificate, is the server you mean to +be talking to, use \fB-sslverifyhost\fP to control that. + +.TP +.B -cainfo +Pass a file naming holding the certificate to verify the peer with. This only +makes sense when used in combination with the \fB-sslverifypeer\fP option, if +it is set to zero \fB-cainfo\fP need not even indicate an accessible file. + +When built against NSS this is the directory that the NSS certificate database +resides in. + +.TP +.B -issuercert +Pass a string naming a file holding a CA certificate in PEM format. If the option +is set, an additional check against the peer certificate is performed to verify +the issuer is indeed the one associated with the certificate provided by the option. +This additional check is useful in multi-level PKI where one need to enforce the peer +certificate is from a specific branch of the tree. + +This option makes sense only when used in combination with the \fB-sslverifypeer\fP +option. Otherwise, the result of the check is not considered as failure. + +.TP +.B -capath +Pass the directory holding multiple CA certificates to verify the peer with. +The certificate directory must be prepared using the openssl c_rehash utility. +This only makes sense when used in combination with the \fB-sslverifypeer\fP +option, if it is set to zero, \fB-capath\fP need not even indicate an accessible +path. + +This option apparently does not work in Windows due to some limitation in openssl. + +This option is OpenSSL-specific and does nothing if libcurl is built to use GnuTLS. + +.TP +.B -crlfile +Pass a string naming a file with the concatenation of CRL (in PEM format) to use in +the certificate validation that occurs during the SSL exchange. + +When libcurl is built to use NSS or GnuTLS, there is no way to influence the use of +CRL passed to help in the verification process. When built with OpenSSL support, +X509_V_FLAG_CRL_CHECK and X509_V_FLAG_CRL_CHECK_ALL are both set, requiring CRL +check against all the elements of the certificate chain if a CRL file is passed. + +This option makes sense only when used in combination with the \fB-sslverifypeer\fP +option. + +.TP +.B -randomfile +Pass a file name. The file will be used to read from to seed the random engine +for SSL. The more random the specified file is, the more secure will the SSL +connection become. + +.TP +.B -egdsocket +Pass a path name to the Entropy Gathering Daemon socket. It will be used to seed +the random engine for SSL. + +.TP +.B -sslverifyhost +This option determines whether TclCurl verifies that the server claims to be +who you want it to be. + +When negotiating an SSL connection, the server sends a certificate +indicating its identity. + +When \fB-sslverifyhost\fP is set to 2, that certificate must indicate +that the server is the server to which you meant to connect, or the +connection fails. + +TclCurl considers the server the intended one when the Common Name field +or a Subject Alternate Name field in the certificate matches the host +name in the URL to which you told Curl to connect. + +When set to 1, the certificate must contain a Common Name field, +but it does not matter what name it says. (This is not ordinarily a +useful setting). + +When the value is 0, the connection succeeds regardless of the names in +the certificate. + +The default is 2. + +This option controls the identity that the server \fIclaims\fP. The server +could be lying. To control lying, see \fBsslverifypeer\fP. + +.TP +.B -sslcypherlist +Pass a string holding the ciphers to use for the SSL connection. The list must +consists of one or more cipher strings separated by colons. Commas or spaces +are also acceptable separators but colons are normally used, , - and + can be +used as operators. + +For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA', 'SHA1+DES', +'TLSv1' and 'DEFAULT'. The default list is normally set when you compile OpenSSL. + +You will find more details about cipher lists on this URL: + http://www.openssl.org/docs/apps/ciphers.html + +For NSS valid examples of cipher lists include 'rsa_rc4_128_md5', 'rsa_aes_128_sha', +etc. With NSS you don't add/remove ciphers. If you use this option then all known +ciphers are disabled and only those passed in are enabled. + +You'll find more details about the NSS cipher lists on this URL: + http://directory.fedora.redhat.com/docs/mod_nss.html + +.TP +.B -sslsessionidcache +Pass a 0 to disable TclCurl's use of SSL session-ID caching or a 1 to enable it. +By default all transfers are done using the cache. Note that while nothing ever +should get hurt by attempting to reuse SSL session-IDs, there seem to be broken SSL +implementations in the wild that may require you to disable this in order for you to +succeed. + +.TP +.B -krblevel +Set the kerberos security level for FTP, this also enables kerberos awareness. +This is a string, 'clear', 'safe', 'confidential' or 'private'. If the string +is set but does not match one of these, 'private' will be used. Set the string +to NULL to disable kerberos4. Set the string to "" to disable kerberos +support for FTP. + +.SH SSH options + +.TP +.B -sshauthtypes +The allowed types are: + +.RS +.TP 5 +.B publickey +.TP +.B password +.TP +.B host +.TP +.B keyboard +.TP +.B any +To let TclCurl pick one +.RE + +.TP +.B -sshhostpublickeymd5 +Pass a string containing 32 hexadecimal digits. The string should be the 128 +bit MD5 cheksum of the remote host public key, and TclCurl will reject the +connection to the host unless the md5sums match. This option is only for SCP +and SFTP transfers. + +.TP +.B -publickeyfile +Pass the file name for your public key. If not used, TclCurl defaults to using \fB~/.ssh/id_dsa.pub\fP. + +.TP +.B -privatekeyfile +Pass the file name for your private key. If not used, TclCurl defaults to using \fB~/.ssh/id_dsa\fP. +If the file is password-protected, set the password with \fB-keypasswd\fP. + +.SH Other options + +.TP +.B -headervar +Name of the Tcl array variable where TclCurl will store the headers returned +by the server. + +When a server sends a chunked encoded transfer, it may contain a +trailer. That trailer is identical to a HTTP header and if such a trailer is +received it is passed to the application using this callback as well. There +are several ways to detect it being a trailer and not an ordinary header: 1) +it comes after the response-body. 2) it comes after the final header line (CR +LF) 3) a Trailer: header among the response-headers mention what header to +expect in the trailer. + +.TP +.B -bodyvar +Name of the Tcl variable where TclCurl will store the file requested, the file +may contain text or binary data. + +.TP +.B -canceltransvar +Name of a Tcl variable, in case you have defined a procedure to call with +\fB-progressproc\fP setting this variable to '1' will cancel the transfer. + +.TP +.B -command +Executes the given command after the transfer is done, since it only works +with blocking transfers, it is pretty much useless. + +.TP +.B -share +Pass a share handle as a parameter. The share handle must have been created by +a previous call to \fBcurl::shareinit\fP. Setting this option, will make this +handle use the data from the shared handle instead of keeping the data to itself. +See \fItclcurl_share\fP for details. + +.TP +.B -newfileperms +Pass a number as a parameter, containing the value of the permissions that will +be assigned to newly created files on the remote server. The default value is 0644, +but any valid value can be used. The only protocols that can use this are sftp://, +scp:// and file://. + +.TP +.B -newdirectoryperms +Pass a number as a parameter, containing the value of the permissions that will be +assigned to newly created directories on the remote server. The default value is 0755, +but any valid value can be used. The only protocols that can use this are sftp://, scp:// +and file://. + +.SH NOT SUPPORTED +Some of the options libcurl offers are not supported, I don't think them +worth supporting in TclCurl but if you need one of them don't forget to +complain: +.sp +.B CURLOPT_FRESH_CONNECT, CURLOPT_FORBID_REUSE, CURLOPT_PRIVATE, +.B CURLOPT_SSL_CTX_FUNCTION, CURLOPT_SSL_CTX_DATA, CURLOPT_SSL_CTX_FUNCTION and +.B CURLOPT_CONNECT_ONLY, CURLOPT_OPENSOCKETFUNCTION, CURLOPT_OPENSOCKETDATA. + +.SH curlHandle perform +This procedure is called after the +.B init +and all the +.B configure +calls are made, and will perform the transfer as described in the options. +.sp +It must be called with the same +\fIcurlHandle\fP \fBcurl::init\fP call returned. +You can do any amount of calls to perform while using the same handle. If you +intend to transfer more than one file, you are even encouraged to do +so. TclCurl will then attempt to re-use the same connection for the following +transfers, thus making the operations faster, less CPU intense and using less +network resources. Just note that you will have to use +.I configure +between the invokes to set options for the following perform. +.sp +You must never call this procedure simultaneously from two places using the +same handle. Let it return first before invoking it another time. If +you want parallel transfers, you must use several curl handles. +.TP +.B RETURN VALUE +'0' if all went well, non-zero if it didn't. In case of error, if the +.I errorbuffer +was set with +.I configure +there will be a readable error message. +The error codes are: +.IP 1 +Unsupported protocol. This build of TclCurl has no support for this protocol. +.IP 2 +Very early initialization code failed. This is likely to be and internal error +or problem. +.IP 3 +URL malformat. The syntax was not correct. +.IP 5 +Couldn't resolve proxy. The given proxy host could not be resolved. +.IP 6 +Couldn't resolve host. The given remote host was not resolved. +.IP 7 +Failed to connect to host or proxy. +.IP 8 +FTP weird server reply. The server sent data TclCurl couldn't parse. +The given remote server is probably not an OK FTP server. +.IP 9 +We were denied access to the resource given in the URL. For FTP, this occurs +while trying to change to the remote directory. +.IP 11 +FTP weird PASS reply. TclCurl couldn't parse the reply sent to the PASS request. +.IP 13 +FTP weird PASV reply, TclCurl couldn't parse the reply sent to the PASV or EPSV +request. +.IP 14 +FTP weird 227 format. TclCurl couldn't parse the 227-line the server sent. +.IP 15 +FTP can't get host. Couldn't resolve the host IP we got in the 227-line. +.IP 17 +FTP couldn't set type. Couldn't change transfer method to either binary or +ascii. +.IP 18 +Partial file. Only a part of the file was transfered, this happens when +the server first reports an expected transfer size and then delivers data +that doesn't match the given size. +.IP 19 +FTP couldn't RETR file, we either got a weird reply to a 'RETR' command or +a zero byte transfer. +.IP 21 +Quote error. A custom 'QUOTE' returned error code 400 or higher (for FTP) or +otherwise indicated unsuccessful completion of the command. +.IP 22 +HTTP returned error. This return code only appears if \fB-failonerror\fP is +used and the HTTP server returns an error code that is 400 or higher. +.IP 23 +Write error. TclCurl couldn't write data to a local filesystem or an error +was returned from a write callback. +.IP 25 +Failed upload failed. For FTP, the server typcially denied the STOR +command. The error buffer usually contains the server's explanation to this. +.IP 26 +Read error. There was a problem reading from a local file or an error was returned +from the read callback. +.IP 27 +Out of memory. A memory allocation request failed. This should never happen unless +something weird is going on in your computer. +.IP 28 +Operation timeout. The specified time-out period was reached according to the +conditions. +.IP 30 +The FTP PORT command failed, not all FTP servers support the PORT command, +try doing a transfer using PASV instead!. +.IP 31 +FTP couldn't use REST. This command is used for resumed FTP transfers. +.IP 33 +Range error. The server doesn't support or accept range requests. +.IP 34 +HTTP post error. Internal post-request generation error. +.IP 35 +SSL connect error. The SSL handshaking failed, the error buffer may have +a clue to the reason, could be certificates, passwords, ... +.IP 36 +FTP bad download resume. Couldn't continue an earlier aborted download, probably +because you are trying to resume beyond the file size. +.IP 37 +A file given with FILE:// couldn't be read. Did you checked the permissions? +.IP 38 +LDAP cannot bind. LDAP bind operation failed. +.IP 39 +LDAP search failed. +.IP 41 +A required zlib function was not found. +.IP 42 +Aborted by callback. An application told TclCurl to abort the operation. +.IP 43 +Internal error. A function was called with a bad parameter. +.IP 45 +Interface error. A specified outgoing interface could not be used. +.IP 47 +Too many redirects. When following redirects, TclCurl hit the maximum amount, set +your limit with --maxredirs +.IP 48 +Unknown TELNET option specified. +.IP 49 +A telnet option string was illegally formatted. +.IP 51 +The remote peer's SSL certificate or SSH md5 fingerprint wasn't ok +.IP 52 +The server didn't reply anything, which here is considered an error. +.IP 53 +The specified crypto engine wasn't found. +.IP 54 +Failed setting the selected SSL crypto engine as default! +.IP 55 +Failed sending network data. +.IP 56 +Failure with receiving network data. +.IP 58 +Problem with the local client certificate. +.IP 59 +Couldn't use specified SSL cipher. +.IP 60 +Peer certificate cannot be authenticated with known CA certificates. +.IP 61 +Unrecognized transfer encoding. +.IP 62 +Invalid LDAP URL. +.IP 63 +Maximum file size exceeded. +.IP 64 +SSL use failed. +.IP 65 +Sending the data requires a rewind that failed, since TclCurl should +take care of it for you, it means you found a bug. +.IP 66 +Failed to initialise ssl engine. +.IP 67 +Failed to login, user password or similar was not accepted. +.IP 68 +File not found on TFTP server. +.IP 69 +There is a permission problem with the TFTP request. +.IP 70 +The remote server has run out of space. +.IP 71 +Illegal TFTP operation. +.IP 72 +Unknown transfer ID. +.IP 73 +TFTP file already exists and will not be overwritten. +.IP 74 +No such user in the TFTP server and good behaving TFTP server +should never return this. +.IP 75 +Character conversion failed. +.IP 77 +Problem with reading the SSL CA cert (path? access rights?). +.IP 78 +Remote file not found +.IP 79 +Error from the SSH layer +.IP 80 +Failed to shut down the SSL connection +.IP 82 +Failed to load CRL file +.IP 83 +Issuer check failed + +.SH curlHandle getinfo option +Request internal information from the curl session with this procedure. +This procedure is intended to get used *AFTER* a performed transfer, +and can be relied upon only if the \fBperform\fP returns 0. Use +this function AFTER a performed transfer if you want to get +transfer-oriented data. + +The following information can be extracted: + +.TP +.B effectiveurl +Returns the last used effective URL. + +.TP +.B responsecode +Returns the last received HTTP or FTP code. This will be zero if no server +response code has been received. Note that a proxy's CONNECT response should +be read with \fBhttpconnectcode\fP and not this. + +.TP +.B httpconnectcode +Returns the last received proxy response code to a CONNECT request. + +.TP +.B filetime +Returns the remote time of the retrieved document (in number of seconds +since 1 jan 1970 in the GMT/UTC time zone). If you get -1, +it can be because of many reasons (unknown, the server hides it or the +server doesn't support the command that tells document time etc) and the time +of the document is unknown. +.sp +In order for this to work you have to set the \fB-filetime\fP option before +the transfer. + +.TP +.B namelookuptime +Returns the time, in seconds, it took from the start until the name resolving +was completed. + +.TP +.B connecttime +Returns the time, in seconds, it took from the start until the connect to the +remote host (or proxy) was completed. + +.TP +.B appconnecttime +Returns the time, in seconds, it took from the start until the SSL/SSH +connect/handshake to the remote host was completed. This time is most often very +near to the PRETRANSFER time, except for cases such as HTTP pippelining where the +pretransfer time can be delayed due to waits in line for the pipeline and more. + +.TP +.B pretransfertime +Returns the time, in seconds, it took from the start until the file transfer +is just about to begin. This includes all pre-transfer commands and +negotiations that are specific to the particular protocol(s) involved. + +.TP +.B starttransfertime +Returns the time, in seconds, it took from the start until the first byte +is just about to be transfered. This includes the \fBpretransfertime\fP, +and also the time the server needs to calculate the result. + +.TP +.B totaltime +Returns the total transaction time, in seconds, for the previous transfer, +including name resolving, TCP connect etc. + +.TP +.B redirecturl +Returns the URL a redirect would take you to if you enable \fBfollowlocation\fP. +This can come very handy if you think using the built-in libcurl redirect logic +isn't good enough for you but you would still prefer to avoid implementing all +the magic of figuring out the new URL. + +.TP +.B redirecttime +Returns the total time, in seconds, it took for all redirection steps +including name lookup, connect, pretransfer and transfer before +the final transaction was started, it returns the complete execution +time for multiple redirections, so it returns zero if no redirections +were needed. + +.TP +.B redirectcount +Returns the total number of redirections that were actually followed. + +.TP +.B numconnects +Returns how many new connections TclCurl had to create to achieve the +previous transfer (only the successful connects are counted). Combined +with \fBredirectcount\fP you are able to know how many times TclCurl +successfully reused existing connection(s) or not. See the Connection +Options of \fBsetopt\fP to see how TclCurl tries to make persistent +connections to save time. + +.TP +.B primaryip +Returns the IP address of the most recent connection done with this handle. +This string may be IPv6 if that's enabled. + +.TP +.B sizeupload +Returns the total amount of bytes that were uploaded. + +.TP +.B sizedownload +Returns the total amount of bytes that were downloaded. The amount is only +for the latest transfer and will be reset again for each new transfer. + +.TP +.B speeddownload +Returns the average download speed, measured in bytes/second, for the complete download. + +.TP +.B speedupload +Returns the average upload speed, measured in bytes/second, for the complete upload. + +.TP +.B headersize +Returns the total size in bytes of all the headers received. + +.TP +.B requestsize +Returns the total size of the issued requests. This is so far only for HTTP +requests. Note that this may be more than one request if followLocation is true. + +.TP +.B sslverifyresult +Returns the result of the certification verification that was requested +(using the -sslverifypeer option to configure). + +.TP +.B sslengines +Returns a \fBlist\fP of the OpenSSL crypto-engines supported. Note that engines are +normally implemented in separate dynamic libraries. Hence not all the returned +engines may be available at run-time. + +.TP +.B contentlengthdownload +Returns the content-length of the download. This is the value read from the +.B Content-Length: +field. + +.TP +.B contentlengthupload +Returns the specified size of the upload. + +.TP +.B contenttype +Returns the content-type of the downloaded object. This is the value +read from the Content-Type: field. If you get an empty string, it means +the server didn't send a valid Content-Type header or that the protocol +used doesn't support this. + +.TP +.B httpauthavail +Returns a list with the authentication method(s) available. + +.TP +.B proxyauthavail +Returns a list with the authentication method(s) available for your +proxy athentication. + +.TP +.B oserrno +Returns the errno value from a connect failure. + +.TP +.B cookielist +Returns a list of all cookies TclCurl knows (expired ones, too). If there +are no cookies (cookies for the handle have not been enabled or simply +none have been received) the list will be empty. + +.TP +.B ftpentrypath +Returns a string holding the path of the entry path. That is the initial path +TclCurl ended up in when logging on to the remote FTP server. Returns an empty +string if something is wrong. + +.SH curlHandle cleanup +This procedure must be the last one to call for a curl session. It is the +opposite of the +.I curl::init +procedure and must be called with the same +.I curlhandle +as input as the curl::init call returned. +This will effectively close all connections TclCurl has used and possibly +has kept open until now. Don't call this procedure if you intend to transfer +more files. + +.SH curlHandle reset + +Re-initializes all options previously set on a specified handle to the +default values. + +This puts back the handle to the same state as it was in when it was just +created with curl::init. + +It does not change the following information kept in the handle: live +connections, the Session ID cache, the DNS cache, the cookies and shares. + +.SH curlHandle duphandle +This procedure will return a new curl handle, a duplicate, +using all the options previously set in the input curl handle. +Both handles can subsequently be used independently and +they must both be freed with +.B cleanup. +The new handle will not inherit any state information, +connections, SSL sessions or cookies. +.TP +.B RETURN VALUE +A new curl handle or an error message if the copy fails. + +.SH curlHandle pause +You can use this command from within a progress callback procedure +to pause the transfer. + +.SH curlHandle resume +Resumes a transfer paused with \fBcurlhandle pause\fP + +.SH curl::transfer +In case you do not want to use persistant connections you can use this +command, it takes the same arguments as the \fIcurlHandle\fP \fBconfigure\fP +and will init, configure, perform and cleanup a connection for you. + +You can also get the \fIgetinfo\fP information by using \fI-infooption variable\fP +pairs, after the transfer \fIvariable\fP will contain the value that would have +been returned by \fI$curlHandle getinfo option\fP. +.TP +.B RETURN VALUE +The same error code \fBperform\fP would return. + +.SH curl::version +Returns a string with the version number of tclcurl, libcurl and some of +its important components (like OpenSSL version). +.TP +.B RETURN VALUE +The string with the version info. + +.SH curl::escape url +This procedure will convert the given input string to an URL encoded string and +return that. All input characters that are not a-z, +A-Z or 0-9 will be converted to their "URL escaped" version (%NN where NN is a +two-digit hexadecimal number) +.TP +.B RETURN VALUE +The converted string. +.SH curl::unescape url +This procedure will convert the given URL encoded input string to a "plain +string" and return that. All input characters that +are URL encoded (%XX where XX is a two-digit hexadecimal number) will be +converted to their plain text versions. +.TP +.B RETURN VALUE +The string unencoded. + +.SH curl::curlConfig option +Returns some information about how you have +.B cURL +installed. + +.TP +.B -prefix +Returns the directory root where you installed +.B cURL +.TP +.B -feature +Returns a list containing particular main features the installed +.B libcurl +was built with. The list may include SSL, KRB4 or IPv6, do not +assume any particular order. +.TP +.B -vernum +Outputs version information about the installed libcurl, in +numerical mode. This outputs the version number, in hexadecimal, +with 8 bits for each part; major, minor, patch. So that libcurl +7.7.4 would appear as 070704 and libcurl 12.13.14 would appear as +0c0d0e... + +.SH curl::versioninfo option +Returns information about various run-time features in TclCurl. + +Applications should use this information to judge if things are possible to do +or not, instead of using compile-time checks, as dynamic/DLL libraries can be +changed independent of applications. + +.TP +.B -version +Returns the version of libcurl we are using. + +.TP +.B -versionnum +Retuns the version of libcurl we are using in hexadecimal with 8 bits for each +part; major, minor, patch. So that libcurl 7.7.4 would appear as 070704 and +libcurl 12.13.14 would appear as 0c0d0e... Note that the initial zero might be +omitted. + +.TP +.B -host +Returns a string with the host information as discovered by a configure +script or set by the build environment. + +.TP +.B -features +Returns a list with the features compiled into libcurl, the possible elements are: +.RS +.TP 5 +.B ASYNCHDNS +Libcurl was built with support for asynchronous name lookups, which allows +more exact timeouts (even on Windows) and less blocking when using the multi +interface. +.TP +.B CONV +Libcurl was built with support for character conversions. +.TP +.B DEBUG +Libcurl was built with extra debug capabilities built-in. This is mainly of +interest for libcurl hackers. +.TP +.B GSSNEGOTIATE +Supports HTTP GSS-Negotiate. +.TP +.B IDN +Supports IDNA, domain names with international letters. +.TP +.B IPV6 +Supports IPv6. +.TP +.B KERBEROS4 +Supports kerberos4 (when using FTP). +.TP +.B LARGEFILE +Libcurl was built with support for large files. +.TP +.B LIBZ +Supports HTTP deflate using libz. +.TP +.B NTML +Supports HTTP NTLM +.TP +.B SPNEGO +Libcurl was built with support for SPNEGO authentication (Simple and Protected +GSS-API Negotiation Mechanism, defined in RFC 2478) +.TP +.B SSL +Supports SSL (HTTPS/FTPS) +.TP +.B SSPI +Libcurl was built with support for SSPI. This is only available on Windows and +makes libcurl use Windows-provided functions for NTLM authentication. It also +allows libcurl to use the current user and the current user's password without +the app having to pass them on. +.RE +Do not assume any particular order. + +.TP +.B -sslversion +Returns a string with the OpenSSL version used, like OpenSSL/0.9.6b. + +.TP +.B -sslversionnum +Returns the numerical OpenSSL version value as defined by the OpenSSL project. +If libcurl has no SSL support, this is 0. + +.TP +.B -libzversion +Returns a string, there is no numerical version, for example: 1.1.3. + +.TP +.B -protocols +Lists what particular protocols the installed TclCurl was built to support. +At the time of writing, this list may include HTTP, HTTPS, FTP, FTPS, +FILE, TELNET, LDAP, DICT. Do not assume any particular order. The protocols +will be listed using uppercase. There may be none, one or several protocols +in the list. + +.SH curl::easystrerror errorCode +This procedure returns a string describing the error code passed in the argument. + +.SH "SEE ALSO" +.I curl, The art of HTTP scripting (at http://curl.haxx.se), RFC 2396, diff --git a/doc/SinComprimir/tclcurl_multi.n b/doc/SinComprimir/tclcurl_multi.n new file mode 100644 index 0000000..933d00d --- /dev/null +++ b/doc/SinComprimir/tclcurl_multi.n @@ -0,0 +1,226 @@ +.\" You can view this file with: +.\" nroff -man [file] +.\" Adapted from libcurl docs by fandom@telefonica.net +.TH TclCurl n "8 September 2008" "TclCurl 7.19.0" "TclCurl Multi Interface" +.SH NAME +TclCurl: - get a URL with FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE or LDAP syntax. +.SH SYNOPSIS +.BI "curl::multiinit" +.sp +.IB multiHandle " addhandle" +.sp +.IB multiHandle " removehandle" +.sp +.IB multiHandle " configure" +.sp +.IB multiHandle " perform" +.sp +.IB multiHandle " active" +.sp +.IB multiHandle " getinfo " +.sp +.IB multihandle " cleanup" +.sp +.IB multihandle " auto" +.sp +.BI "curl::multistrerror " errorCode +.sp +.SH DESCRIPTION +TclCurl's multi interface introduces several new abilities that the easy +interface refuses to offer. They are mainly: +.TP +Enable a "pull" interface. The application that uses TclCurl decides where and when to get/send data. +.TP +Enable multiple simultaneous transfers in the same thread without making it complicated for the application. +.TP +Keep Tk GUIs 'alive' while transfers are taking place. + +.SH Blocking +A few areas in the code are still using blocking code, even when used from the +multi interface. While we certainly want and intend for these to get fixed in +the future, you should be aware of the following current restrictions: +.RS +.TP 5 +.B Name resolves on non-windows unless c-ares is used. +.TP +.B GnuTLS SSL connections. +.TP +.B Active FTP connections. +.TP +.B HTTP proxy CONNECT operations. +.TP +.B TFTP transfers +.TP +.B file:// transfers. +.RE + +.SH curl::multiinit +This procedure must be the first one to call, it returns a \fImultiHandle\fP +that you need to use to invoke TclCurl procedures. The init MUST have a +corresponding call to \fIcleanup\fP when the operation is completed. +.sp +.B RETURN VALUE +.sp +.I multiHandle +to use. +.sp +.SH multiHandle addhandle ?easyHandle? +.sp +Each single transfer is built up with an 'easy' handle, the kind we have been +using so far with TclCurl, you must create them and setup the appropriate +options for each of them. Then we add them to the 'multi stack' using the +\fIaddhandle\fP command. + +If the easy handle is not set to use a shared or global DNS cache, it will be made +to use the DNS cache that is shared between all easy handles within the multi handle. + +When an easy handle has been added to a multi stack, you can not and you must not use +\fIperform\fP on that handle! + +.sp +.I "multiHandle" +is the return code from the \fIcurl::multiinit\fP call. +.sp +.B RETURN VALUE +The possible return values are: +.IP -1 +Handle added to the multi stack, please call +.I perform +soon +.IP 0 +Handle added ok. +.IP 1 +Invalid multi handle. +.IP 2 +Invalid 'easy' handle. It could mean that it isn't an easy handle at all, or possibly that +the handle already is in used by this or another multi handle. +.IP 3 +Out of memory, you should never get this. +.IP 4 +You found a bug in TclCurl. +.sp +.SH multiHandle removehandle ?easyHandle? +.sp +When a transfer is done or if we want to stop a transfer before it is completed, +we can use the \fIremovehandle\fP command. Once removed from the multi handle, +we can again use other easy interface functions on it. + +Please note that when a single transfer is completed, the easy handle is still +left added to the multi stack. You need to remove it and then close or, possibly, +set new options to it and add it again to the multi handle to start another transfer. + +.sp +.B RETURN VALUE +The possible return values are: +.IP 0 +Handle removed ok. +.IP 1 +Invalid multi handle. +.IP 2 +Invalid 'easy' handle. +.IP 3 +Out of memory, you should never get this. +.IP 4 +You found a bug in TclCurl. +.sp +.SH multiHandle configure +So far the only option is: +.TP +.B -pipelining +Pass a 1 to enable or 0 to disable. Enabling pipelining on a multi handle will +make it attempt to perform HTTP Pipelining as far as possible for transfers using +this handle. This means that if you add a second request that can use an already +existing connection, the second request will be "piped" on the same connection +rather than being executed in parallel. +.TP +.B -maxconnects +Pass a number which will be used as the maximum amount of simultaneously open +connections that TclCurl may cache. Default is 10, and TclCurl will enlarge +the size for each added easy handle to make it fit 4 times the number of added +easy handles. + +By setting this option, you can prevent the cache size to grow beyond the limit +set by you. When the cache is full, curl closes the oldest one in the cache to +prevent the number of open connections to increase. + +This option is for the multi handle's use only, when using the easy interface you should instead use it's own \fBmaxconnects\fP option. +.sp +.SH multiHandle perform +Adding the easy handles to the multi stack does not start any transfer. +Remember that one of the main ideas with this interface is to let your +application drive. You drive the transfers by invoking +.I perform. +TclCurl will then transfer data if there is anything available to transfer. +It'll use the callbacks and everything else we have setup in the individual +easy handles. It'll transfer data on all current transfers in the multi stack +that are ready to transfer anything. It may be all, it may be none. + +When you call \fBperform\fP and the amount of Irunning handles is +changed from the previous call (or is less than the amount of easy handles +you added to the multi handle), you know that there is one or more +transfers less "running". You can then call \fIgetinfo\fP to +get information about each individual completed transfer. +.sp +.B RETURN VALUE +If everything goes well, it returns the number of running handles, '0' if all +are done. In case of error, it will return the error code. +.sp +.SH multiHandle active +In order to know if any of the easy handles are ready to transfer data before +invoking +.I perform +you can use the +.I active +command, it will return the number of transfers currently active. +.sp +.B RETURN VALUE +The number of active transfers or '-1' in case of error. + +.SH multiHandle getinfo +This procedure returns very simple information about the transfers, you +can get more detail information using the \fIgetinfo\fP +command on each of the easy handles. + +.sp +.B RETURN VALUE +A list with the following elements: +.TP +easyHandle about which the info is about. +.TP +state of the transfer, '1' if it is done. +.TP +exit code of the transfer, '0' if there was no error,... +.TP +Number of messages still in the info queue. +.TP +In case there are no messages in the queue it will return {"" 0 0 0}. + +.SH multiHandle cleanup +This procedure must be the last one to call for a multi stack, it is the opposite of the +.I curl::multiinit +procedure and must be called with the same +.I multiHandle +as input as the +.B curl::multiinit +call returned. + +.SH multiHandle auto ?-command \fIcommand\fP? +Using this command Tcl's event loop will take care of periodically invoking \fBperform\fP +for you, before using it, you must have already added at least one easy handle to +the multi handle. + +The \fBcommand\fP option allows you to specify a command to invoke after all the easy +handles have finished their transfers, even though I say it is an option, the truth is +you must use this command to cleanup all the handles, otherwise the transfered files +may not be complete. + +This support is still in a very experimental state, it may still change without warning. +Any and all comments are welcome. + +You can find a couple of examples at \fBtests/multi\fP. + +.SH curl::multistrerror errorCode +This procedure returns a string describing the error code passed in the argument. + +.SH "SEE ALSO" +.I tclcurl, curl. diff --git a/doc/SinComprimir/tclcurl_share.n b/doc/SinComprimir/tclcurl_share.n new file mode 100644 index 0000000..5bedf8b --- /dev/null +++ b/doc/SinComprimir/tclcurl_share.n @@ -0,0 +1,64 @@ +.\" You can view this file with: +.\" nroff -man [file] +.\" Adapted from libcurl docs by fandom@telefonica.net +.TH TclCurl n "8 September 2008" "TclCurl 7.19.0" "TclCurl share data api" +.SH NAME +TclCurl: - get a URL with FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE or LDAP syntax. +.SH SYNOPSIS +.BI "curl::shareinit" +.sp +.IB shareHandle " share " "?data?" +.sp +.IB shareHandle " unshare " "?data?" +.sp +.IB shareHandle " cleanup" +.sp +.BI "curl::sharestrerror " errorCode + + +.SH DESCRIPTION + +With the share API, you can have two or more 'easy' handles sharing data +among them, so far they can only share cookies and DNS data. + +.SH curl::shareinit +This procedure must be the first one to call, it returns a \fBshareHandle\fP +that you need to use to share data among handles using the \fB-share\fP option +to the \fBconfigure\fP command. The init MUST have a corresponding call to +\fBcleanup\fP when the operation is completed. + +.B RETURN VALUE +.sp +\fBshareHandle\fP to use. + +.SH shareHandle share ?data? + +The parameter specifies a type of data that should be shared. This may be set +to one of the values described below: + +.RS +.TP 5 +.B cookies +Cookie data will be shared across the easy handles using this shared object. + +.TP +.B dns +Cached DNS hosts will be shared across the easy handles using this shared object. +Note that when you use the multi interface, all easy handles added to the same multi +handle will share DNS cache by default without this having to be used! +.RE + +.SH shareHandle unshare ?data? +This command does the opposite of \fBshare\fP. The specified parameter will no +longer be shared. Valid values are the same as those for \fBshare\fP. + +.SH sharehandle cleanup + +Deletes a shared object. The share handle cannot be used anymore after this +function has been called. + +.SH curl::sharestrerror errorCode +Returns a string describing the error code passed in the argument. + +.SH "SEE ALSO" +.I curl, TclCurl diff --git a/doc/aolserver.txt b/doc/aolserver.txt new file mode 100755 index 0000000..bc62df9 --- /dev/null +++ b/doc/aolserver.txt @@ -0,0 +1,64 @@ +There are a number of issues with namespaces in AOLserver 3.x, which I believe +are fixed in 4.0, which should be released within a few months. But in the +meantime this is what we've had to do for AOLserver 3.2 on Windows 2000. + +Alex Khassin + + +1. Under [ns_library shared] directory, create a directory called + packages. + +2. Register this directory as a Tcl module in nsd.tcl: + ns_section "ns/server/${servername}/modules" + ns_param packages Tcl + +3. Place each package into a subdirectory of the same name as the + package name (i.e. [ns_library shared]/packages/TclCurl) + +4. Copy S:\NaviSoft\Server\modules\tcl\am\packages.init.tcl to the + [ns_library shared]/packages directory and rename to just init.tcl + +5. Under AOLserver 4.x (and hopefully in 3.5.x) add to the bottom + of this file appropriate commands to register each package: + _am_pregister shared + +6. In your code, when you need to use a particular package, instead + of 'package require ', execute 'am_pinit ' + +7. This will use the existing package registration under AOLserver + 4.x and, under AOLserver 3.2, it will first register the package + in this interpreter and then use it. + +8. This is necessary because in AOLserver 3.2, namespaces aren't + properly imported into child interpreters. + + Currently dnscrub.com is set up like this for TclCurl and it works. + + Example usage: + + am_pinit TclCurl + curl::transfer -url http://am.net/index.htm -file d:/test.htm + +FYI, the code for am_pinit and _am_pregister procs: + + proc am_pinit {package} { + # AOLserver 3.2 package/namespace-handling is broken + # (namespace/packages don't get imported into child interpreters) + # so use this workaround proc instead of 'package require' to + # load the package into the current interpreter + # (this is obviously slower than copying from master interpeter) + # Package names are case-sensitive! + # Returns the version of the loaded package + set library shared + if {[lsearch -exact [package names] $package] == -1} { + ns_log Notice "packages: registering $library/$package" + _am_pregister $library $package + } + package require $package + } + + proc _am_pregister {library package} { + # Registers the package. library is 'shared' or 'private' + set dir [ns_library $library]/packages/$package + source $dir/pkgIndex.tcl + } diff --git a/doc/tclcurl.html b/doc/tclcurl.html new file mode 100644 index 0000000..3ce19f2 --- /dev/null +++ b/doc/tclcurl.html @@ -0,0 +1,2569 @@ +Manpage of TclCurl + +

TclCurl

+Section: Easy inteface (n)
Updated: 8 September 2008
+  +
+

NAME

+ +TclCurl: - get a URL with FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE or LDAP syntax. +  +

SYNOPSIS

+ +curl::init + +

+curlHandle configure ?options? + +

+curlHandle perform + +

+curlHandle getinfo curlinfo_option + +

+curlhandle cleanup + +

+curlhandle reset + +

+curlHandle duhandle + +

+curlHandle pause + +

+curlHandle resume + +

+curl::transfer ?options? + +

+curl::version + +

+curl::escape url + +

+curl::unescape url + +

+curl::curlConfig option + +

+curl::versioninfo option + +

+curl::easystrerror errorCode + +

+  +

DESCRIPTION

+ +The TclCurl extension gives Tcl programmers access to the libcurl +library written by Daniel Stenberg, with it you can download urls, +upload them and many other neat tricks, for more information check +cURL's web page + +  +

curl::init

+ +This procedure must be the first one to call, it returns a +curlHandle + +that you need to use to invoke TclCurl procedures. The init calls intializes +curl and this call MUST have a corresponding call to +cleanup + +when the operation is completed. +You should perform all your sequential file transfers using the same +curlHandle. This enables TclCurl to use persistant connections when +possible. +

+RETURN VALUE + +

+curlHandle + +to use. +  +

curlHandle configure ?options?

+ +

+configure + +is called to set the options for the transfer. Most operations in TclCurl +have default actions, and by using the appropriate options you can +make them behave differently (as documented). All options are set with +the option followed by a parameter. +

+Notes: + +the options set with this procedure are valid for the +forthcoming data transfers that are performed when you invoke +perform + +

+The options are not reset between transfers (except where noted), so if +you want subsequent transfers with different options, you must change them +between the transfers. You can optionally reset all options back to the internal +default with curlHandle reset. +

+curlHandle + +is the return code from the +curl::init + +call. +

+

+OPTIONS + +

+  +

Behaviour options

+ +

+

+
-verbose + +
+Set the parameter to 1 to get the library to display a lot of verbose +information about its operations. Very useful for libcurl and/or protocol +debugging and understanding. +

+You hardly ever want this set in production use, you will almost always want +this when you debug/report problems. Another neat option for debugging is +-debugproc + +

+

-header + +
+A 1 tells the extension to include the headers in the body output. This is +only relevant for protocols that actually have headers preceding the data (like HTTP). +

+

-noprogress + +
+A 1 tells the extension to turn on the built-in progress meter. +Nowadays it is turn off by default. +

+

-nosignal + +
+A 1 tells TclCurl not use any functions that install signal +handlers or any functions that cause signals to be sent to the process. This +option is mainly here to allow multi-threaded unix applications to still +set/use all timeout options etc, without risking getting signals. +

+

+

+  +

Callback options

+ +

+

+
-writeproc + +
+Use it to set a Tcl procedure that will be invoked by TclCurl as soon as +there is received data that needs to be saved. The procedure will receive +a single parameter with the data to be saved. +

+NOTE: you will be passed as much data as possible in all invokes, but you +cannot possibly make any assumptions. It may be nothing if the file is +empty or it may be thousands of bytes. +

+

-file + +
+File in which the transfered data will be saved. +

+

-readproc + +
+Sets a Tcl procedure to be called by TclCurl as soon as it needs to read +data in order to send it to the peer. The procedure has to take one +parameter, which will contain the maximun numbers of bytes to read. It +should return the actual number of bytes read, or '0' if you want to +stop the transfer. +

+

-infile + +
+File from which the data will be transfered. +

+

-progressproc + +
+Name of the Tcl procedure that will invoked by TclCurl with a frequent +interval during operation (roughly once per second), no matter if data +is being transfered or not. Unknown/unused +argument values passed to the callback will be set to zero (like if you +only download data, the upload size will remain 0), the prototype of the +procedure must be: +

+proc ProgressCallback {dltotal dlnow ultotal ulnow} + +

+In order to this option to work you have to set the noprogress +option to '0'. Setting this option to the empty string will restore the +original progress function. +

+If you transfer data with the multi interface, this procedure will not be +called during periods of idleness unless you call the appropriate procedure +that performs transfers. +

+You can pause and resume a transfer from within this procedure using the +pause and resume commands. +

+

-writeheader + +
+Pass a the file name to be used to write the header part of the received data to. +The headers are guaranteed to be written one-by-one to this file and +only complete lines are written. Parsing headers should be easy enough using +this. +

+

-debugproc + +
+Name of the procedure that will receive the debug data produced by the +-verbose + +option, it should match the following prototype: +

+debugProc {infoType data} + +

+where infoType specifies what kind of information it is (0 text, +1 incoming header, 2 outgoing header, 3 incoming data, 4 outgoing data, +5 incoming SSL data, 6 outgoing SSL data). +

+

+  +

Error Options

+ +

+

+
-errorbuffer + +
+Pass a variable name where TclCurl may store human readable error +messages in. This may be more helpful than just the return code from the +command. +

+

-stderr + +
+Pass a file name as parameter. This is the stream to use internally instead +of stderr when reporting errors. +
-failonerror + +
+A 1 parameter tells the extension to fail silently if the HTTP code +returned is equal or larger than 400. The default action would be to return +the page normally, ignoring that code. +

+This method is not fail-safe and there are occasions where non-successful response +codes will slip through, especially when authentication is involved +(response codes 401 and 407). +

+You might get some amounts of headers transferred before this situation is detected, +like for when a "100-continue" is received as a response to a POST/PUT and a 401 +or 407 is received immediately afterwards. +

+

+  +

Network options

+ +

+

+
-url + +
+The actual URL to deal with. +

+If the given URL lacks the protocol part ("http://" or "ftp://" etc), it will +attempt to guess which protocol to use based on the given host name. If the +given protocol of the set URL is not supported, TclCurl will return the +unsupported protocol error when you call perform. Use +curl::versioninfo for detailed info on which protocols that are supported. +

+NOTE: this the one option required to be set +before +perform + +is called. +

+

-proxy + +
+If you need to use a http proxy to access the outside world, set the +proxy string with this option. To specify port number in this string, +append :[port] to the end of the host name. The proxy string may be +prefixed with [protocol]:// since any such prefix will be ignored. +

+When you tell the extension to use a HTTP proxy, TclCurl will +transparently convert operations to HTTP even if you specify a FTP +URL etc. This may have an impact on what other features of the library +you can use, such as +quote + +and similar FTP specifics that will not work unless you tunnel through +the HTTP proxy. Such tunneling is activated with +proxytunnel + +

+TclCurl respects the environment variables http_proxy, ftp_proxy, +all_proxy etc, if any of those are set. The use of this option does +however override any possibly set environment variables. +

+Setting the proxy string to "" (an empty string) will explicitly disable +the use of a proxy, even if there is an environment variable set for it. +

+The proxy host string can be specified the exact same way as the proxy +environment variables, include protocol prefix (http://) and embedded +user + password. +

+

-proxyport + +
+Use this option to set the proxy port to use unless it is specified in +the proxy string by -proxy. +

+

-proxytype + +
+Pass the type of the proxy. Available options are 'http', 'socks4', 'socks4a' +and 'socks5', with the HTTP one being default. +

+

-httpproxytunnel + +
+Set the parameter to 1 to get the extension to tunnel all non-HTTP +operations through the given HTTP proxy. Do note that there is a big +difference between using a proxy and tunneling through it. If you don't know what +this means, you probably don't want this tunnel option. + +

+

-interface + +
+Pass the interface name to use as outgoing +network interface. The name can be an interface name, an IP address or a host +name. +

+

-localport + +
+This sets the local port number of the socket used for connection. This can +be used in combination with -interface and you are recommended to use +localportrange as well when this is set. Note the only valid port numbers +are 1 - 65535. +

+

-localportrange + +
+This is the number of attempts TclCurl should do to find a working local port +number. It starts with the given -localport and adds +one to the number for each retry. Setting this value to 1 or below will make +TclCurl do only one try for exact port number. Note that port numbers by nature +are a scarce resource that will be busy at times so setting this value to something +too low might cause unnecessary connection setup failures. +

+

-dnscachetimeout + +
+Pass the timeout in seconds. Name resolves will be kept in memory for this number +of seconds. Set to '0' to completely disable caching, or '-1' to make the +cached entries remain forever. By default, TclCurl caches this info for 60 seconds. +

+

-dnsuseglobalcache + +
+If the value passed is 1, it tells TclCurl to use a global DNS cache that +will survive between curl handles creations and deletions. This is not thread-safe +as it uses a global varible. +

+WARNING: this option is considered obsolete. Stop using it. Switch over +to using the share interface instead! See tclcurl_share. +

+

-buffersize + +
+Pass your prefered size for the receive buffer in TclCurl. The main point of this +would be that the write callback gets called more often and with smaller chunks. +This is just treated as a request, not an order. You cannot be guaranteed to +actually get the given size. +

+

-port + +
+

+Pass the number specifying what remote port to connect to, instead of the one specified +in the URL or the default port for the used protocol. +

+

-tcpnodelay + +
+

+Pass a number to specify whether the TCP_NODELAY option should be set or cleared (1 = set, 0 = clear). +The option is cleared by default. This will have no effect after the connection has been established. +

+Setting this option will disable TCP's Nagle algorithm. The purpose of this algorithm is to try to +minimize the number of small packets on the network (where "small packets" means TCP segments less +than the Maximum Segment Size (MSS) for the network). +

+Maximizing the amount of data sent per TCP segment is good because it amortizes the overhead of the +send. However, in some cases (most notably telnet or rlogin) small segments may need to be sent without +delay. This is less efficient than sending larger amounts of data at a time, and can contribute to +congestion on the network if overdone. +

+

-addressscope + +
+Pass a number specifying the scope_id value to use when connecting to IPv6 link-local or site-local +addresses. +

+

+  +

Names and Passwords options

+ +

+

+
-netrc + +
+A 1 parameter tells the extension to scan your +~/.netrc + +file to find user name and password for the remote site you are about to +access. Do note that TclCurl does not verify that the file has the correct +properties set (as the standard unix ftp client does), and that only machine +name, user name and password is taken into account (init macros and similar +things are not supported). +

+You can set it to the following values: +

+
+
optional + +
+The use of your ~/.netrc file is optional, and information in the URL is to +be preferred. The file will be scanned with the host and user name (to find +the password only) or with the host only, to find the first user name and +password after that machine, which ever information is not specified in +the URL. +

+Undefined values of the option will have this effect. +

ignored + +
+The extension will ignore the file and use only the information in the URL. +This is the default. +
required + +
+This value tells the library that use of the file is required, to ignore +the information in the URL, and to search the file with the host only. +
+
+ +

+

-netrcfile + +
+Pass a string containing the full path name to the file you want to use as .netrc +file. For the option to work, you have to set the netrc option to +required. If this option is omitted, and netrc is set, TclCurl +will attempt to find the a .netrc file in the current user's home directory. +

+

-userpwd + +
+Pass a string as parameter, which should be [username]:[password] to use for +the connection. Use httpauth to decide authentication method. +

+When using NTLM, you can set domain by prepending it to the user name and +separating the domain and name with a forward (/) or backward slash (\). Like +this: "domain/user:password" or "domain\user:password". Some HTTP servers (on +Windows) support this style even for Basic authentication. +

+When using HTTP and -followlocation, TclCurl might perform several +requests to possibly different hosts. TclCurl will only send this user and +password information to hosts using the initial host name (unless +-unrestrictedauth is set), so if TclCurl follows locations to other +hosts it will not send the user and password to those. This is enforced to +prevent accidental information leakage. +

+

-proxyuserpwd + +
+Pass a string as parameter, which should be [username]:[password] to use for +the connection to the HTTP proxy. +

+

-httpauth + +
+Set to the authentication method you want, the available ones are: +
+
+
basic + +
+HTTP Basic authentication. This is the default choice, and the only +method that is in widespread use and supported virtually everywhere. +It sends the user name and password over the network in plain text, +easily captured by others. +

+

digest + +
+HTTP Digest authentication. Digest authentication is a more secure +way to do authentication over public networks than the regular +old-fashioned Basic method. +

+

gssnegotiate + +
+HTTP GSS-Negotiate authentication. The GSS-Negotiate method, also known as +plain "Negotiate",was designed by Microsoft and is used in their web +applications. It is primarily meant as a support for Kerberos5 authentication +but may be also used along with another authentication methods. +

+

ntlm + +
+HTTP NTLM authentication. A proprietary protocol invented and used by Microsoft. +It uses a challenge-response and hash concept similar to Digest, to prevent the +password from being eavesdropped. +

+

any + +
+TclCurl will automatically select the one it finds most secure. +

+

anysafe + +
+It may use anything but basic, TclCurl will automaticly select the +one it finds most secure. +
+
+ +

+

-proxyauth + +
+Use it to tell TclCurl which authentication method(s) you want it to use for +your proxy authentication. Note that for some methods, this will induce an +extra network round-trip. Set the actual name and password with the +proxyuserpwd option. +

+The methods are those listed above for the httpauth option. As of this +writing, only Basic and NTLM work. +

+

+  +

HTTP options

+ +

+

+
-autoreferer + +
+Pass an 1 parameter to enable this. When enabled, TclCurl will +automatically set the Referer: field in requests where it follows a Location: +redirect. +

+

-encoding + +
+Sets the contents of the Accept-Encoding: header sent in an HTTP +request, and enables decoding of a response when a Content-Encoding: +header is received. Three encodings are supported: identity, +which does nothing, deflate which requests the server to +compress its response using the zlib algorithm, and gzip which +requests the gzip algorithm. Use all to send an +Accept-Encoding: header containing all supported encodings. +

+This is a request, not an order; the server may or may not do it. This +option must be set or else any unsolicited +encoding done by the server is ignored. See the special file +lib/README.encoding in libcurl docs for details. +

+

-followlocation + +
+An 1 tells the library to follow any +Location: header + +that the server sends as part of a HTTP header. +

+NOTE: this means that the extension will re-send the same +request on the new location and follow new Location: headers +all the way until no more such headers are returned. +-maxredirs can be used to limit the number of redirects +TclCurl will follow. +

+

-unrestrictedauth + +
+An 1 parameter tells the extension it can continue +to send authentication (user+password) when following +locations, even when hostname changed. Note that this +is meaningful only when setting -followlocation. +

+

-maxredirs + +
+Sets the redirection limit. If that many redirections have been followed, +the next redirect will cause an error. This option only makes sense if the +-followlocation option is used at the same time. Setting the limit +to 0 will make libcurl refuse any redirect. Set it to -1 for an infinite +number of redirects (which is the default) +

+

-post301 + +
+An 1 tells TclCurl to respect RFC 2616/10.3.2 and not +convert POST requests into GET requests when following a 301 redirection. The +non-RFC behaviour is ubiquitous in web browsers, so the conversion is done +by default to maintain consistency. However, a server may require +a POST to remain a POST after such a redirection. This option is meaningful +only when setting -followlocation. +

+

-put + +
+An 1 parameter tells the extension to use HTTP PUT a file. The file to put +must be set with -infile and -infilesize. +

+This option is deprecated starting with version 0.12.1, you should use -upload. +

+

-post + +
+An 1 parameter tells the library to do a regular HTTP post. This is a +normal application/x-www-form-urlencoded kind, which is the most commonly used +one by HTML forms. See the -postfields option for how to specify the +data to post and -postfieldsize about how to set the data size. +

+Use the -postfields option to specify what data to post and -postfieldsize +to set the data size. Optionally, you can provide data to POST using the -readproc +options. +

+You can override the default POST Content-Type: header by setting your own with +-httpheader. +

+Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. +You can disable this header with -httpheader as usual. +

+If you use POST to a HTTP 1.1 server, you can send data without knowing the +size before starting the POST if you use chunked encoding. You enable this +by adding a header like "Transfer-Encoding: chunked" with -httpheader. +With HTTP 1.0 or without chunked transfer, you must specify the size in the +request. +

+When setting post to an 1 value, it will automatically set +nobody to 0. +

+NOTE: if you have issued a POST request and want to make a HEAD or GET instead, you must +explicitly pick the new request type using -nobody or -httpget or similar. +

+

-postfields + +
+Pass a string as parameter, which should be the full data to post in a HTTP +POST operation. You must make sure that the data is formatted the way you +want the server to receive it. TclCurl will not convert or encode it for you. +Most web servers will assume this data to be url-encoded. +

+This is a normal application/x-www-form-urlencoded kind, +which is the most commonly used one by HTML forms. +

+If you want to do a zero-byte POST, you need to set +-postfieldsize explicitly to zero, as simply setting +-postfields to NULL or "" just effectively disables the sending +of the specified string. TclCurl will instead assume that the POST +data will be send using the read callback! +

+Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. +You can disable this header with -httpheader as usual. +

+Note: to make multipart/formdata posts (aka rfc1867-posts), check out +-httppost option. +

+

-postfieldsize + +
+If you want to post data to the server without letting TclCurl do a strlen() +to measure the data size, this option must be used. Also, when this option is +used, you can post fully binary data which otherwise is likely to fail. If +this size is set to zero, the library will use strlen() to get the data +size. +

+

-httppost + +
+Tells TclCurl you want a multipart/formdata HTTP POST to be made and you +instruct what data to pass on to the server through a +Tcl list. + +

+This is the only case where the data is reset after a transfer. +

+First, there are some basics you need to understand about multipart/formdata +posts. Each part consists of at least a NAME and a CONTENTS part. If the part +is made for file upload, there are also a stored CONTENT-TYPE and a +FILENAME. Below, we'll discuss on what options you use to set these +properties in the parts you want to add to your post. +

+The list must contain a 'name' tag with the name of the section followed +by a string with the name, there are three tags to indicate the value of +the section: 'value' followed by a string with the data to post, 'file' +followed by the name of the file to post and 'contenttype' with the +type of the data (text/plain, image/jpg, ...), you can also indicate a false +file name with 'filename', this is useful in case the server checks if the given +file name is valid, for example, by testing if it starts with 'c:\' as any real file +name does or if you want to include the full path of the file to post. You can also post +the content of a variable as if it were a file with the options 'bufferName' and +'buffer' or use 'filecontent' followed by a file name to read that file and +use the contents as data. +

+Should you need to specify extra headers for the form POST section, use +'contentheader' followed by a list with the headers to post. +

+Please see 'httpPost.tcl' and 'httpBufferPost.tcl' for examples. +

+If TclCurl can't set the data to post an error will be returned: +

+
+
1 + +
+If the memory allocation fails. +
2 + +
+If one option is given twice for one form. +
3 + +
+If an empty string was given. +
4 + +
+If an unknown option was used. +
5 + +
+If the some form info is not complete (or error) +
6 + +
+If an illegal option is used in an array. +
7 + +
+TclCurl has no http support. +
+
+ +

+

-referer + +
+Pass a string as parameter. It will be used to set the +referer + +header in the http request sent to the remote server. This can be used to +fool servers or scripts. You can also set any custom header with +-httpheader. + +

+

-useragent + +
+Pass a string as parameter. It will be used to set the +user-agent: + +header in the http request sent to the remote server. This can be used to fool +servers or scripts. You can also set any custom header with +-httpheader. + +

+

-httpheader + +
+Pass a +list + +with the HTTP headers to pass to the server in your request. +If you add a header that is otherwise generated +and used by TclCurl internally, your added one will be used instead. If you +add a header with no contents as in 'Accept:', the internally used header will +just get disabled. Thus, using this option you can add new headers, replace +and remove internal headers. +

+The headers included in the linked list must not be CRLF-terminated, because +TclCurl adds CRLF after each header item. Failure to comply with this will +result in strange bugs because the server will most likely ignore part of the +headers you specified. +

+The first line in a request (containing the method, usually a GET or POST) is +not a header and cannot be replaced using this option. Only the lines +following the request-line are headers. Adding this method line in this list +of headers will only cause your request to send an invalid header. +

+NOTE:The most commonly replaced headers have "shortcuts" in the options: +cookie, useragent, + +and +referer. + +

+

-http200aliases + +
+Pass a list of aliases to be treated as valid HTTP 200 responses. Some servers +respond with a custom header response line. For example, IceCast servers respond +with "ICY 200 OK". By including this string in your list of aliases, the +response will be treated as a valid HTTP header line such as "HTTP/1.0 200 OK". +

+NOTE:The alias itself is not parsed for any version strings. Before version +7.16.3, TclCurl used the value set by option httpversion, but starting with +7.16.3 the protocol is assumed to match HTTP 1.0 when an alias matched. +

+

-cookie + +
+Pass a string as parameter. It will be used to +set a cookie in the http request. The format of the string should be + +what the cookie should contain. +

+If you need to set mulitple cookies, you need to set them all using +a single option and thus you need to concatenate them all in one single string. +Set multiple cookies in one string like this: "name1=content1; name2=content2;" +etc. +

+Note that this option sets the cookie header explictly in the outgoing request(s). +If multiple requests are done due to authentication, followed redirections or similar, +they will all get this cookie passed on. +

+Using this option multiple times will only make the latest string override +the previous ones. +

+

-cookiefile + +
+Pass a string as parameter. It should contain the name of your file holding +cookie data. The cookie data may be in netscape cookie data format or just +regular HTTP-style headers dumped to a file. +

+Given an empty or non-existing file, this option will enable cookies for this +curl handle, making it understand and parse received cookies and then use +matching cookies in future requests. +

+If you use this option multiple times, you add more files to read. +

+

-cookiejar + +
+Pass a file name in which TclCurl will dump all internally known cookies +when +curlHandle cleanup + +is called. If no cookies are known, no file will be created. +Specify "-" to have the cookies written to stdout. +

+Using this option also enables cookies for this session, so if you, for +example, follow a location it will make matching cookies get sent accordingly. +

+TclCurl will not and cannot report an error for this. Using 'verbose' +will get a warning to display, but that is the only visible feedback you get +about this possibly lethal situation. +

+

-cookiesession + +
+Pass an 1 to mark this as a new cookie "session". It will +force TclCurl to ignore all cookies it is about to load that are "session +cookies" from the previous session. By default, TclCurl always stores and +loads all cookies, independent of whether they are session cookies are not. +Session cookies are cookies without expiry date and they are meant to be +alive and existing for this "session" only. +

+

-cookielist + +
+Pass a string with a cookie. The cookie can be either in Netscape / Mozilla +format or just regular HTTP-style header (Set-Cookie: ...) format. If the +cookie engine was not enabled it will be enabled. Passing a +magic string "ALL" will erase all known cookies while "FLUSH" will write +all cookies known by TclCurl to the file specified by -cookiejar. +

+

-httpget + +
+If set to 1 forces the HTTP request to get back to GET, usable if +POST, PUT or a custom request have been used previously with the +same handle. +

+When setting httpget to 1, nobody will automatically be set to 0. +

+

-httpversion + +
+Set to one of the values decribed below, they force TclCurl to use the +specific http versions. It should only be used if you really MUST do +that because of a silly remote server. +
+
+
none + +
+We do not care about what version the library uses. TclCurl will use whatever +it thinks fit. +
1.0 + +
+Enforce HTTP 1.0 requests. +
1.1 + +
+Enforce HTTP 1.1 requests. +
+
+ +

+

-ignorecontentlength + +
+Ignore the Content-Length header. This is useful for Apache 1.x (and similar +servers) which will report incorrect content length for files over 2 +gigabytes. If this option is used, TclCurl will not be able to accurately +report progress, and will simply stop the download when the server ends the +connection. +

+

-httpcontentdecoding + +
+Set to zero to disable content decoding. If set to 1 it is enabled. Note however +that TclCurl has no default content decoding but requires you to use encoding for that. +

+

-httptransferencoding + +
+Set to zero to disable transfer decoding, if set to 1 it is enabled (default). TclCurl does +chunked transfer decoding by default unless this option is set to zero. +

+

+  +

FTP options

+ +

+

+
-ftpport + +
+Pass a string as parameter. It will be used to +get the IP address to use for the ftp PORT instruction. The PORT instruction +tells the remote server to connect to our specified IP address. The string may +be a plain IP address, a host name, a network interface name (under unix) or +just a '-' to let the library use your systems default IP address. Default FTP +operations are passive, and thus will not use PORT. +

+

-quote + +
+Pass a list list with the FTP or SFTP commands to pass to the server prior to your +ftp request. This will be done before any other FTP commands are issued (even +before the CWD command).If you do not want to transfer any files, set +nobody to '1' and header to '0'. +

+Keep in mind the commands to send must be 'raw' ftp commands, for example, to +create a directory you need to send mkd Test, not mkdir Test. +

+Valid SFTP commands are: chgrp, chmod, chown, ln, mkdir, pwd, rename, rm, +rmdir and symlink. +

+

-postquote + +
+Pass a list with the FTP commands to pass to the server after your +ftp transfer request. If you do not want to transfer any files, set +nobody to '1' and header to '0'. +

+

-prequote + +
+Pass a list of FTP or SFTP commands to pass to the server after the +transfer type is set. +

+

-dirlistonly + +
+A 1 tells the library to just list the names of files in a +directory, instead of doing a full directory listing that would include file +sizes, dates etc. It works with both FTP and SFTP urls. +

+This causes an FTP NLST command to be sent. Beware that some FTP servers list +only files in their response to NLST, they might not include subdirectories +and symbolic links. +

+

-append + +
+A 1 parameter tells the extension to append to the remote file instead of +overwriting it. This is only useful when uploading to a ftp site. +

+

-ftpuseeprt + +
+Set to 1 to tell TclCurl to use the EPRT (and LPRT) command when doing +active FTP downloads (which is enabled by 'ftpport'). Using EPRT means +that it will first attempt to use EPRT and then LPRT before using PORT, if +you pass zero to this option, it will not try using EPRT or LPRT, only plain PORT. +

+

-ftpuseepvs + +
+Set to one to tell TclCurl to use the EPSV command when doing passive FTP +downloads (which it always does by default). Using EPSV means that it will +first attempt to use EPSV before using PASV, but if you pass a zero to this +option, it will not try using EPSV, only plain PASV. +

+

-ftpcreatemissingdirs + +
+If set to 1, TclCurl will attempt to create any remote directory that it +fails to CWD into. CWD is the command that changes working directory. +

+This setting also applies to SFTP-connections. TclCurl will attempt to create +the remote directory if it can't obtain a handle to the target-location. The +creation will fail if a file of the same name as the directory to create +already exists or lack of permissions prevents creation. +

+

-ftpresponsetimeout + +
+Causes TclCurl to set a timeout period (in seconds) on the amount of time that +the server is allowed to take in order to generate a response message for a +command before the session is considered hung. Note that while TclCurl is waiting +for a response, this value overrides timeout. It is recommended that if used +in conjunction with timeout, you set it to a value smaller than timeout. +

+

-ftpalternativetouser + +
+Pass a string which will be used to authenticate if the usual FTP "USER user" and +"PASS password" negotiation fails. This is currently only known to be required when +connecting to Tumbleweed's Secure Transport FTPS server using client certificates for +authentication. +

+

-ftpskippasvip + +
+If set to 1, it instructs TclCurl not to use the IP address the +server suggests in its 227-response to TclCurl's PASV command when TclCurl +connects the data connection. Instead TclCurl will re-use the same IP address +it already uses for the control connection. But it will use the port number +from the 227-response. +

+This option has no effect if PORT, EPRT or EPSV is used instead of PASV. +

+

-usessl + +
+You can use ftps:// URLs to explicitly switch on SSL/TSL for the control +connection and the data connection. +

+Alternatively, and what seems to be the recommended way, you can set the +option to one of these values: +

+

+
+
nope + +
+Do not attempt to use SSL +
try + +
+Try using SSL, proceed anyway otherwise. +
control + +
+Use SSL for the control conecction or fail with "use ssl failed" (64). +
all + +
+Use SSL for all communication or fail with "use ssl failed" (64). +
+
+ +

+

-ftpsslauth + +
+

+Pass TclCurl one of the values from below, to alter how TclCurl issues +"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see -ftpssl). +

+You may need this option because of servers like BSDFTPD-SSL from +http://bsdftpd-ssl.sc.ru/ "which won't work properly when "AUTH SSL" is issued +(although the server responds fine and everything) but requires "AUTH TLS" +instead". +

+

+
+
default + +
+Allows TclCurl to decide. +
ssl + +
+Try "AUTH SSL" first, and only if that fails try "AUTH TLS". +
tls + +
+Try "AUTH TLS" first, and only if that fails try "AUTH SSL". +
+
+ +

+

-ftpsslccc + +
+Set it to make TclCurl use CCC (Clear Command Channel). It shuts down the +SSL/TLS layer after authenticating. The rest of the control channel +communication will be unencrypted. This allows NAT routers to follow the +FTP transaction. Possible values are: +

+

+
+
none + +
+Do not attempt to use CCC. +
passive + +
+Do not initiate the shutdown, wait for the server to do it. Do not send a reply. +
active + +
+Initiate the shutdown and wait for a reply. +
+
+ +

+

-ftpaccount + +
+Pass string (or "" to disable). When an FTP server asks for "account data" after +user name and password has been provided, this data is sent off using the ACCT +command. +

+

-ftpfilemethod + +
+It allows three values: +
+
+
multicwd + +
+The default, TclCurl will do a single CWD operation for each path part in the given +URL. For deep hierarchies this means very many commands. This is how RFC1738 says it +should be done. +
nocwd + +
+No CWD at all is done, TclCurl will do SIZE, RETR, STOR, etc and give a full path to +the server. +
singlecwd + +
+Make one CWD with the full target directory and then operate on the file "normally". +This is somewhat more standards compliant than 'nocwd' but without the full penalty of 'multicwd'. +
+
+ +

+

+  +

Protocol options

+ +

+

+
-transfertext + +
+A 1 tells the extension to use ASCII mode for ftp transfers, +instead of the default binary transfer. For win32 systems it does not set the +stdout to binary mode. This option can be usable when transferring text data +between systems with different views on certain characters, such as newlines +or similar. +

+NOTE: TclCurl does not do a complete ASCII conversion when doing ASCII +transfers over FTP. This is a known limitation/flaw that nobody has +rectified. TclCurl simply sets the mode to ascii and performs a standard +transfer. +

+

-proxytransfermode + +
+If set to 1, TclCurl sets the transfer mode (binary or ASCII) for FTP transfers +done via an HTTP proxy, by appending ;type=a or ;type=i to the URL. +Without this setting, or it being set to 0, the default, -transfertext has +no effect when doing FTP via a proxy. Beware that not all proxies support this feature. +

+

-crlf + +
+Convert unix newlines to CRLF newlines on FTP transfers. +

+

-range + +
+Pass a string as parameter, which should contain the specified range you +want. It should be in the format +X-Y + +, where X or Y may be left out. HTTP +transfers also support several intervals, separated with commas as in +X-Y,N-M + +Using this kind of multiple intervals will cause the HTTP server to send the +response document in pieces (using standard MIME separation techniques). +

+Ranges only work on HTTP, FTP and FILE transfers. +

+

-resumefrom + +
+Pass the offset in number of bytes that you want the transfer to start from. +Set this option to 0 to make the transfer start from the beginning +(effectively disabling resume). +

+For FTP, set this option to -1 to make the transfer start from the end of the +target file (useful to continue an interrupted upload). +

+

-customrequest + +
+Pass a string as parameter. It will be used instead of GET or HEAD when doing +the HTTP request. This is useful for doing DELETE or other more obscure HTTP +requests. Do not do this at will, make sure your server supports the command first. +

+Note that TclCurl will still act and assume the keyword it would use if you +do not set your custom and it will act according to that. Thus, changing this +to a HEAD when TclCurl otherwise would do a GET might cause TclCurl to act funny, +and similar. To switch to a proper HEAD, use -nobody, to switch to a proper +POST, use -post or -postfields and so on. +

+

-filetime + +
+If you pass a 1, TclCurl will attempt to get the +modification date of the remote document in this operation. This requires that +the remote server sends the time or replies to a time querying command. The +getinfo procedure with the +filetime + +argument can be used after a transfer to extract the received time (if any). +

+

-nobody + +
+A 1 tells the library not to include the body-part in the +output. This is only relevant for protocols that have a separate header and +body part. On HTTP(S) servers, this will make TclCurl do a HEAD request. +

+To change request to GET, you should use httpget. Change request +to POST with post etc. +

+

-infilesize + +
+When uploading a file to a remote site, this option should be used to tell +TclCurl what the expected size of the infile is. +

+This option is mandatory for uploading using SCP. +

+

-upload + +
+A 1 tells the library to prepare for an upload. The +-infile and -infilesize options are also interesting for uploads. +If the protocol is HTTP, uploading means using the PUT request unless you tell +TclCurl otherwise. +

+Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header. +You can disable this header with -httpheader as usual. +

+If you use PUT to a HTTP 1.1 server, you can upload data without knowing the +size before starting the transfer if you use chunked encoding. You enable this +by adding a header like "Transfer-Encoding: chunked" with -httpheader. +With HTTP 1.0 or without chunked transfer, you must specify the size. +

+

-maxfilesize + +
+This allows you to specify the maximum size (in bytes) of a file to download. +If the file requested is larger than this value, the transfer will not start +and error 'filesize exceeded' (63) will be returned. +

+NOTE: The file size is not always known prior to download, and for such files +this option has no effect even if the file transfer ends up being larger than +this given limit. This concerns both FTP and HTTP transfers. +

+

-timecondition + +
+This defines how the timevalue value is treated. You can set this +parameter to ifmodsince or ifunmodsince. This feature applies to +HTTP and FTP. +

+

-timevalue + +
+This should be the time in seconds since 1 jan 1970, and the time will be +used in a condition as specified with timecondition. +

+

+

+  +

Connection options

+ +

+

+
-timeout + +
+Pass the maximum time in seconds that you allow +the TclCurl transfer operation to take. Do note that normally, name lookups +may take a considerable time and that limiting the operation to less than a +few minutes risks aborting perfectly normal operations. This option will +cause libcurl to use the SIGALRM to enable time-outing system calls. +

+In unix-like systems, this might cause signals to be used unless +-nosignal is used. +

+

-timeoutms + +
+Like timeout but takes a number of milliseconds instead. If libcurl is +built to use the standard system name resolver, that part will still use +full-second resolution for timeouts. +

+

-lowspeedlimit + +
+Pass the speed in bytes per second that the transfer should be below during +lowspeedtime + +seconds for the extension to consider it too slow and abort. +

+

-lowspeedtime + +
+Pass the time in seconds that the transfer should be below the +lowspeedlimit + +for the extension to consider it too slow and abort. +

+

-maxsendspeed + +
+Pass a speed in bytes per seconds. If an upload exceeds this speed on cumulative +average during the transfer, the transfer will pause to keep the average rate less +than or equal to the parameter value. Defaults to unlimited speed. +

+

-maxrecvspeed + +
+Pass a speed in bytes per second. If a download exceeds this speed on cumulative +average during the transfer, the transfer will pause to keep the average rate less +than or equal to the parameter value. Defaults to unlimited speed. +

+

-maxconnects + +
+Sets the persistant connection cache size in all the protocols that support +persistent conecctions. The set amount will be the maximum amount of simultaneous +connections that TclCurl may cache in this easy handle. Default is 5, and there +isn't much point in changing this value unless you are perfectly aware of how this +work and changes TclCurl's behaviour. +

+When reaching the maximum limit, TclCurl closes the oldest connection in the cache +to prevent the number of open connections to increase. +

+Note: if you have already performed transfers with this curl handle, +setting a smaller +maxconnects + +than before may cause open connections to unnecessarily get closed. +

+Note that if you add this easy handle to a multi handle, this setting is not +being acknowledged, instead you must configure the multi handle its own +maxconnects option. +

+

-connecttimeout + +
+Maximum time in seconds that you allow the +connection to the server to take. This only limits the connection phase, once +it has connected, this option is of no more use. Set to zero to disable +connection timeout (it will then only timeout on the internal timeouts). +

+In unix-like systems, this might cause signals to be used unless +-nosignal is set. +

+

-connecttimeoutms + +
+Like connecttimeout but takes a number of milliseconds instead. If libcurl +is built to use the standard system name resolver, that part will still use +full-second resolution for timeouts. +

+

-ipresolve + +
+Allows an application to select what kind of IP addresses to use when +resolving host names. This is only interesting when using host names +that resolve addresses using more than one version of IP. The allowed +values are: +
+
+
whatever + +
+Default, resolves addresses to all IP versions that your system allows. +
v4 + +
+Resolve to ipv4 addresses. +
v6 + +
+Resolve to ipv6 addresses. +
+
+ +

+

+  +

SSL and security options

+ +

+

+
-sslcert + +
+Pass a string as parameter. The string should be the file name of your certificate. +The default format is "PEM" and can be changed with -sslcerttype. +

+With NSS this is the nickname of the certificate you wish to authenticate with. +

+

-sslcerttype + +
+Pass a string as parameter. The string should be the format of your certificate. +Supported formats are "PEM" and "DER". +

+

-sslkey + +
+Pass a pointer to a zero terminated string as parameter. The string should be +the file name of your private key. The default format is "PEM" and can be +changed with -sslkeytype. +

+

-sslkeytype + +
+Pass a pointer to a zero terminated string as parameter. The string should be +the format of your private key. Supported formats are "PEM", "DER" and "ENG" +

+NOTE:The format "ENG" enables you to load the private key from a crypto +engine. in this case -sslkey is used as an identifier passed to +the engine. You have to set the crypto engine with -sslengine. The "DER" +format key file currently does not work because of a bug in OpenSSL. +

+

-keypasswd + +
+Pass a string as parameter. It will be used as the password required to use the +-sslkey or -sshprivatekeyfile private key. +

+You never need a pass phrase to load a certificate but you need one to load you +private key. +

+This option used to be known as -sslkeypasswd and -sslcertpasswd. +

+

-sslengine + +
+Pass a string as parameter. It will be used as the identifier for the crypto +engine you want to use for your private key. +

+NOTE:If the crypto device cannot be loaded, an error will be returned. +

+

-sslenginedefault + +
+Pass a 1 to set the actual crypto engine as the default for (asymmetric) crypto operations. +

+NOTE:If the crypto device cannot be set, an error will be returned. +

+

-sslversion + +
+Use it to set what version of SSL/TLS to use. The available options are: +
+
+
default + +
+The default action. This will attempt to figure out the remote SSL protocol version, +i.e. either SSLv3 or TLSv1 (but not SSLv2, which became disabled by default with 7.18.1). +
tlsv1 + +
+Force TLSv1 +
sslv2 + +
+Force SSLv2 +
sslv3 + +
+Force SSLv3 +
+
+ +

+

-sslverifypeer + +
+This option determines whether TclCurl verifies the authenticity of the peer's certificate. +A 1 means it verifies; zero means it doesn't. The default is 1. +

+When negotiating an SSL connection, the server sends a certificate indicating its identity. +TclCurl verifies whether the certificate is authentic, i.e. that you can trust that the +server is who the certificate says it is. This trust is based on a chain of digital signatures, +rooted in certification authority (CA) certificates you supply. +

+TclCurl uses a default bundle of CA certificates that comes with libcurl but you can specify +alternate certificates with the -cainfo or the -capath options. +

+When -sslverifypeer is nonzero, and the verification fails to prove that the certificate +is authentic, the connection fails. When the option is zero, the connection succeeds regardless. +

+Authenticating the certificate is not by itself very useful. You typically want to ensure +that the server, as authentically identified by its certificate, is the server you mean to +be talking to, use -sslverifyhost to control that. +

+

-cainfo + +
+Pass a file naming holding the certificate to verify the peer with. This only +makes sense when used in combination with the -sslverifypeer option, if +it is set to zero -cainfo need not even indicate an accessible file. +

+When built against NSS this is the directory that the NSS certificate database +resides in. +

+

-issuercert + +
+Pass a string naming a file holding a CA certificate in PEM format. If the option +is set, an additional check against the peer certificate is performed to verify +the issuer is indeed the one associated with the certificate provided by the option. +This additional check is useful in multi-level PKI where one need to enforce the peer +certificate is from a specific branch of the tree. +
  +This option makes sense only when used in combination with the -sslverifypeer +option. Otherwise, the result of the check is not considered as failure. +

+

-capath + +
+Pass the directory holding multiple CA certificates to verify the peer with. +The certificate directory must be prepared using the openssl c_rehash utility. +This only makes sense when used in combination with the -sslverifypeer +option, if it is set to zero, -capath need not even indicate an accessible +path. +

+This option apparently does not work in Windows due to some limitation in openssl. +

+This option is OpenSSL-specific and does nothing if libcurl is built to use GnuTLS. +

+

-crlfile + +
+Pass a string naming a file with the concatenation of CRL (in PEM format) to use in +the certificate validation that occurs during the SSL exchange. +
  +When libcurl is built to use NSS or GnuTLS, there is no way to influence the use of +CRL passed to help in the verification process. When built with OpenSSL support, +X509_V_FLAG_CRL_CHECK and X509_V_FLAG_CRL_CHECK_ALL are both set, requiring CRL +check against all the elements of the certificate chain if a CRL file is passed. +
  +This option makes sense only when used in combination with the -sslverifypeer +option. +

+

-randomfile + +
+Pass a file name. The file will be used to read from to seed the random engine +for SSL. The more random the specified file is, the more secure will the SSL +connection become. +

+

-egdsocket + +
+Pass a path name to the Entropy Gathering Daemon socket. It will be used to seed +the random engine for SSL. +

+

-sslverifyhost + +
+This option determines whether TclCurl verifies that the server claims to be +who you want it to be. +

+When negotiating an SSL connection, the server sends a certificate +indicating its identity. +

+When -sslverifyhost is set to 2, that certificate must indicate +that the server is the server to which you meant to connect, or the +connection fails. +

+TclCurl considers the server the intended one when the Common Name field +or a Subject Alternate Name field in the certificate matches the host +name in the URL to which you told Curl to connect. +

+When set to 1, the certificate must contain a Common Name field, +but it does not matter what name it says. (This is not ordinarily a +useful setting). +

+When the value is 0, the connection succeeds regardless of the names in +the certificate. +

+The default is 2. +

+This option controls the identity that the server claims. The server +could be lying. To control lying, see sslverifypeer. +

+

-sslcypherlist + +
+Pass a string holding the ciphers to use for the SSL connection. The list must +consists of one or more cipher strings separated by colons. Commas or spaces +are also acceptable separators but colons are normally used, , - and + can be +used as operators. +

+For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA', 'SHA1+DES', + +

+You will find more details about cipher lists on this URL: +
    http://www.openssl.org/docs/apps/ciphers.html +

+For NSS valid examples of cipher lists include 'rsa_rc4_128_md5', 'rsa_aes_128_sha', +etc. With NSS you don't add/remove ciphers. If you use this option then all known +ciphers are disabled and only those passed in are enabled. +
  +You'll find more details about the NSS cipher lists on this URL: +
    http://directory.fedora.redhat.com/docs/mod_nss.html +

+

-sslsessionidcache + +
+Pass a 0 to disable TclCurl's use of SSL session-ID caching or a 1 to enable it. +By default all transfers are done using the cache. Note that while nothing ever +should get hurt by attempting to reuse SSL session-IDs, there seem to be broken SSL +implementations in the wild that may require you to disable this in order for you to +succeed. +

+

-krblevel + +
+Set the kerberos security level for FTP, this also enables kerberos awareness. +This is a string, 'clear', 'safe', 'confidential' or 'private'. If the string +is set but does not match one of these, 'private' will be used. Set the string +to NULL to disable kerberos4. Set the string to "" to disable kerberos +support for FTP. +

+

+  +

SSH options

+ +

+

+
-sshauthtypes + +
+The allowed types are: +

+

+
+
publickey + +
+
password + +
+
host + +
+
keyboard + +
+
any + +
+To let TclCurl pick one +
+
+ +

+

-sshhostpublickeymd5 + +
+Pass a string containing 32 hexadecimal digits. The string should be the 128 +bit MD5 cheksum of the remote host public key, and TclCurl will reject the +connection to the host unless the md5sums match. This option is only for SCP +and SFTP transfers. +

+

-publickeyfile + +
+Pass the file name for your public key. If not used, TclCurl defaults to using ~/.ssh/id_dsa.pub. +

+

-privatekeyfile + +
+Pass the file name for your private key. If not used, TclCurl defaults to using ~/.ssh/id_dsa. +If the file is password-protected, set the password with -keypasswd. +

+

+  +

Other options

+ +

+

+
-headervar + +
+Name of the Tcl array variable where TclCurl will store the headers returned +by the server. +

+When a server sends a chunked encoded transfer, it may contain a +trailer. That trailer is identical to a HTTP header and if such a trailer is +received it is passed to the application using this callback as well. There +are several ways to detect it being a trailer and not an ordinary header: 1) +it comes after the response-body. 2) it comes after the final header line (CR +LF) 3) a Trailer: header among the response-headers mention what header to +expect in the trailer. +

+

-bodyvar + +
+Name of the Tcl variable where TclCurl will store the file requested, the file +may contain text or binary data. +

+

-canceltransvar + +
+Name of a Tcl variable, in case you have defined a procedure to call with +-progressproc setting this variable to '1' will cancel the transfer. +

+

-command + +
+Executes the given command after the transfer is done, since it only works +with blocking transfers, it is pretty much useless. +

+

-share + +
+Pass a share handle as a parameter. The share handle must have been created by +a previous call to curl::shareinit. Setting this option, will make this +handle use the data from the shared handle instead of keeping the data to itself. +See tclcurl_share for details. +

+

-newfileperms + +
+Pass a number as a parameter, containing the value of the permissions that will +be assigned to newly created files on the remote server. The default value is 0644, +but any valid value can be used. The only protocols that can use this are sftp://, +scp:// and file://. +

+

-newdirectoryperms + +
+Pass a number as a parameter, containing the value of the permissions that will be +assigned to newly created directories on the remote server. The default value is 0755, +but any valid value can be used. The only protocols that can use this are sftp://, scp:// +and file://. +

+

+  +

NOT SUPPORTED

+ +Some of the options libcurl offers are not supported, I don't think them +worth supporting in TclCurl but if you need one of them don't forget to +complain: +

+CURLOPT_FRESH_CONNECT, CURLOPT_FORBID_REUSE, CURLOPT_PRIVATE, + +CURLOPT_SSL_CTX_FUNCTION, CURLOPT_SSL_CTX_DATA, CURLOPT_SSL_CTX_FUNCTION and + +CURLOPT_CONNECT_ONLY, CURLOPT_OPENSOCKETFUNCTION, CURLOPT_OPENSOCKETDATA. + +

+  +

curlHandle perform

+ +This procedure is called after the +init + +and all the +configure + +calls are made, and will perform the transfer as described in the options. +

+It must be called with the same +curlHandle curl::init call returned. +You can do any amount of calls to perform while using the same handle. If you +intend to transfer more than one file, you are even encouraged to do +so. TclCurl will then attempt to re-use the same connection for the following +transfers, thus making the operations faster, less CPU intense and using less +network resources. Just note that you will have to use +configure + +between the invokes to set options for the following perform. +

+You must never call this procedure simultaneously from two places using the +same handle. Let it return first before invoking it another time. If +you want parallel transfers, you must use several curl handles. +

+
RETURN VALUE + +
+ +errorbuffer + +was set with +configure + +there will be a readable error message. +The error codes are: +
1
+Unsupported protocol. This build of TclCurl has no support for this protocol. +
2
+Very early initialization code failed. This is likely to be and internal error +or problem. +
3
+URL malformat. The syntax was not correct. +
5
+Couldn't resolve proxy. The given proxy host could not be resolved. +
6
+Couldn't resolve host. The given remote host was not resolved. +
7
+Failed to connect to host or proxy. +
8
+FTP weird server reply. The server sent data TclCurl couldn't parse. +The given remote server is probably not an OK FTP server. +
9
+We were denied access to the resource given in the URL. For FTP, this occurs +while trying to change to the remote directory. +
11
+FTP weird PASS reply. TclCurl couldn't parse the reply sent to the PASS request. +
13
+FTP weird PASV reply, TclCurl couldn't parse the reply sent to the PASV or EPSV +request. +
14
+FTP weird 227 format. TclCurl couldn't parse the 227-line the server sent. +
15
+FTP can't get host. Couldn't resolve the host IP we got in the 227-line. +
17
+FTP couldn't set type. Couldn't change transfer method to either binary or +ascii. +
18
+Partial file. Only a part of the file was transfered, this happens when +the server first reports an expected transfer size and then delivers data +that doesn't match the given size. +
19
+FTP couldn't RETR file, we either got a weird reply to a 'RETR' command or +a zero byte transfer. +
21
+Quote error. A custom 'QUOTE' returned error code 400 or higher (for FTP) or +otherwise indicated unsuccessful completion of the command. +
22
+HTTP returned error. This return code only appears if -failonerror is +used and the HTTP server returns an error code that is 400 or higher. +
23
+Write error. TclCurl couldn't write data to a local filesystem or an error +was returned from a write callback. +
25
+Failed upload failed. For FTP, the server typcially denied the STOR +command. The error buffer usually contains the server's explanation to this. +
26
+Read error. There was a problem reading from a local file or an error was returned +from the read callback. +
27
+Out of memory. A memory allocation request failed. This should never happen unless +something weird is going on in your computer. +
28
+Operation timeout. The specified time-out period was reached according to the +conditions. +
30
+The FTP PORT command failed, not all FTP servers support the PORT command, +try doing a transfer using PASV instead!. +
31
+FTP couldn't use REST. This command is used for resumed FTP transfers. +
33
+Range error. The server doesn't support or accept range requests. +
34
+HTTP post error. Internal post-request generation error. +
35
+SSL connect error. The SSL handshaking failed, the error buffer may have +a clue to the reason, could be certificates, passwords, ... +
36
+FTP bad download resume. Couldn't continue an earlier aborted download, probably +because you are trying to resume beyond the file size. +
37
+A file given with FILE:// couldn't be read. Did you checked the permissions? +
38
+LDAP cannot bind. LDAP bind operation failed. +
39
+LDAP search failed. +
41
+A required zlib function was not found. +
42
+Aborted by callback. An application told TclCurl to abort the operation. +
43
+Internal error. A function was called with a bad parameter. +
45
+Interface error. A specified outgoing interface could not be used. +
47
+Too many redirects. When following redirects, TclCurl hit the maximum amount, set +your limit with --maxredirs +
48
+Unknown TELNET option specified. +
49
+A telnet option string was illegally formatted. +
51
+The remote peer's SSL certificate or SSH md5 fingerprint wasn't ok +
52
+The server didn't reply anything, which here is considered an error. +
53
+The specified crypto engine wasn't found. +
54
+Failed setting the selected SSL crypto engine as default! +
55
+Failed sending network data. +
56
+Failure with receiving network data. +
58
+Problem with the local client certificate. +
59
+Couldn't use specified SSL cipher. +
60
+Peer certificate cannot be authenticated with known CA certificates. +
61
+Unrecognized transfer encoding. +
62
+Invalid LDAP URL. +
63
+Maximum file size exceeded. +
64
+SSL use failed. +
65
+Sending the data requires a rewind that failed, since TclCurl should +take care of it for you, it means you found a bug. +
66
+Failed to initialise ssl engine. +
67
+Failed to login, user password or similar was not accepted. +
68
+File not found on TFTP server. +
69
+There is a permission problem with the TFTP request. +
70
+The remote server has run out of space. +
71
+Illegal TFTP operation. +
72
+Unknown transfer ID. +
73
+TFTP file already exists and will not be overwritten. +
74
+No such user in the TFTP server and good behaving TFTP server +should never return this. +
75
+Character conversion failed. +
77
+Problem with reading the SSL CA cert (path? access rights?). +
78
+Remote file not found +
79
+Error from the SSH layer +
80
+Failed to shut down the SSL connection +
82
+Failed to load CRL file +
83
+Issuer check failed +

+

+  +

curlHandle getinfo option

+ +Request internal information from the curl session with this procedure. +This procedure is intended to get used *AFTER* a performed transfer, +and can be relied upon only if the perform returns 0. Use +this function AFTER a performed transfer if you want to get +transfer-oriented data. +

+The following information can be extracted: +

+

+
effectiveurl + +
+Returns the last used effective URL. +

+

responsecode + +
+Returns the last received HTTP or FTP code. This will be zero if no server +response code has been received. Note that a proxy's CONNECT response should +be read with httpconnectcode and not this. +

+

httpconnectcode + +
+Returns the last received proxy response code to a CONNECT request. +

+

filetime + +
+Returns the remote time of the retrieved document (in number of seconds +since 1 jan 1970 in the GMT/UTC time zone). If you get -1, +it can be because of many reasons (unknown, the server hides it or the +server doesn't support the command that tells document time etc) and the time +of the document is unknown. +

+In order for this to work you have to set the -filetime option before +the transfer. +

+

namelookuptime + +
+Returns the time, in seconds, it took from the start until the name resolving +was completed. +

+

connecttime + +
+Returns the time, in seconds, it took from the start until the connect to the +remote host (or proxy) was completed. +

+

appconnecttime + +
+Returns the time, in seconds, it took from the start until the SSL/SSH +connect/handshake to the remote host was completed. This time is most often very +near to the PRETRANSFER time, except for cases such as HTTP pippelining where the +pretransfer time can be delayed due to waits in line for the pipeline and more. +

+

pretransfertime + +
+Returns the time, in seconds, it took from the start until the file transfer +is just about to begin. This includes all pre-transfer commands and +negotiations that are specific to the particular protocol(s) involved. +

+

starttransfertime + +
+Returns the time, in seconds, it took from the start until the first byte +is just about to be transfered. This includes the pretransfertime, +and also the time the server needs to calculate the result. +

+

totaltime + +
+Returns the total transaction time, in seconds, for the previous transfer, +including name resolving, TCP connect etc. +

+

redirecturl + +
+Returns the URL a redirect would take you to if you enable followlocation. +This can come very handy if you think using the built-in libcurl redirect logic +isn't good enough for you but you would still prefer to avoid implementing all +the magic of figuring out the new URL. +

+

redirecttime + +
+Returns the total time, in seconds, it took for all redirection steps +including name lookup, connect, pretransfer and transfer before +the final transaction was started, it returns the complete execution +time for multiple redirections, so it returns zero if no redirections +were needed. +

+

redirectcount + +
+Returns the total number of redirections that were actually followed. +

+

numconnects + +
+Returns how many new connections TclCurl had to create to achieve the +previous transfer (only the successful connects are counted). Combined +with redirectcount you are able to know how many times TclCurl +successfully reused existing connection(s) or not. See the Connection +Options of setopt to see how TclCurl tries to make persistent +connections to save time. +

+

primaryip + +
+Returns the IP address of the most recent connection done with this handle. +This string may be IPv6 if that's enabled. +

+

sizeupload + +
+Returns the total amount of bytes that were uploaded. +

+

sizedownload + +
+Returns the total amount of bytes that were downloaded. The amount is only +for the latest transfer and will be reset again for each new transfer. +

+

speeddownload + +
+Returns the average download speed, measured in bytes/second, for the complete download. +

+

speedupload + +
+Returns the average upload speed, measured in bytes/second, for the complete upload. +

+

headersize + +
+Returns the total size in bytes of all the headers received. +

+

requestsize + +
+Returns the total size of the issued requests. This is so far only for HTTP +requests. Note that this may be more than one request if followLocation is true. +

+

sslverifyresult + +
+Returns the result of the certification verification that was requested +(using the -sslverifypeer option to configure). +

+

sslengines + +
+Returns a list of the OpenSSL crypto-engines supported. Note that engines are +normally implemented in separate dynamic libraries. Hence not all the returned +engines may be available at run-time. +

+

contentlengthdownload + +
+Returns the content-length of the download. This is the value read from the +Content-Length: + +field. +

+

contentlengthupload + +
+Returns the specified size of the upload. +

+

contenttype + +
+Returns the content-type of the downloaded object. This is the value +read from the Content-Type: field. If you get an empty string, it means +the server didn't send a valid Content-Type header or that the protocol +used doesn't support this. +

+

httpauthavail + +
+Returns a list with the authentication method(s) available. +

+

proxyauthavail + +
+Returns a list with the authentication method(s) available for your +proxy athentication. +

+

oserrno + +
+Returns the errno value from a connect failure. +

+

cookielist + +
+Returns a list of all cookies TclCurl knows (expired ones, too). If there +are no cookies (cookies for the handle have not been enabled or simply +none have been received) the list will be empty. +

+

ftpentrypath + +
+Returns a string holding the path of the entry path. That is the initial path +TclCurl ended up in when logging on to the remote FTP server. Returns an empty +string if something is wrong. +

+

+  +

curlHandle cleanup

+ +This procedure must be the last one to call for a curl session. It is the +opposite of the +curl::init + +procedure and must be called with the same +curlhandle + +as input as the curl::init call returned. +This will effectively close all connections TclCurl has used and possibly +has kept open until now. Don't call this procedure if you intend to transfer +more files. +

+  +

curlHandle reset

+ +

+Re-initializes all options previously set on a specified handle to the +default values. +

+This puts back the handle to the same state as it was in when it was just +created with curl::init. +

+It does not change the following information kept in the handle: live +connections, the Session ID cache, the DNS cache, the cookies and shares. +

+  +

curlHandle duphandle

+ +This procedure will return a new curl handle, a duplicate, +using all the options previously set in the input curl handle. +Both handles can subsequently be used independently and +they must both be freed with +cleanup. + +The new handle will not inherit any state information, +connections, SSL sessions or cookies. +
+
RETURN VALUE + +
+A new curl handle or an error message if the copy fails. +

+

+  +

curlHandle pause

+ +You can use this command from within a progress callback procedure +to pause the transfer. +

+  +

curlHandle resume

+ +Resumes a transfer paused with curlhandle pause +

+  +

curl::transfer

+ +In case you do not want to use persistant connections you can use this +command, it takes the same arguments as the curlHandle configure +and will init, configure, perform and cleanup a connection for you. +

+You can also get the getinfo information by using -infooption variable +pairs, after the transfer variable will contain the value that would have +been returned by $curlHandle getinfo option. +

+
RETURN VALUE + +
+The same error code perform would return. +

+

+  +

curl::version

+ +Returns a string with the version number of tclcurl, libcurl and some of +its important components (like OpenSSL version). +
+
RETURN VALUE + +
+The string with the version info. +

+

+  +

curl::escape url

+ +This procedure will convert the given input string to an URL encoded string and +return that. All input characters that are not a-z, +A-Z or 0-9 will be converted to their "URL escaped" version (%NN where NN is a +two-digit hexadecimal number) +
+
RETURN VALUE + +
+The converted string. +
+  +

curl::unescape url

+ +This procedure will convert the given URL encoded input string to a "plain +string" and return that. All input characters that +are URL encoded (%XX where XX is a two-digit hexadecimal number) will be +converted to their plain text versions. +
+
RETURN VALUE + +
+The string unencoded. +

+

+  +

curl::curlConfig option

+ +Returns some information about how you have +cURL + +installed. +

+

+
-prefix + +
+Returns the directory root where you installed +cURL + +
-feature + +
+Returns a list containing particular main features the installed +libcurl + +was built with. The list may include SSL, KRB4 or IPv6, do not +assume any particular order. +
-vernum + +
+Outputs version information about the installed libcurl, in +numerical mode. This outputs the version number, in hexadecimal, +with 8 bits for each part; major, minor, patch. So that libcurl +7.7.4 would appear as 070704 and libcurl 12.13.14 would appear as +0c0d0e... +

+

+  +

curl::versioninfo option

+ +Returns information about various run-time features in TclCurl. +

+Applications should use this information to judge if things are possible to do +or not, instead of using compile-time checks, as dynamic/DLL libraries can be +changed independent of applications. +

+

+
-version + +
+Returns the version of libcurl we are using. +

+

-versionnum + +
+Retuns the version of libcurl we are using in hexadecimal with 8 bits for each +part; major, minor, patch. So that libcurl 7.7.4 would appear as 070704 and +libcurl 12.13.14 would appear as 0c0d0e... Note that the initial zero might be +omitted. +

+

-host + +
+Returns a string with the host information as discovered by a configure +script or set by the build environment. +

+

-features + +
+Returns a list with the features compiled into libcurl, the possible elements are: +
+
+
ASYNCHDNS + +
+Libcurl was built with support for asynchronous name lookups, which allows +more exact timeouts (even on Windows) and less blocking when using the multi +interface. +
CONV + +
+Libcurl was built with support for character conversions. +
DEBUG + +
+Libcurl was built with extra debug capabilities built-in. This is mainly of +interest for libcurl hackers. +
GSSNEGOTIATE + +
+Supports HTTP GSS-Negotiate. +
IDN + +
+Supports IDNA, domain names with international letters. +
IPV6 + +
+Supports IPv6. +
KERBEROS4 + +
+Supports kerberos4 (when using FTP). +
LARGEFILE + +
+Libcurl was built with support for large files. +
LIBZ + +
+Supports HTTP deflate using libz. +
NTML + +
+Supports HTTP NTLM +
SPNEGO + +
+Libcurl was built with support for SPNEGO authentication (Simple and Protected +GSS-API Negotiation Mechanism, defined in RFC 2478) +
SSL + +
+Supports SSL (HTTPS/FTPS) +
SSPI + +
+Libcurl was built with support for SSPI. This is only available on Windows and +makes libcurl use Windows-provided functions for NTLM authentication. It also +allows libcurl to use the current user and the current user's password without +the app having to pass them on. +
+
+ +Do not assume any particular order. +

+

-sslversion + +
+Returns a string with the OpenSSL version used, like OpenSSL/0.9.6b. +

+

-sslversionnum + +
+Returns the numerical OpenSSL version value as defined by the OpenSSL project. +If libcurl has no SSL support, this is 0. +

+

-libzversion + +
+Returns a string, there is no numerical version, for example: 1.1.3. +

+

-protocols + +
+Lists what particular protocols the installed TclCurl was built to support. +At the time of writing, this list may include HTTP, HTTPS, FTP, FTPS, +FILE, TELNET, LDAP, DICT. Do not assume any particular order. The protocols +will be listed using uppercase. There may be none, one or several protocols +in the list. +

+

+  +

curl::easystrerror errorCode

+ +This procedure returns a string describing the error code passed in the argument. +

+  +

SEE ALSO

+ +curl, The art of HTTP scripting RFC 2396, + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
curl::init
+
curlHandle configure ?options?
+
Behaviour options
+
Callback options
+
Error Options
+
Network options
+
Names and Passwords options
+
HTTP options
+
FTP options
+
Protocol options
+
Connection options
+
SSL and security options
+
SSH options
+
Other options
+
NOT SUPPORTED
+
curlHandle perform
+
curlHandle getinfo option
+
curlHandle cleanup
+
curlHandle reset
+
curlHandle duphandle
+
curlHandle pause
+
curlHandle resume
+
curl::transfer
+
curl::version
+
curl::escape url
+
curl::unescape url
+
curl::curlConfig option
+
curl::versioninfo option
+
curl::easystrerror errorCode
+
SEE ALSO
+
+
+This document was created by man2html, +using the manual pages.
+ + diff --git a/doc/tclcurl.n b/doc/tclcurl.n new file mode 100644 index 0000000..cb51d82 --- /dev/null +++ b/doc/tclcurl.n @@ -0,0 +1,2078 @@ +.\" You can view this file with: +.\" nroff -man [file] +.\" Adapted from libcurl docs by fandom@telefonica.net +.TH TclCurl n "8 September 2008" "TclCurl 7.19.0 "TclCurl Easy Interface" +.SH NAME +TclCurl: - get a URL with FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE or LDAP syntax. +.SH SYNOPSIS +.BI "curl::init" +.sp +.IB curlHandle " configure " "?options?" +.sp +.IB curlHandle " perform" +.sp +.IB curlHandle " getinfo " curlinfo_option +.sp +.IB curlhandle " cleanup" +.sp +.IB curlhandle " reset" +.sp +.IB curlHandle " duhandle" +.sp +.IB curlHandle " pause" +.sp +.IB curlHandle " resume" +.sp +.BI curl::transfer " ?options?" +.sp +.BI curl::version +.sp +.BI "curl::escape " url +.sp +.BI "curl::unescape " url +.sp +.BI "curl::curlConfig " option +.sp +.BI "curl::versioninfo " option +.sp +.BI "curl::easystrerror " errorCode + +.SH DESCRIPTION +The TclCurl extension gives Tcl programmers access to the libcurl +library written by \fBDaniel Stenberg\fP, with it you can download urls, +upload them and many other neat tricks, for more information check +.I http://curl.haxx.se +.SH curl::init +This procedure must be the first one to call, it returns a +.I curlHandle +that you need to use to invoke TclCurl procedures. The init calls intializes +curl and this call MUST have a corresponding call to +.I cleanup +when the operation is completed. +You should perform all your sequential file transfers using the same +curlHandle. This enables TclCurl to use persistant connections when +possible. +.sp +.B RETURN VALUE +.sp +.I curlHandle +to use. +.SH curlHandle configure ?options? +.sp +.B configure +is called to set the options for the transfer. Most operations in TclCurl +have default actions, and by using the appropriate options you can +make them behave differently (as documented). All options are set with +the \fIoption\fP followed by a parameter. +.sp +.B Notes: +the options set with this procedure are valid for the +forthcoming data transfers that are performed when you invoke +.I perform +.sp +The options are not reset between transfers (except where noted), so if +you want subsequent transfers with different options, you must change them +between the transfers. You can optionally reset all options back to the internal +default with \fBcurlHandle reset\fP. +.sp +.I "curlHandle" +is the return code from the +.I "curl::init" +call. +.sp + +.B OPTIONS +.sp +.SH Behaviour options + +.TP +.B -verbose +Set the parameter to 1 to get the library to display a lot of verbose +information about its operations. Very useful for libcurl and/or protocol +debugging and understanding. + +You hardly ever want this set in production use, you will almost always want +this when you debug/report problems. Another neat option for debugging is +.B -debugproc + +.TP +.B -header +A 1 tells the extension to include the headers in the body output. This is +only relevant for protocols that actually have headers preceding the data (like HTTP). + +.TP +.B -noprogress +A 1 tells the extension to turn on the built-in progress meter. +Nowadays it is turn off by default. + +.TP +.B -nosignal +A 1 tells TclCurl not use any functions that install signal +handlers or any functions that cause signals to be sent to the process. This +option is mainly here to allow multi-threaded unix applications to still +set/use all timeout options etc, without risking getting signals. + + +.SH Callback options + +.TP +.B -writeproc +Use it to set a Tcl procedure that will be invoked by TclCurl as soon as +there is received data that needs to be saved. The procedure will receive +a single parameter with the data to be saved. + +NOTE: you will be passed as much data as possible in all invokes, but you +cannot possibly make any assumptions. It may be nothing if the file is +empty or it may be thousands of bytes. + +.TP +.B -file +File in which the transfered data will be saved. + +.TP +.B -readproc +Sets a Tcl procedure to be called by TclCurl as soon as it needs to read +data in order to send it to the peer. The procedure has to take one +parameter, which will contain the maximun numbers of bytes to read. It +should return the actual number of bytes read, or '0' if you want to +stop the transfer. + +.TP +.B -infile +File from which the data will be transfered. + +.TP +.B -progressproc +Name of the Tcl procedure that will invoked by TclCurl with a frequent +interval during operation (roughly once per second), no matter if data +is being transfered or not. Unknown/unused +argument values passed to the callback will be set to zero (like if you +only download data, the upload size will remain 0), the prototype of the +procedure must be: +.sp +.B proc ProgressCallback {dltotal dlnow ultotal ulnow} +.sp +In order to this option to work you have to set the \fBnoprogress\fP +option to '0'. Setting this option to the empty string will restore the +original progress function. + +If you transfer data with the multi interface, this procedure will not be +called during periods of idleness unless you call the appropriate procedure +that performs transfers. + +You can pause and resume a transfer from within this procedure using the +\fBpause\fP and \fBresume\fP commands. + +.TP +.B -writeheader +Pass a the file name to be used to write the header part of the received data to. +The headers are guaranteed to be written one-by-one to this file and +only complete lines are written. Parsing headers should be easy enough using +this. + +.TP +.B -debugproc +Name of the procedure that will receive the debug data produced by the +.B -verbose +option, it should match the following prototype: +.sp +.B debugProc {infoType data} +.sp +where \fBinfoType\fP specifies what kind of information it is (0 text, +1 incoming header, 2 outgoing header, 3 incoming data, 4 outgoing data, +5 incoming SSL data, 6 outgoing SSL data). + +.SH Error Options + +.TP +.B -errorbuffer +Pass a variable name where TclCurl may store human readable error +messages in. This may be more helpful than just the return code from the +command. + +.TP +.B -stderr +Pass a file name as parameter. This is the stream to use internally instead +of stderr when reporting errors. +.TP +.B -failonerror +A 1 parameter tells the extension to fail silently if the HTTP code +returned is equal or larger than 400. The default action would be to return +the page normally, ignoring that code. + +This method is not fail-safe and there are occasions where non-successful response +codes will slip through, especially when authentication is involved +(response codes 401 and 407). + +You might get some amounts of headers transferred before this situation is detected, +like for when a "100-continue" is received as a response to a POST/PUT and a 401 +or 407 is received immediately afterwards. + +.SH Network options + +.TP +.B -url +The actual URL to deal with. + +If the given URL lacks the protocol part ("http://" or "ftp://" etc), it will +attempt to guess which protocol to use based on the given host name. If the +given protocol of the set URL is not supported, TclCurl will return the +\fBunsupported protocol\fP error when you call \fBperform\fP. Use +\fBcurl::versioninfo\fP for detailed info on which protocols that are supported. + +\fBNOTE\fP: this the one option required to be set +before +.B perform +is called. + +.TP +.B -proxy +If you need to use a http proxy to access the outside world, set the +proxy string with this option. To specify port number in this string, +append :[port] to the end of the host name. The proxy string may be +prefixed with [protocol]:// since any such prefix will be ignored. + +When you tell the extension to use a HTTP proxy, TclCurl will +transparently convert operations to HTTP even if you specify a FTP +URL etc. This may have an impact on what other features of the library +you can use, such as +.B quote +and similar FTP specifics that will not work unless you tunnel through +the HTTP proxy. Such tunneling is activated with +.B proxytunnel + +TclCurl respects the environment variables http_proxy, ftp_proxy, +all_proxy etc, if any of those are set. The use of this option does +however override any possibly set environment variables. + +Setting the proxy string to "" (an empty string) will explicitly disable +the use of a proxy, even if there is an environment variable set for it. + +The proxy host string can be specified the exact same way as the proxy +environment variables, include protocol prefix (http://) and embedded +user + password. + +.TP +.B -proxyport +Use this option to set the proxy port to use unless it is specified in +the proxy string by \fB-proxy\fP. + +.TP +.B -proxytype +Pass the type of the proxy. Available options are 'http', 'socks4', 'socks4a' +and 'socks5', with the HTTP one being default. + +.TP +.B -httpproxytunnel +Set the parameter to 1 to get the extension to tunnel all non-HTTP +operations through the given HTTP proxy. Do note that there is a big +difference between using a proxy and tunneling through it. If you don't know what +this means, you probably don't want this tunnel option. + +.TP +.B -interface +Pass the interface name to use as outgoing +network interface. The name can be an interface name, an IP address or a host +name. + +.TP +.B -localport +This sets the local port number of the socket used for connection. This can +be used in combination with \fB-interface\fP and you are recommended to use +\fBlocalportrange\fP as well when this is set. Note the only valid port numbers +are 1 - 65535. + +.TP +.B -localportrange +This is the number of attempts TclCurl should do to find a working local port +number. It starts with the given \fB-localport\fP and adds +one to the number for each retry. Setting this value to 1 or below will make +TclCurl do only one try for exact port number. Note that port numbers by nature +are a scarce resource that will be busy at times so setting this value to something +too low might cause unnecessary connection setup failures. + +.TP +.B -dnscachetimeout +Pass the timeout in seconds. Name resolves will be kept in memory for this number +of seconds. Set to '0' to completely disable caching, or '-1' to make the +cached entries remain forever. By default, TclCurl caches this info for 60 seconds. + +.TP +.B -dnsuseglobalcache +If the value passed is 1, it tells TclCurl to use a global DNS cache that +will survive between curl handles creations and deletions. This is not thread-safe +as it uses a global varible. + +\fBWARNING:\fP this option is considered obsolete. Stop using it. Switch over +to using the share interface instead! See \fItclcurl_share\fP. + +.TP +.B -buffersize +Pass your prefered size for the receive buffer in TclCurl. The main point of this +would be that the write callback gets called more often and with smaller chunks. +This is just treated as a request, not an order. You cannot be guaranteed to +actually get the given size. + +.TP +.B -port + +Pass the number specifying what remote port to connect to, instead of the one specified +in the URL or the default port for the used protocol. + +.TP +.B -tcpnodelay + +Pass a number to specify whether the TCP_NODELAY option should be set or cleared (1 = set, 0 = clear). +The option is cleared by default. This will have no effect after the connection has been established. + +Setting this option will disable TCP's Nagle algorithm. The purpose of this algorithm is to try to +minimize the number of small packets on the network (where "small packets" means TCP segments less +than the Maximum Segment Size (MSS) for the network). + +Maximizing the amount of data sent per TCP segment is good because it amortizes the overhead of the +send. However, in some cases (most notably telnet or rlogin) small segments may need to be sent without +delay. This is less efficient than sending larger amounts of data at a time, and can contribute to +congestion on the network if overdone. + +.TP +.B -addressscope +Pass a number specifying the scope_id value to use when connecting to IPv6 link-local or site-local +addresses. + +.SH Names and Passwords options + +.TP +.B -netrc +A 1 parameter tells the extension to scan your +.B ~/.netrc +file to find user name and password for the remote site you are about to +access. Do note that TclCurl does not verify that the file has the correct +properties set (as the standard unix ftp client does), and that only machine +name, user name and password is taken into account (init macros and similar +things are not supported). + +You can set it to the following values: +.RS +.TP 5 +.B optional +The use of your ~/.netrc file is optional, and information in the URL is to +be preferred. The file will be scanned with the host and user name (to find +the password only) or with the host only, to find the first user name and +password after that machine, which ever information is not specified in +the URL. + +Undefined values of the option will have this effect. +.TP +.B ignored +The extension will ignore the file and use only the information in the URL. +This is the default. +.TP +.B required +This value tells the library that use of the file is required, to ignore +the information in the URL, and to search the file with the host only. +.RE + +.TP +.B -netrcfile +Pass a string containing the full path name to the file you want to use as .netrc +file. For the option to work, you have to set the \fBnetrc\fP option to +\fBrequired\fP. If this option is omitted, and \fBnetrc\fP is set, TclCurl +will attempt to find the a .netrc file in the current user's home directory. + +.TP +.B -userpwd +Pass a string as parameter, which should be [username]:[password] to use for +the connection. Use \fBhttpauth\fP to decide authentication method. + +When using NTLM, you can set domain by prepending it to the user name and +separating the domain and name with a forward (/) or backward slash (\\). Like +this: "domain/user:password" or "domain\\user:password". Some HTTP servers (on +Windows) support this style even for Basic authentication. + +When using HTTP and \fB-followlocation\fP, TclCurl might perform several +requests to possibly different hosts. TclCurl will only send this user and +password information to hosts using the initial host name (unless +\fB-unrestrictedauth\fP is set), so if TclCurl follows locations to other +hosts it will not send the user and password to those. This is enforced to +prevent accidental information leakage. + +.TP +.B -proxyuserpwd +Pass a string as parameter, which should be [username]:[password] to use for +the connection to the HTTP proxy. + +.TP +.B -httpauth +Set to the authentication method you want, the available ones are: +.RS +.TP 5 +.B basic +HTTP Basic authentication. This is the default choice, and the only +method that is in widespread use and supported virtually everywhere. +It sends the user name and password over the network in plain text, +easily captured by others. + +.TP +.B digest +HTTP Digest authentication. Digest authentication is a more secure +way to do authentication over public networks than the regular +old-fashioned Basic method. + +.TP +.B gssnegotiate +HTTP GSS-Negotiate authentication. The GSS-Negotiate method, also known as +plain "Negotiate",was designed by Microsoft and is used in their web +applications. It is primarily meant as a support for Kerberos5 authentication +but may be also used along with another authentication methods. + +.TP +.B ntlm +HTTP NTLM authentication. A proprietary protocol invented and used by Microsoft. +It uses a challenge-response and hash concept similar to Digest, to prevent the +password from being eavesdropped. + +.TP +.B any +TclCurl will automatically select the one it finds most secure. + +.TP +.B anysafe +It may use anything but basic, TclCurl will automaticly select the +one it finds most secure. +.RE + +.TP +.B -proxyauth +Use it to tell TclCurl which authentication method(s) you want it to use for +your proxy authentication. Note that for some methods, this will induce an +extra network round-trip. Set the actual name and password with the +\fBproxyuserpwd\fP option. + +The methods are those listed above for the \fBhttpauth\fP option. As of this +writing, only Basic and NTLM work. + +.SH HTTP options + +.TP +.B -autoreferer +Pass an 1 parameter to enable this. When enabled, TclCurl will +automatically set the Referer: field in requests where it follows a Location: +redirect. + +.TP +.B -encoding +Sets the contents of the Accept-Encoding: header sent in an HTTP +request, and enables decoding of a response when a Content-Encoding: +header is received. Three encodings are supported: \fIidentity\fP, +which does nothing, \fIdeflate\fP which requests the server to +compress its response using the zlib algorithm, and \fIgzip\fP which +requests the gzip algorithm. Use \fIall\fP to send an +Accept-Encoding: header containing all supported encodings. + +This is a request, not an order; the server may or may not do it. This +option must be set or else any unsolicited +encoding done by the server is ignored. See the special file +lib/README.encoding in libcurl docs for details. + +.TP +.B -followlocation +An 1 tells the library to follow any +.B Location: header +that the server sends as part of a HTTP header. + +\fBNOTE\fP: this means that the extension will re-send the same +request on the new location and follow new \fBLocation: headers\fP +all the way until no more such headers are returned. +\fB-maxredirs\fP can be used to limit the number of redirects +TclCurl will follow. + +.TP +.B -unrestrictedauth +An 1 parameter tells the extension it can continue +to send authentication (user+password) when following +locations, even when hostname changed. Note that this +is meaningful only when setting \fB-followlocation\fP. + +.TP +.B -maxredirs +Sets the redirection limit. If that many redirections have been followed, +the next redirect will cause an error. This option only makes sense if the +\fB-followlocation\fP option is used at the same time. Setting the limit +to 0 will make libcurl refuse any redirect. Set it to -1 for an infinite +number of redirects (which is the default) + +.TP +.B -post301 +An 1 tells TclCurl to respect RFC 2616/10.3.2 and not +convert POST requests into GET requests when following a 301 redirection. The +non-RFC behaviour is ubiquitous in web browsers, so the conversion is done +by default to maintain consistency. However, a server may require +a POST to remain a POST after such a redirection. This option is meaningful +only when setting \fB-followlocation\fP. + +.TP +.B -put +An 1 parameter tells the extension to use HTTP PUT a file. The file to put +must be set with \fB-infile\fP and \fB-infilesize\fP. + +This option is deprecated starting with version 0.12.1, you should use \fB-upload\fP. + +.TP +.B -post +An 1 parameter tells the library to do a regular HTTP post. This is a +normal application/x-www-form-urlencoded kind, which is the most commonly used +one by HTML forms. See the \fB-postfields\fP option for how to specify the +data to post and \fB-postfieldsize\fP about how to set the data size. + +Use the \fB-postfields\fP option to specify what data to post and \fB-postfieldsize\fP +to set the data size. Optionally, you can provide data to POST using the \fB-readproc\fP +options. + +You can override the default POST Content-Type: header by setting your own with +\fB-httpheader\fP. + +Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. +You can disable this header with \fB-httpheader\fP as usual. + +If you use POST to a HTTP 1.1 server, you can send data without knowing the +size before starting the POST if you use chunked encoding. You enable this +by adding a header like "Transfer-Encoding: chunked" with \fB-httpheader\fP. +With HTTP 1.0 or without chunked transfer, you must specify the size in the +request. + +When setting \fBpost\fP to an 1 value, it will automatically set +\fBnobody\fP to 0. + +NOTE: if you have issued a POST request and want to make a HEAD or GET instead, you must +explicitly pick the new request type using \fB-nobody\fP or \fB-httpget\fP or similar. + +.TP +.B -postfields +Pass a string as parameter, which should be the full data to post in a HTTP +POST operation. You must make sure that the data is formatted the way you +want the server to receive it. TclCurl will not convert or encode it for you. +Most web servers will assume this data to be url-encoded. + +This is a normal application/x-www-form-urlencoded kind, +which is the most commonly used one by HTML forms. + +If you want to do a zero-byte POST, you need to set +\fB-postfieldsize\fP explicitly to zero, as simply setting +\fB-postfields\fP to NULL or "" just effectively disables the sending +of the specified string. TclCurl will instead assume that the POST +data will be send using the read callback! + +Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. +You can disable this header with \fB-httpheader\fP as usual. + +\fBNote\fP: to make multipart/formdata posts (aka rfc1867-posts), check out +\fB-httppost\fP option. + +.TP +.B -postfieldsize +If you want to post data to the server without letting TclCurl do a strlen() +to measure the data size, this option must be used. Also, when this option is +used, you can post fully binary data which otherwise is likely to fail. If +this size is set to zero, the library will use strlen() to get the data +size. + +.TP +.B -httppost +Tells TclCurl you want a multipart/formdata HTTP POST to be made and you +instruct what data to pass on to the server through a +.B Tcl list. + +\fBThis is the only case where the data is reset after a transfer.\fP + +First, there are some basics you need to understand about multipart/formdata +posts. Each part consists of at least a \fBNAME\fP and a \fBCONTENTS\fP part. If the part +is made for file upload, there are also a stored \fBCONTENT-TYPE\fP and a +\fBFILENAME\fP. Below, we'll discuss on what options you use to set these +properties in the parts you want to add to your post. + +The list must contain a \fB'name'\fP tag with the name of the section followed +by a string with the name, there are three tags to indicate the value of +the section: \fB'value'\fP followed by a string with the data to post, \fB'file'\fP +followed by the name of the file to post and \fB'contenttype'\fP with the +type of the data (text/plain, image/jpg, ...), you can also indicate a \fIfalse\fP +file name with \fB'filename'\fP, this is useful in case the server checks if the given +file name is valid, for example, by testing if it starts with 'c:\\' as any real file +name does or if you want to include the full path of the file to post. You can also post +the content of a variable as if it were a file with the options \fB'bufferName'\fP and +\fB'buffer'\fP or use \fB'filecontent'\fP followed by a file name to read that file and +use the contents as data. + +Should you need to specify extra headers for the form POST section, use +\fB'contentheader\fP' followed by a list with the headers to post. + +Please see 'httpPost.tcl' and 'httpBufferPost.tcl' for examples. + +If TclCurl can't set the data to post an error will be returned: +.RS +.TP 5 +.B 1 +If the memory allocation fails. +.TP +.B 2 +If one option is given twice for one form. +.TP +.B 3 +If an empty string was given. +.TP +.B 4 +If an unknown option was used. +.TP +.B 5 +If the some form info is not complete (or error) +.TP +.B 6 +If an illegal option is used in an array. +.TP +.B 7 +TclCurl has no http support. +.RE + +.TP +.B -referer +Pass a string as parameter. It will be used to set the +.B referer +header in the http request sent to the remote server. This can be used to +fool servers or scripts. You can also set any custom header with +.B -httpheader. + +.TP +.B -useragent +Pass a string as parameter. It will be used to set the +.B user-agent: +header in the http request sent to the remote server. This can be used to fool +servers or scripts. You can also set any custom header with +.B -httpheader. + +.TP +.B -httpheader +Pass a +.B list +with the HTTP headers to pass to the server in your request. +If you add a header that is otherwise generated +and used by TclCurl internally, your added one will be used instead. If you +add a header with no contents as in 'Accept:', the internally used header will +just get disabled. Thus, using this option you can add new headers, replace +and remove internal headers. + +The headers included in the linked list must not be CRLF-terminated, because +TclCurl adds CRLF after each header item. Failure to comply with this will +result in strange bugs because the server will most likely ignore part of the +headers you specified. + +The first line in a request (containing the method, usually a GET or POST) is +not a header and cannot be replaced using this option. Only the lines +following the request-line are headers. Adding this method line in this list +of headers will only cause your request to send an invalid header. + +\fBNOTE\fP:The most commonly replaced headers have "shortcuts" in the options: +.B cookie, useragent, +and +.B referer. + +.TP +.B -http200aliases +Pass a list of aliases to be treated as valid HTTP 200 responses. Some servers +respond with a custom header response line. For example, IceCast servers respond +with "ICY 200 OK". By including this string in your list of aliases, the +response will be treated as a valid HTTP header line such as "HTTP/1.0 200 OK". + +\fBNOTE\fP:The alias itself is not parsed for any version strings. Before version +7.16.3, TclCurl used the value set by option \fBhttpversion\fP, but starting with +7.16.3 the protocol is assumed to match HTTP 1.0 when an alias matched. + +.TP +.B -cookie +Pass a string as parameter. It will be used to +set a cookie in the http request. The format of the string should be +'[NAME]=[CONTENTS];'. Where NAME is the cookie name and CONTENTS is +what the cookie should contain. + +If you need to set mulitple cookies, you need to set them all using +a single option and thus you need to concatenate them all in one single string. +Set multiple cookies in one string like this: "name1=content1; name2=content2;" +etc. + +Note that this option sets the cookie header explictly in the outgoing request(s). +If multiple requests are done due to authentication, followed redirections or similar, +they will all get this cookie passed on. + +Using this option multiple times will only make the latest string override +the previous ones. + +.TP +.B -cookiefile +Pass a string as parameter. It should contain the name of your file holding +cookie data. The cookie data may be in netscape cookie data format or just +regular HTTP-style headers dumped to a file. + +Given an empty or non-existing file, this option will enable cookies for this +curl handle, making it understand and parse received cookies and then use +matching cookies in future requests. + +If you use this option multiple times, you add more files to read. + +.TP +.B -cookiejar +Pass a file name in which TclCurl will dump all internally known cookies +when +.B curlHandle cleanup +is called. If no cookies are known, no file will be created. +Specify "-" to have the cookies written to stdout. + +Using this option also enables cookies for this session, so if you, for +example, follow a location it will make matching cookies get sent accordingly. + +TclCurl will not and cannot report an error for this. Using '\fBverbose\fP' +will get a warning to display, but that is the only visible feedback you get +about this possibly lethal situation. + +.TP +.B -cookiesession +Pass an 1 to mark this as a new cookie "session". It will +force TclCurl to ignore all cookies it is about to load that are "session +cookies" from the previous session. By default, TclCurl always stores and +loads all cookies, independent of whether they are session cookies are not. +Session cookies are cookies without expiry date and they are meant to be +alive and existing for this "session" only. + +.TP +.B -cookielist +Pass a string with a cookie. The cookie can be either in Netscape / Mozilla +format or just regular HTTP-style header (Set-Cookie: ...) format. If the +cookie engine was not enabled it will be enabled. Passing a +magic string "ALL" will erase all known cookies while "FLUSH" will write +all cookies known by TclCurl to the file specified by \fB-cookiejar\fP. + +.TP +.B -httpget +If set to 1 forces the HTTP request to get back to GET, usable if +POST, PUT or a custom request have been used previously with the +same handle. + +When setting \fBhttpget\fP to 1, \fBnobody\fP will automatically be set to 0. + +.TP +.B -httpversion +Set to one of the values decribed below, they force TclCurl to use the +specific http versions. It should only be used if you really MUST do +that because of a silly remote server. +.RS +.TP 5 +.B none +We do not care about what version the library uses. TclCurl will use whatever +it thinks fit. +.TP +.B 1.0 +Enforce HTTP 1.0 requests. +.TP +.B 1.1 +Enforce HTTP 1.1 requests. +.RE + +.TP +.B -ignorecontentlength +Ignore the Content-Length header. This is useful for Apache 1.x (and similar +servers) which will report incorrect content length for files over 2 +gigabytes. If this option is used, TclCurl will not be able to accurately +report progress, and will simply stop the download when the server ends the +connection. + +.TP +.B -httpcontentdecoding +Set to zero to disable content decoding. If set to 1 it is enabled. Note however +that TclCurl has no default content decoding but requires you to use \fBencoding\fP for that. + +.TP +.B -httptransferencoding +Set to zero to disable transfer decoding, if set to 1 it is enabled (default). TclCurl does +chunked transfer decoding by default unless this option is set to zero. + +.SH FTP options + +.TP +.B -ftpport +Pass a string as parameter. It will be used to +get the IP address to use for the ftp PORT instruction. The PORT instruction +tells the remote server to connect to our specified IP address. The string may +be a plain IP address, a host name, a network interface name (under unix) or +just a '-' to let the library use your systems default IP address. Default FTP +operations are passive, and thus will not use PORT. + +.TP +.B -quote +Pass a \fBlist\fP list with the FTP or SFTP commands to pass to the server prior to your +ftp request. This will be done before any other FTP commands are issued (even +before the CWD command).If you do not want to transfer any files, set +\fBnobody\fP to '1' and \fBheader\fP to '0'. + +Keep in mind the commands to send must be 'raw' ftp commands, for example, to +create a directory you need to send \fBmkd Test\fP, not \fBmkdir Test\fP. + +Valid SFTP commands are: chgrp, chmod, chown, ln, mkdir, pwd, rename, rm, +rmdir and symlink. + +.TP +.B -postquote +Pass a \fBlist\fP with the FTP commands to pass to the server after your +ftp transfer request. If you do not want to transfer any files, set +\fBnobody\fP to '1' and \fBheader\fP to '0'. + +.TP +.B -prequote +Pass a \fBlist\fP of FTP or SFTP commands to pass to the server after the +transfer type is set. + +.TP +.B -dirlistonly +A 1 tells the library to just list the names of files in a +directory, instead of doing a full directory listing that would include file +sizes, dates etc. It works with both FTP and SFTP urls. + +This causes an FTP NLST command to be sent. Beware that some FTP servers list +only files in their response to NLST, they might not include subdirectories +and symbolic links. + +.TP +.B -append +A 1 parameter tells the extension to append to the remote file instead of +overwriting it. This is only useful when uploading to a ftp site. + +.TP +.B -ftpuseeprt +Set to 1 to tell TclCurl to use the EPRT (and LPRT) command when doing +active FTP downloads (which is enabled by '\fBftpport\fP'). Using EPRT means +that it will first attempt to use EPRT and then LPRT before using PORT, if +you pass zero to this option, it will not try using EPRT or LPRT, only plain PORT. + +.TP +.B -ftpuseepvs +Set to one to tell TclCurl to use the EPSV command when doing passive FTP +downloads (which it always does by default). Using EPSV means that it will +first attempt to use EPSV before using PASV, but if you pass a zero to this +option, it will not try using EPSV, only plain PASV. + +.TP +.B -ftpcreatemissingdirs +If set to 1, TclCurl will attempt to create any remote directory that it +fails to CWD into. CWD is the command that changes working directory. + +This setting also applies to SFTP-connections. TclCurl will attempt to create +the remote directory if it can't obtain a handle to the target-location. The +creation will fail if a file of the same name as the directory to create +already exists or lack of permissions prevents creation. + +.TP +.B -ftpresponsetimeout +Causes TclCurl to set a timeout period (in seconds) on the amount of time that +the server is allowed to take in order to generate a response message for a +command before the session is considered hung. Note that while TclCurl is waiting +for a response, this value overrides \fBtimeout\fP. It is recommended that if used +in conjunction with \fBtimeout\fP, you set it to a value smaller than \fBtimeout\fP. + +.TP +.B -ftpalternativetouser +Pass a string which will be used to authenticate if the usual FTP "USER user" and +"PASS password" negotiation fails. This is currently only known to be required when +connecting to Tumbleweed's Secure Transport FTPS server using client certificates for +authentication. + +.TP +.B -ftpskippasvip +If set to 1, it instructs TclCurl not to use the IP address the +server suggests in its 227-response to TclCurl's PASV command when TclCurl +connects the data connection. Instead TclCurl will re-use the same IP address +it already uses for the control connection. But it will use the port number +from the 227-response. + +This option has no effect if PORT, EPRT or EPSV is used instead of PASV. + +.TP +.B -usessl +You can use ftps:// URLs to explicitly switch on SSL/TSL for the control +connection and the data connection. + +Alternatively, and what seems to be the recommended way, you can set the +option to one of these values: + +.RS +.TP 5 +.B nope +Do not attempt to use SSL +.TP +.B try +Try using SSL, proceed anyway otherwise. +.TP +.B control +Use SSL for the control conecction or fail with "use ssl failed" (64). +.TP +.B all +Use SSL for all communication or fail with "use ssl failed" (64). +.RE + +.TP +.B -ftpsslauth + +Pass TclCurl one of the values from below, to alter how TclCurl issues +"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see \fB-ftpssl\fP). + +You may need this option because of servers like BSDFTPD-SSL from +http://bsdftpd-ssl.sc.ru/ "which won't work properly when "AUTH SSL" is issued +(although the server responds fine and everything) but requires "AUTH TLS" +instead". + +.RS +.TP 5 +.B default +Allows TclCurl to decide. +.TP +.B ssl +Try "AUTH SSL" first, and only if that fails try "AUTH TLS". +.TP +.B tls +Try "AUTH TLS" first, and only if that fails try "AUTH SSL". +.RE + +.TP +.B -ftpsslccc +Set it to make TclCurl use CCC (Clear Command Channel). It shuts down the +SSL/TLS layer after authenticating. The rest of the control channel +communication will be unencrypted. This allows NAT routers to follow the +FTP transaction. Possible values are: + +.RS +.TP 5 +.B none +Do not attempt to use CCC. +.TP +.B passive +Do not initiate the shutdown, wait for the server to do it. Do not send a reply. +.TP +.B active +Initiate the shutdown and wait for a reply. +.RE + +.TP +.B -ftpaccount +Pass string (or "" to disable). When an FTP server asks for "account data" after +user name and password has been provided, this data is sent off using the ACCT +command. + +.TP +.B -ftpfilemethod +It allows three values: +.RS +.TP 5 +.B multicwd +The default, TclCurl will do a single CWD operation for each path part in the given +URL. For deep hierarchies this means very many commands. This is how RFC1738 says it +should be done. +.TP +.B nocwd +No CWD at all is done, TclCurl will do SIZE, RETR, STOR, etc and give a full path to +the server. +.TP +.B singlecwd +Make one CWD with the full target directory and then operate on the file "normally". +This is somewhat more standards compliant than 'nocwd' but without the full penalty of 'multicwd'. +.RE + +.SH Protocol options + +.TP +.B -transfertext +A 1 tells the extension to use ASCII mode for ftp transfers, +instead of the default binary transfer. For win32 systems it does not set the +stdout to binary mode. This option can be usable when transferring text data +between systems with different views on certain characters, such as newlines +or similar. + +\fBNOTE:\fP TclCurl does not do a complete ASCII conversion when doing ASCII +transfers over FTP. This is a known limitation/flaw that nobody has +rectified. TclCurl simply sets the mode to ascii and performs a standard +transfer. + +.TP +.B -proxytransfermode +If set to 1, TclCurl sets the transfer mode (binary or ASCII) for FTP transfers +done via an HTTP proxy, by appending ;type=a or ;type=i to the URL. +Without this setting, or it being set to 0, the default, \fB-transfertext\fP has +no effect when doing FTP via a proxy. Beware that not all proxies support this feature. + +.TP +.B -crlf +Convert unix newlines to CRLF newlines on FTP transfers. + +.TP +.B -range +Pass a string as parameter, which should contain the specified range you +want. It should be in the format +.I "X-Y" +, where X or Y may be left out. HTTP +transfers also support several intervals, separated with commas as in +.I "X-Y,N-M" +Using this kind of multiple intervals will cause the HTTP server to send the +response document in pieces (using standard MIME separation techniques). + +Ranges only work on HTTP, FTP and FILE transfers. + +.TP +.B -resumefrom +Pass the offset in number of bytes that you want the transfer to start from. +Set this option to 0 to make the transfer start from the beginning +(effectively disabling resume). + +For FTP, set this option to -1 to make the transfer start from the end of the +target file (useful to continue an interrupted upload). + +.TP +.B -customrequest +Pass a string as parameter. It will be used instead of GET or HEAD when doing +the HTTP request. This is useful for doing DELETE or other more obscure HTTP +requests. Do not do this at will, make sure your server supports the command first. + +Note that TclCurl will still act and assume the keyword it would use if you +do not set your custom and it will act according to that. Thus, changing this +to a HEAD when TclCurl otherwise would do a GET might cause TclCurl to act funny, +and similar. To switch to a proper HEAD, use \fB-nobody\fP, to switch to a proper +POST, use \fB-post\fP or \fB-postfields\fP and so on. + +.TP +.B -filetime +If you pass a 1, TclCurl will attempt to get the +modification date of the remote document in this operation. This requires that +the remote server sends the time or replies to a time querying command. The +getinfo procedure with the +.I filetime +argument can be used after a transfer to extract the received time (if any). + +.TP +.B -nobody +A 1 tells the library not to include the body-part in the +output. This is only relevant for protocols that have a separate header and +body part. On HTTP(S) servers, this will make TclCurl do a HEAD request. + +To change request to GET, you should use \fBhttpget\fP. Change request +to POST with \fBpost\fP etc. + +.TP +.B -infilesize +When uploading a file to a remote site, this option should be used to tell +TclCurl what the expected size of the infile is. + +This option is mandatory for uploading using SCP. + +.TP +.B -upload +A 1 tells the library to prepare for an upload. The +\fB-infile\fP and \fB-infilesize\fP options are also interesting for uploads. +If the protocol is HTTP, uploading means using the PUT request unless you tell +TclCurl otherwise. + +Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header. +You can disable this header with \fB-httpheader\fP as usual. + +If you use PUT to a HTTP 1.1 server, you can upload data without knowing the +size before starting the transfer if you use chunked encoding. You enable this +by adding a header like "Transfer-Encoding: chunked" with \fB-httpheader\fP. +With HTTP 1.0 or without chunked transfer, you must specify the size. + +.TP +.B -maxfilesize +This allows you to specify the maximum size (in bytes) of a file to download. +If the file requested is larger than this value, the transfer will not start +and error 'filesize exceeded' (63) will be returned. + +NOTE: The file size is not always known prior to download, and for such files +this option has no effect even if the file transfer ends up being larger than +this given limit. This concerns both FTP and HTTP transfers. + +.TP +.B -timecondition +This defines how the \fBtimevalue\fP value is treated. You can set this +parameter to \fBifmodsince\fP or \fBifunmodsince\fP. This feature applies to +HTTP and FTP. + +.TP +.B -timevalue +This should be the time in seconds since 1 jan 1970, and the time will be +used in a condition as specified with \fBtimecondition\fP. + + +.SH Connection options + +.TP +.B -timeout +Pass the maximum time in seconds that you allow +the TclCurl transfer operation to take. Do note that normally, name lookups +may take a considerable time and that limiting the operation to less than a +few minutes risks aborting perfectly normal operations. This option will +cause libcurl to use the SIGALRM to enable time-outing system calls. + +In unix-like systems, this might cause signals to be used unless +\fB-nosignal\fP is used. + +.TP +.B -timeoutms +Like \fBtimeout\fP but takes a number of milliseconds instead. If libcurl is +built to use the standard system name resolver, that part will still use +full-second resolution for timeouts. + +.TP +.B -lowspeedlimit +Pass the speed in bytes per second that the transfer should be below during +.B lowspeedtime +seconds for the extension to consider it too slow and abort. + +.TP +.B -lowspeedtime +Pass the time in seconds that the transfer should be below the +.B lowspeedlimit +for the extension to consider it too slow and abort. + +.TP +.B -maxsendspeed +Pass a speed in bytes per seconds. If an upload exceeds this speed on cumulative +average during the transfer, the transfer will pause to keep the average rate less +than or equal to the parameter value. Defaults to unlimited speed. + +.TP +.B -maxrecvspeed +Pass a speed in bytes per second. If a download exceeds this speed on cumulative +average during the transfer, the transfer will pause to keep the average rate less +than or equal to the parameter value. Defaults to unlimited speed. + +.TP +.B -maxconnects +Sets the persistant connection cache size in all the protocols that support +persistent conecctions. The set amount will be the maximum amount of simultaneous +connections that TclCurl may cache in this easy handle. Default is 5, and there +isn't much point in changing this value unless you are perfectly aware of how this +work and changes TclCurl's behaviour. + +When reaching the maximum limit, TclCurl closes the oldest connection in the cache +to prevent the number of open connections to increase. + +\fBNote\fP: if you have already performed transfers with this curl handle, +setting a smaller +.B maxconnects +than before may cause open connections to unnecessarily get closed. + +\fBNote\fP that if you add this easy handle to a multi handle, this setting is not +being acknowledged, instead you must configure the multi handle its own +\fBmaxconnects\fP option. + +.TP +.B -connecttimeout +Maximum time in seconds that you allow the +connection to the server to take. This only limits the connection phase, once +it has connected, this option is of no more use. Set to zero to disable +connection timeout (it will then only timeout on the internal timeouts). + +In unix-like systems, this might cause signals to be used unless +\fB-nosignal\fP is set. + +.TP +.B -connecttimeoutms +Like \fBconnecttimeout\fP but takes a number of milliseconds instead. If libcurl +is built to use the standard system name resolver, that part will still use +full-second resolution for timeouts. + +.TP +.B -ipresolve +Allows an application to select what kind of IP addresses to use when +resolving host names. This is only interesting when using host names +that resolve addresses using more than one version of IP. The allowed +values are: +.RS +.TP 5 +.B whatever +Default, resolves addresses to all IP versions that your system allows. +.TP +.B v4 +Resolve to ipv4 addresses. +.TP +.B v6 +Resolve to ipv6 addresses. +.RE + +.SH SSL and security options + +.TP +.B -sslcert +Pass a string as parameter. The string should be the file name of your certificate. +The default format is "PEM" and can be changed with \fB-sslcerttype\fP. + +With NSS this is the nickname of the certificate you wish to authenticate with. + +.TP +.B -sslcerttype +Pass a string as parameter. The string should be the format of your certificate. +Supported formats are "PEM" and "DER". + +.TP +.B -sslkey +Pass a pointer to a zero terminated string as parameter. The string should be +the file name of your private key. The default format is "PEM" and can be +changed with \fB-sslkeytype\fP. + +.TP +.B -sslkeytype +Pass a pointer to a zero terminated string as parameter. The string should be +the format of your private key. Supported formats are "PEM", "DER" and "ENG" + +\fBNOTE:\fPThe format "ENG" enables you to load the private key from a crypto +engine. in this case \fB-sslkey\fP is used as an identifier passed to +the engine. You have to set the crypto engine with \fB-sslengine\fP. The "DER" +format key file currently does not work because of a bug in OpenSSL. + +.TP +.B -keypasswd +Pass a string as parameter. It will be used as the password required to use the +\fB-sslkey\fP or \fB-sshprivatekeyfile\fP private key. + +You never need a pass phrase to load a certificate but you need one to load you +private key. + +This option used to be known as \fB-sslkeypasswd\fP and \fB-sslcertpasswd\fP. + +.TP +.B -sslengine +Pass a string as parameter. It will be used as the identifier for the crypto +engine you want to use for your private key. + +\fBNOTE:\fPIf the crypto device cannot be loaded, an error will be returned. + +.TP +.B -sslenginedefault +Pass a 1 to set the actual crypto engine as the default for (asymmetric) crypto operations. + +\fBNOTE:\fPIf the crypto device cannot be set, an error will be returned. + +.TP +.B -sslversion +Use it to set what version of SSL/TLS to use. The available options are: +.RS +.TP 5 +.B default +The default action. This will attempt to figure out the remote SSL protocol version, +i.e. either SSLv3 or TLSv1 (but not SSLv2, which became disabled by default with 7.18.1). +.TP +.B tlsv1 +Force TLSv1 +.TP +.B sslv2 +Force SSLv2 +.TP +.B sslv3 +Force SSLv3 +.RE + +.TP +.B -sslverifypeer +This option determines whether TclCurl verifies the authenticity of the peer's certificate. +A 1 means it verifies; zero means it doesn't. The default is 1. + +When negotiating an SSL connection, the server sends a certificate indicating its identity. +TclCurl verifies whether the certificate is authentic, i.e. that you can trust that the +server is who the certificate says it is. This trust is based on a chain of digital signatures, +rooted in certification authority (CA) certificates you supply. + +TclCurl uses a default bundle of CA certificates that comes with libcurl but you can specify +alternate certificates with the \fB-cainfo\fP or the \fB-capath\fP options. + +When \fB-sslverifypeer\fP is nonzero, and the verification fails to prove that the certificate +is authentic, the connection fails. When the option is zero, the connection succeeds regardless. + +Authenticating the certificate is not by itself very useful. You typically want to ensure +that the server, as authentically identified by its certificate, is the server you mean to +be talking to, use \fB-sslverifyhost\fP to control that. + +.TP +.B -cainfo +Pass a file naming holding the certificate to verify the peer with. This only +makes sense when used in combination with the \fB-sslverifypeer\fP option, if +it is set to zero \fB-cainfo\fP need not even indicate an accessible file. + +When built against NSS this is the directory that the NSS certificate database +resides in. + +.TP +.B -issuercert +Pass a string naming a file holding a CA certificate in PEM format. If the option +is set, an additional check against the peer certificate is performed to verify +the issuer is indeed the one associated with the certificate provided by the option. +This additional check is useful in multi-level PKI where one need to enforce the peer +certificate is from a specific branch of the tree. + +This option makes sense only when used in combination with the \fB-sslverifypeer\fP +option. Otherwise, the result of the check is not considered as failure. + +.TP +.B -capath +Pass the directory holding multiple CA certificates to verify the peer with. +The certificate directory must be prepared using the openssl c_rehash utility. +This only makes sense when used in combination with the \fB-sslverifypeer\fP +option, if it is set to zero, \fB-capath\fP need not even indicate an accessible +path. + +This option apparently does not work in Windows due to some limitation in openssl. + +This option is OpenSSL-specific and does nothing if libcurl is built to use GnuTLS. + +.TP +.B -crlfile +Pass a string naming a file with the concatenation of CRL (in PEM format) to use in +the certificate validation that occurs during the SSL exchange. + +When libcurl is built to use NSS or GnuTLS, there is no way to influence the use of +CRL passed to help in the verification process. When built with OpenSSL support, +X509_V_FLAG_CRL_CHECK and X509_V_FLAG_CRL_CHECK_ALL are both set, requiring CRL +check against all the elements of the certificate chain if a CRL file is passed. + +This option makes sense only when used in combination with the \fB-sslverifypeer\fP +option. + +.TP +.B -randomfile +Pass a file name. The file will be used to read from to seed the random engine +for SSL. The more random the specified file is, the more secure will the SSL +connection become. + +.TP +.B -egdsocket +Pass a path name to the Entropy Gathering Daemon socket. It will be used to seed +the random engine for SSL. + +.TP +.B -sslverifyhost +This option determines whether TclCurl verifies that the server claims to be +who you want it to be. + +When negotiating an SSL connection, the server sends a certificate +indicating its identity. + +When \fB-sslverifyhost\fP is set to 2, that certificate must indicate +that the server is the server to which you meant to connect, or the +connection fails. + +TclCurl considers the server the intended one when the Common Name field +or a Subject Alternate Name field in the certificate matches the host +name in the URL to which you told Curl to connect. + +When set to 1, the certificate must contain a Common Name field, +but it does not matter what name it says. (This is not ordinarily a +useful setting). + +When the value is 0, the connection succeeds regardless of the names in +the certificate. + +The default is 2. + +This option controls the identity that the server \fIclaims\fP. The server +could be lying. To control lying, see \fBsslverifypeer\fP. + +.TP +.B -sslcypherlist +Pass a string holding the ciphers to use for the SSL connection. The list must +consists of one or more cipher strings separated by colons. Commas or spaces +are also acceptable separators but colons are normally used, , - and + can be +used as operators. + +For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA', 'SHA1+DES', +'TLSv1' and 'DEFAULT'. The default list is normally set when you compile OpenSSL. + +You will find more details about cipher lists on this URL: + http://www.openssl.org/docs/apps/ciphers.html + +For NSS valid examples of cipher lists include 'rsa_rc4_128_md5', 'rsa_aes_128_sha', +etc. With NSS you don't add/remove ciphers. If you use this option then all known +ciphers are disabled and only those passed in are enabled. + +You'll find more details about the NSS cipher lists on this URL: + http://directory.fedora.redhat.com/docs/mod_nss.html + +.TP +.B -sslsessionidcache +Pass a 0 to disable TclCurl's use of SSL session-ID caching or a 1 to enable it. +By default all transfers are done using the cache. Note that while nothing ever +should get hurt by attempting to reuse SSL session-IDs, there seem to be broken SSL +implementations in the wild that may require you to disable this in order for you to +succeed. + +.TP +.B -krblevel +Set the kerberos security level for FTP, this also enables kerberos awareness. +This is a string, 'clear', 'safe', 'confidential' or 'private'. If the string +is set but does not match one of these, 'private' will be used. Set the string +to NULL to disable kerberos4. Set the string to "" to disable kerberos +support for FTP. + +.SH SSH options + +.TP +.B -sshauthtypes +The allowed types are: + +.RS +.TP 5 +.B publickey +.TP +.B password +.TP +.B host +.TP +.B keyboard +.TP +.B any +To let TclCurl pick one +.RE + +.TP +.B -sshhostpublickeymd5 +Pass a string containing 32 hexadecimal digits. The string should be the 128 +bit MD5 cheksum of the remote host public key, and TclCurl will reject the +connection to the host unless the md5sums match. This option is only for SCP +and SFTP transfers. + +.TP +.B -publickeyfile +Pass the file name for your public key. If not used, TclCurl defaults to using \fB~/.ssh/id_dsa.pub\fP. + +.TP +.B -privatekeyfile +Pass the file name for your private key. If not used, TclCurl defaults to using \fB~/.ssh/id_dsa\fP. +If the file is password-protected, set the password with \fB-keypasswd\fP. + +.SH Other options + +.TP +.B -headervar +Name of the Tcl array variable where TclCurl will store the headers returned +by the server. + +When a server sends a chunked encoded transfer, it may contain a +trailer. That trailer is identical to a HTTP header and if such a trailer is +received it is passed to the application using this callback as well. There +are several ways to detect it being a trailer and not an ordinary header: 1) +it comes after the response-body. 2) it comes after the final header line (CR +LF) 3) a Trailer: header among the response-headers mention what header to +expect in the trailer. + +.TP +.B -bodyvar +Name of the Tcl variable where TclCurl will store the file requested, the file +may contain text or binary data. + +.TP +.B -canceltransvar +Name of a Tcl variable, in case you have defined a procedure to call with +\fB-progressproc\fP setting this variable to '1' will cancel the transfer. + +.TP +.B -command +Executes the given command after the transfer is done, since it only works +with blocking transfers, it is pretty much useless. + +.TP +.B -share +Pass a share handle as a parameter. The share handle must have been created by +a previous call to \fBcurl::shareinit\fP. Setting this option, will make this +handle use the data from the shared handle instead of keeping the data to itself. +See \fItclcurl_share\fP for details. + +.TP +.B -newfileperms +Pass a number as a parameter, containing the value of the permissions that will +be assigned to newly created files on the remote server. The default value is 0644, +but any valid value can be used. The only protocols that can use this are sftp://, +scp:// and file://. + +.TP +.B -newdirectoryperms +Pass a number as a parameter, containing the value of the permissions that will be +assigned to newly created directories on the remote server. The default value is 0755, +but any valid value can be used. The only protocols that can use this are sftp://, scp:// +and file://. + +.SH NOT SUPPORTED +Some of the options libcurl offers are not supported, I don't think them +worth supporting in TclCurl but if you need one of them don't forget to +complain: +.sp +.B CURLOPT_FRESH_CONNECT, CURLOPT_FORBID_REUSE, CURLOPT_PRIVATE, +.B CURLOPT_SSL_CTX_FUNCTION, CURLOPT_SSL_CTX_DATA, CURLOPT_SSL_CTX_FUNCTION and +.B CURLOPT_CONNECT_ONLY, CURLOPT_OPENSOCKETFUNCTION, CURLOPT_OPENSOCKETDATA. + +.SH curlHandle perform +This procedure is called after the +.B init +and all the +.B configure +calls are made, and will perform the transfer as described in the options. +.sp +It must be called with the same +\fIcurlHandle\fP \fBcurl::init\fP call returned. +You can do any amount of calls to perform while using the same handle. If you +intend to transfer more than one file, you are even encouraged to do +so. TclCurl will then attempt to re-use the same connection for the following +transfers, thus making the operations faster, less CPU intense and using less +network resources. Just note that you will have to use +.I configure +between the invokes to set options for the following perform. +.sp +You must never call this procedure simultaneously from two places using the +same handle. Let it return first before invoking it another time. If +you want parallel transfers, you must use several curl handles. +.TP +.B RETURN VALUE +'0' if all went well, non-zero if it didn't. In case of error, if the +.I errorbuffer +was set with +.I configure +there will be a readable error message. +The error codes are: +.IP 1 +Unsupported protocol. This build of TclCurl has no support for this protocol. +.IP 2 +Very early initialization code failed. This is likely to be and internal error +or problem. +.IP 3 +URL malformat. The syntax was not correct. +.IP 5 +Couldn't resolve proxy. The given proxy host could not be resolved. +.IP 6 +Couldn't resolve host. The given remote host was not resolved. +.IP 7 +Failed to connect to host or proxy. +.IP 8 +FTP weird server reply. The server sent data TclCurl couldn't parse. +The given remote server is probably not an OK FTP server. +.IP 9 +We were denied access to the resource given in the URL. For FTP, this occurs +while trying to change to the remote directory. +.IP 11 +FTP weird PASS reply. TclCurl couldn't parse the reply sent to the PASS request. +.IP 13 +FTP weird PASV reply, TclCurl couldn't parse the reply sent to the PASV or EPSV +request. +.IP 14 +FTP weird 227 format. TclCurl couldn't parse the 227-line the server sent. +.IP 15 +FTP can't get host. Couldn't resolve the host IP we got in the 227-line. +.IP 17 +FTP couldn't set type. Couldn't change transfer method to either binary or +ascii. +.IP 18 +Partial file. Only a part of the file was transfered, this happens when +the server first reports an expected transfer size and then delivers data +that doesn't match the given size. +.IP 19 +FTP couldn't RETR file, we either got a weird reply to a 'RETR' command or +a zero byte transfer. +.IP 21 +Quote error. A custom 'QUOTE' returned error code 400 or higher (for FTP) or +otherwise indicated unsuccessful completion of the command. +.IP 22 +HTTP returned error. This return code only appears if \fB-failonerror\fP is +used and the HTTP server returns an error code that is 400 or higher. +.IP 23 +Write error. TclCurl couldn't write data to a local filesystem or an error +was returned from a write callback. +.IP 25 +Failed upload failed. For FTP, the server typcially denied the STOR +command. The error buffer usually contains the server's explanation to this. +.IP 26 +Read error. There was a problem reading from a local file or an error was returned +from the read callback. +.IP 27 +Out of memory. A memory allocation request failed. This should never happen unless +something weird is going on in your computer. +.IP 28 +Operation timeout. The specified time-out period was reached according to the +conditions. +.IP 30 +The FTP PORT command failed, not all FTP servers support the PORT command, +try doing a transfer using PASV instead!. +.IP 31 +FTP couldn't use REST. This command is used for resumed FTP transfers. +.IP 33 +Range error. The server doesn't support or accept range requests. +.IP 34 +HTTP post error. Internal post-request generation error. +.IP 35 +SSL connect error. The SSL handshaking failed, the error buffer may have +a clue to the reason, could be certificates, passwords, ... +.IP 36 +FTP bad download resume. Couldn't continue an earlier aborted download, probably +because you are trying to resume beyond the file size. +.IP 37 +A file given with FILE:// couldn't be read. Did you checked the permissions? +.IP 38 +LDAP cannot bind. LDAP bind operation failed. +.IP 39 +LDAP search failed. +.IP 41 +A required zlib function was not found. +.IP 42 +Aborted by callback. An application told TclCurl to abort the operation. +.IP 43 +Internal error. A function was called with a bad parameter. +.IP 45 +Interface error. A specified outgoing interface could not be used. +.IP 47 +Too many redirects. When following redirects, TclCurl hit the maximum amount, set +your limit with --maxredirs +.IP 48 +Unknown TELNET option specified. +.IP 49 +A telnet option string was illegally formatted. +.IP 51 +The remote peer's SSL certificate or SSH md5 fingerprint wasn't ok +.IP 52 +The server didn't reply anything, which here is considered an error. +.IP 53 +The specified crypto engine wasn't found. +.IP 54 +Failed setting the selected SSL crypto engine as default! +.IP 55 +Failed sending network data. +.IP 56 +Failure with receiving network data. +.IP 58 +Problem with the local client certificate. +.IP 59 +Couldn't use specified SSL cipher. +.IP 60 +Peer certificate cannot be authenticated with known CA certificates. +.IP 61 +Unrecognized transfer encoding. +.IP 62 +Invalid LDAP URL. +.IP 63 +Maximum file size exceeded. +.IP 64 +SSL use failed. +.IP 65 +Sending the data requires a rewind that failed, since TclCurl should +take care of it for you, it means you found a bug. +.IP 66 +Failed to initialise ssl engine. +.IP 67 +Failed to login, user password or similar was not accepted. +.IP 68 +File not found on TFTP server. +.IP 69 +There is a permission problem with the TFTP request. +.IP 70 +The remote server has run out of space. +.IP 71 +Illegal TFTP operation. +.IP 72 +Unknown transfer ID. +.IP 73 +TFTP file already exists and will not be overwritten. +.IP 74 +No such user in the TFTP server and good behaving TFTP server +should never return this. +.IP 75 +Character conversion failed. +.IP 77 +Problem with reading the SSL CA cert (path? access rights?). +.IP 78 +Remote file not found +.IP 79 +Error from the SSH layer +.IP 80 +Failed to shut down the SSL connection +.IP 82 +Failed to load CRL file +.IP 83 +Issuer check failed + +.SH curlHandle getinfo option +Request internal information from the curl session with this procedure. +This procedure is intended to get used *AFTER* a performed transfer, +and can be relied upon only if the \fBperform\fP returns 0. Use +this function AFTER a performed transfer if you want to get +transfer-oriented data. + +The following information can be extracted: + +.TP +.B effectiveurl +Returns the last used effective URL. + +.TP +.B responsecode +Returns the last received HTTP or FTP code. This will be zero if no server +response code has been received. Note that a proxy's CONNECT response should +be read with \fBhttpconnectcode\fP and not this. + +.TP +.B httpconnectcode +Returns the last received proxy response code to a CONNECT request. + +.TP +.B filetime +Returns the remote time of the retrieved document (in number of seconds +since 1 jan 1970 in the GMT/UTC time zone). If you get -1, +it can be because of many reasons (unknown, the server hides it or the +server doesn't support the command that tells document time etc) and the time +of the document is unknown. +.sp +In order for this to work you have to set the \fB-filetime\fP option before +the transfer. + +.TP +.B namelookuptime +Returns the time, in seconds, it took from the start until the name resolving +was completed. + +.TP +.B connecttime +Returns the time, in seconds, it took from the start until the connect to the +remote host (or proxy) was completed. + +.TP +.B appconnecttime +Returns the time, in seconds, it took from the start until the SSL/SSH +connect/handshake to the remote host was completed. This time is most often very +near to the PRETRANSFER time, except for cases such as HTTP pippelining where the +pretransfer time can be delayed due to waits in line for the pipeline and more. + +.TP +.B pretransfertime +Returns the time, in seconds, it took from the start until the file transfer +is just about to begin. This includes all pre-transfer commands and +negotiations that are specific to the particular protocol(s) involved. + +.TP +.B starttransfertime +Returns the time, in seconds, it took from the start until the first byte +is just about to be transfered. This includes the \fBpretransfertime\fP, +and also the time the server needs to calculate the result. + +.TP +.B totaltime +Returns the total transaction time, in seconds, for the previous transfer, +including name resolving, TCP connect etc. + +.TP +.B redirecturl +Returns the URL a redirect would take you to if you enable \fBfollowlocation\fP. +This can come very handy if you think using the built-in libcurl redirect logic +isn't good enough for you but you would still prefer to avoid implementing all +the magic of figuring out the new URL. + +.TP +.B redirecttime +Returns the total time, in seconds, it took for all redirection steps +including name lookup, connect, pretransfer and transfer before +the final transaction was started, it returns the complete execution +time for multiple redirections, so it returns zero if no redirections +were needed. + +.TP +.B redirectcount +Returns the total number of redirections that were actually followed. + +.TP +.B numconnects +Returns how many new connections TclCurl had to create to achieve the +previous transfer (only the successful connects are counted). Combined +with \fBredirectcount\fP you are able to know how many times TclCurl +successfully reused existing connection(s) or not. See the Connection +Options of \fBsetopt\fP to see how TclCurl tries to make persistent +connections to save time. + +.TP +.B primaryip +Returns the IP address of the most recent connection done with this handle. +This string may be IPv6 if that's enabled. + +.TP +.B sizeupload +Returns the total amount of bytes that were uploaded. + +.TP +.B sizedownload +Returns the total amount of bytes that were downloaded. The amount is only +for the latest transfer and will be reset again for each new transfer. + +.TP +.B speeddownload +Returns the average download speed, measured in bytes/second, for the complete download. + +.TP +.B speedupload +Returns the average upload speed, measured in bytes/second, for the complete upload. + +.TP +.B headersize +Returns the total size in bytes of all the headers received. + +.TP +.B requestsize +Returns the total size of the issued requests. This is so far only for HTTP +requests. Note that this may be more than one request if followLocation is true. + +.TP +.B sslverifyresult +Returns the result of the certification verification that was requested +(using the -sslverifypeer option to configure). + +.TP +.B sslengines +Returns a \fBlist\fP of the OpenSSL crypto-engines supported. Note that engines are +normally implemented in separate dynamic libraries. Hence not all the returned +engines may be available at run-time. + +.TP +.B contentlengthdownload +Returns the content-length of the download. This is the value read from the +.B Content-Length: +field. + +.TP +.B contentlengthupload +Returns the specified size of the upload. + +.TP +.B contenttype +Returns the content-type of the downloaded object. This is the value +read from the Content-Type: field. If you get an empty string, it means +the server didn't send a valid Content-Type header or that the protocol +used doesn't support this. + +.TP +.B httpauthavail +Returns a list with the authentication method(s) available. + +.TP +.B proxyauthavail +Returns a list with the authentication method(s) available for your +proxy athentication. + +.TP +.B oserrno +Returns the errno value from a connect failure. + +.TP +.B cookielist +Returns a list of all cookies TclCurl knows (expired ones, too). If there +are no cookies (cookies for the handle have not been enabled or simply +none have been received) the list will be empty. + +.TP +.B ftpentrypath +Returns a string holding the path of the entry path. That is the initial path +TclCurl ended up in when logging on to the remote FTP server. Returns an empty +string if something is wrong. + +.SH curlHandle cleanup +This procedure must be the last one to call for a curl session. It is the +opposite of the +.I curl::init +procedure and must be called with the same +.I curlhandle +as input as the curl::init call returned. +This will effectively close all connections TclCurl has used and possibly +has kept open until now. Don't call this procedure if you intend to transfer +more files. + +.SH curlHandle reset + +Re-initializes all options previously set on a specified handle to the +default values. + +This puts back the handle to the same state as it was in when it was just +created with curl::init. + +It does not change the following information kept in the handle: live +connections, the Session ID cache, the DNS cache, the cookies and shares. + +.SH curlHandle duphandle +This procedure will return a new curl handle, a duplicate, +using all the options previously set in the input curl handle. +Both handles can subsequently be used independently and +they must both be freed with +.B cleanup. +The new handle will not inherit any state information, +connections, SSL sessions or cookies. +.TP +.B RETURN VALUE +A new curl handle or an error message if the copy fails. + +.SH curlHandle pause +You can use this command from within a progress callback procedure +to pause the transfer. + +.SH curlHandle resume +Resumes a transfer paused with \fBcurlhandle pause\fP + +.SH curl::transfer +In case you do not want to use persistant connections you can use this +command, it takes the same arguments as the \fIcurlHandle\fP \fBconfigure\fP +and will init, configure, perform and cleanup a connection for you. + +You can also get the \fIgetinfo\fP information by using \fI-infooption variable\fP +pairs, after the transfer \fIvariable\fP will contain the value that would have +been returned by \fI$curlHandle getinfo option\fP. +.TP +.B RETURN VALUE +The same error code \fBperform\fP would return. + +.SH curl::version +Returns a string with the version number of tclcurl, libcurl and some of +its important components (like OpenSSL version). +.TP +.B RETURN VALUE +The string with the version info. + +.SH curl::escape url +This procedure will convert the given input string to an URL encoded string and +return that. All input characters that are not a-z, +A-Z or 0-9 will be converted to their "URL escaped" version (%NN where NN is a +two-digit hexadecimal number) +.TP +.B RETURN VALUE +The converted string. +.SH curl::unescape url +This procedure will convert the given URL encoded input string to a "plain +string" and return that. All input characters that +are URL encoded (%XX where XX is a two-digit hexadecimal number) will be +converted to their plain text versions. +.TP +.B RETURN VALUE +The string unencoded. + +.SH curl::curlConfig option +Returns some information about how you have +.B cURL +installed. + +.TP +.B -prefix +Returns the directory root where you installed +.B cURL +.TP +.B -feature +Returns a list containing particular main features the installed +.B libcurl +was built with. The list may include SSL, KRB4 or IPv6, do not +assume any particular order. +.TP +.B -vernum +Outputs version information about the installed libcurl, in +numerical mode. This outputs the version number, in hexadecimal, +with 8 bits for each part; major, minor, patch. So that libcurl +7.7.4 would appear as 070704 and libcurl 12.13.14 would appear as +0c0d0e... + +.SH curl::versioninfo option +Returns information about various run-time features in TclCurl. + +Applications should use this information to judge if things are possible to do +or not, instead of using compile-time checks, as dynamic/DLL libraries can be +changed independent of applications. + +.TP +.B -version +Returns the version of libcurl we are using. + +.TP +.B -versionnum +Retuns the version of libcurl we are using in hexadecimal with 8 bits for each +part; major, minor, patch. So that libcurl 7.7.4 would appear as 070704 and +libcurl 12.13.14 would appear as 0c0d0e... Note that the initial zero might be +omitted. + +.TP +.B -host +Returns a string with the host information as discovered by a configure +script or set by the build environment. + +.TP +.B -features +Returns a list with the features compiled into libcurl, the possible elements are: +.RS +.TP 5 +.B ASYNCHDNS +Libcurl was built with support for asynchronous name lookups, which allows +more exact timeouts (even on Windows) and less blocking when using the multi +interface. +.TP +.B CONV +Libcurl was built with support for character conversions. +.TP +.B DEBUG +Libcurl was built with extra debug capabilities built-in. This is mainly of +interest for libcurl hackers. +.TP +.B GSSNEGOTIATE +Supports HTTP GSS-Negotiate. +.TP +.B IDN +Supports IDNA, domain names with international letters. +.TP +.B IPV6 +Supports IPv6. +.TP +.B KERBEROS4 +Supports kerberos4 (when using FTP). +.TP +.B LARGEFILE +Libcurl was built with support for large files. +.TP +.B LIBZ +Supports HTTP deflate using libz. +.TP +.B NTML +Supports HTTP NTLM +.TP +.B SPNEGO +Libcurl was built with support for SPNEGO authentication (Simple and Protected +GSS-API Negotiation Mechanism, defined in RFC 2478) +.TP +.B SSL +Supports SSL (HTTPS/FTPS) +.TP +.B SSPI +Libcurl was built with support for SSPI. This is only available on Windows and +makes libcurl use Windows-provided functions for NTLM authentication. It also +allows libcurl to use the current user and the current user's password without +the app having to pass them on. +.RE +Do not assume any particular order. + +.TP +.B -sslversion +Returns a string with the OpenSSL version used, like OpenSSL/0.9.6b. + +.TP +.B -sslversionnum +Returns the numerical OpenSSL version value as defined by the OpenSSL project. +If libcurl has no SSL support, this is 0. + +.TP +.B -libzversion +Returns a string, there is no numerical version, for example: 1.1.3. + +.TP +.B -protocols +Lists what particular protocols the installed TclCurl was built to support. +At the time of writing, this list may include HTTP, HTTPS, FTP, FTPS, +FILE, TELNET, LDAP, DICT. Do not assume any particular order. The protocols +will be listed using uppercase. There may be none, one or several protocols +in the list. + +.SH curl::easystrerror errorCode +This procedure returns a string describing the error code passed in the argument. + +.SH "SEE ALSO" +.I curl, The art of HTTP scripting (at http://curl.haxx.se), RFC 2396, diff --git a/doc/tclcurl_multi.html b/doc/tclcurl_multi.html new file mode 100755 index 0000000..09c82f6 --- /dev/null +++ b/doc/tclcurl_multi.html @@ -0,0 +1,319 @@ +Manpage of TclCurl + +

TclCurl

+Section: TclCurl Multi Interface (n)
Updated: 8 September 2008

+ +  +

NAME

+ +TclCurl: - get a URL with FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE or LDAP syntax. +  +

SYNOPSIS

+ +curl::multiinit + +

+multiHandle addhandle + +

+multiHandle removehandle + +

+multiHandle configure + +

+multiHandle perform + +

+multiHandle active + +

+multiHandle getinfo + +

+multihandle cleanup + +

+multihandle auto + +

+curl::multistrerror errorCode + +

+  +

DESCRIPTION

+ +TclCurl's multi interface introduces several new abilities that the easy +interface refuses to offer. They are mainly: +
    +
  • Enable a "pull" interface. The application that uses TclCurl decides where +and when to get/send data.

    +
  • Enable multiple simultaneous transfers in the same thread without making it +complicated for the application.

    +
  • Keep Tk GUIs 'alive' while transfers are taking place.

    +
+

+ +  +

Blocking

+ +A few areas in the code are still using blocking code, even when used from the +multi interface. While we certainly want and intend for these to get fixed in +the future, you should be aware of the following current restrictions: +
    +
  • Name resolves on non-windows unless c-ares is used. + +
  • GnuTLS SSL connections. + +
  • Active FTP connections. + +
  • HTTP proxy CONNECT operations. + +
  • SCP and SFTP connections. + +
  • SFTP transfers. + +
  • TFTP transfers + +
  • file:// transfers. +
+ +

+  +

curl::multiinit

+ +This procedure must be the first one to call, it returns a multiHandle +that you need to use to invoke TclCurl procedures. The init MUST have a +corresponding call to cleanup when the operation is completed. +

+RETURN VALUE + +

+multiHandle + +to use. +

+  +

multiHandle addhandle ?easyHandle?

+ +

+Each single transfer is built up with an 'easy' handle, the kind we have been +using so far with TclCurl, you must create them and setup the appropriate +options for each of them. Then we add them to the 'multi stack' using the +addhandle command. +

+If the easy handle is not set to use a shared or global DNS cache, it will be made +to use the DNS cache that is shared between all easy handles within the multi handle. +

+When an easy handle has been added to a multi stack, you can not and you must not use +perform on that handle! +

+

+multiHandle + +is the return code from the curl::multiinit call. +

+RETURN VALUE + +The possible return values are: +

+
-1
+Handle added to the multi stack, please call +perform + +soon +
0
+Handle added ok. +
1
+Invalid multi handle. +
2
+Invalid 'easy' handle. It could mean that it isn't an easy handle at all, or possibly that +the handle already is in used by this or another multi handle. +
3
+Out of memory, you should never get this. +
4
+You found a bug in TclCurl. +

+

+  +

multiHandle removehandle ?easyHandle?

+ +

+When a transfer is done or if we want to stop a transfer before it is completed, +we can use the removehandle command. Once removed from the multi handle, +we can again use other easy interface functions on it. +

+Please note that when a single transfer is completed, the easy handle is still +left added to the multi stack. You need to remove it and then close or, possibly, +set new options to it and add it again to the multi handle to start another transfer. +

+

+RETURN VALUE + +The possible return values are: +

+
0
+Handle removed ok. +
1
+Invalid multi handle. +
2
+Invalid 'easy' handle. +
3
+Out of memory, you should never get this. +
4
+You found a bug in TclCurl. +

+

+  +

multiHandle configure

+ +So far the only option is: +
+
-pipelining + +
+Pass a 1 to enable or 0 to disable. Enabling pipelining on a multi handle will +make it attempt to perform HTTP Pipelining as far as possible for transfers using +this handle. This means that if you add a second request that can use an already +existing connection, the second request will be "piped" on the same connection +rather than being executed in parallel. +
-maxconnects + +
+Pass a number which will be used as the maximum amount of simultaneously open +connections that TclCurl may cache. Default is 10, and TclCurl will enlarge +the size for each added easy handle to make it fit 4 times the number of added +easy handles. +

+By setting this option, you can prevent the cache size to grow beyond the limit +set by you. When the cache is full, curl closes the oldest one in the cache to +prevent the number of open connections to increase. +

+This option is for the multi handle's use only, when using the easy interface you should instead use it's own maxconnects option. +

+

+  +

multiHandle perform

+ +Adding the easy handles to the multi stack does not start any transfer. +Remember that one of the main ideas with this interface is to let your +application drive. You drive the transfers by invoking +perform. + +TclCurl will then transfer data if there is anything available to transfer. +It'll use the callbacks and everything else we have setup in the individual +easy handles. It'll transfer data on all current transfers in the multi stack +that are ready to transfer anything. It may be all, it may be none. +

+When you call perform and the amount of Irunning handles is +changed from the previous call (or is less than the amount of easy handles +you added to the multi handle), you know that there is one or more +transfers less "running". You can then call getinfo to +get information about each individual completed transfer. +

+RETURN VALUE + +If everything goes well, it returns the number of running handles, '0' if all +are done. In case of error, it will return the error code. +

+  +

multiHandle active

+ +In order to know if any of the easy handles are ready to transfer data before +invoking +perform + +you can use the +active + +command, it will return the number of transfers currently active. +

+RETURN VALUE + +The number of active transfers or '-1' in case of error. +

+  +

multiHandle getinfo

+ +This procedure returns very simple information about the transfers, you +can get more detail information using the getinfo +command on each of the easy handles. +

+

+RETURN VALUE + +A list with the following elements: +

+
easyHandle about which the info is about.
+
state of the transfer, '1' if it is done.
+
exit code of the transfer, '0' if there was no error,...
+
Number of messages still in the info queue.
+
In case there are no messages in the queue it will return {"" 0 0 0}.
+

+

+  +

multiHandle cleanup

+ +This procedure must be the last one to call for a multi stack, it is the opposite of the +curl::multiinit + +procedure and must be called with the same +multiHandle + +as input as the +curl::multiinit + +call returned. +

+  +

multiHandle auto ?-command command?

+ +Using this command Tcl's event loop will take care of periodically invoking perform +for you, before using it, you must have already added at least one easy handle to +the multi handle. +

+The command option allows you to specify a command to invoke after all the easy +handles have finished their transfers, even though I say it is an option, the truth is +you must use this command to cleanup all the handles, otherwise the transfered files +may not be complete. +

+This support is still in a very experimental state, it may still change without warning. +Any and all comments are welcome. +

+You can find a couple of examples at tests/multi. +

+  +

curl::multistrerror errorCode

+ +This procedure returns a string describing the error code passed in the argument. +

+  +

SEE ALSO

+ +tclcurl, curl. + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
Blocking
+
curl::multiinit
+
multiHandle addhandle ?easyHandle?
+
multiHandle removehandle ?easyHandle?
+
multiHandle configure
+
multiHandle perform
+
multiHandle active
+
multiHandle getinfo
+
multiHandle cleanup
+
multiHandle auto ?-command command?
+
curl::multistrerror errorCode
+
SEE ALSO
+
+
+This document was created by man2html, using the manual pages.
+ + diff --git a/doc/tclcurl_multi.n b/doc/tclcurl_multi.n new file mode 100644 index 0000000..933d00d --- /dev/null +++ b/doc/tclcurl_multi.n @@ -0,0 +1,226 @@ +.\" You can view this file with: +.\" nroff -man [file] +.\" Adapted from libcurl docs by fandom@telefonica.net +.TH TclCurl n "8 September 2008" "TclCurl 7.19.0" "TclCurl Multi Interface" +.SH NAME +TclCurl: - get a URL with FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE or LDAP syntax. +.SH SYNOPSIS +.BI "curl::multiinit" +.sp +.IB multiHandle " addhandle" +.sp +.IB multiHandle " removehandle" +.sp +.IB multiHandle " configure" +.sp +.IB multiHandle " perform" +.sp +.IB multiHandle " active" +.sp +.IB multiHandle " getinfo " +.sp +.IB multihandle " cleanup" +.sp +.IB multihandle " auto" +.sp +.BI "curl::multistrerror " errorCode +.sp +.SH DESCRIPTION +TclCurl's multi interface introduces several new abilities that the easy +interface refuses to offer. They are mainly: +.TP +Enable a "pull" interface. The application that uses TclCurl decides where and when to get/send data. +.TP +Enable multiple simultaneous transfers in the same thread without making it complicated for the application. +.TP +Keep Tk GUIs 'alive' while transfers are taking place. + +.SH Blocking +A few areas in the code are still using blocking code, even when used from the +multi interface. While we certainly want and intend for these to get fixed in +the future, you should be aware of the following current restrictions: +.RS +.TP 5 +.B Name resolves on non-windows unless c-ares is used. +.TP +.B GnuTLS SSL connections. +.TP +.B Active FTP connections. +.TP +.B HTTP proxy CONNECT operations. +.TP +.B TFTP transfers +.TP +.B file:// transfers. +.RE + +.SH curl::multiinit +This procedure must be the first one to call, it returns a \fImultiHandle\fP +that you need to use to invoke TclCurl procedures. The init MUST have a +corresponding call to \fIcleanup\fP when the operation is completed. +.sp +.B RETURN VALUE +.sp +.I multiHandle +to use. +.sp +.SH multiHandle addhandle ?easyHandle? +.sp +Each single transfer is built up with an 'easy' handle, the kind we have been +using so far with TclCurl, you must create them and setup the appropriate +options for each of them. Then we add them to the 'multi stack' using the +\fIaddhandle\fP command. + +If the easy handle is not set to use a shared or global DNS cache, it will be made +to use the DNS cache that is shared between all easy handles within the multi handle. + +When an easy handle has been added to a multi stack, you can not and you must not use +\fIperform\fP on that handle! + +.sp +.I "multiHandle" +is the return code from the \fIcurl::multiinit\fP call. +.sp +.B RETURN VALUE +The possible return values are: +.IP -1 +Handle added to the multi stack, please call +.I perform +soon +.IP 0 +Handle added ok. +.IP 1 +Invalid multi handle. +.IP 2 +Invalid 'easy' handle. It could mean that it isn't an easy handle at all, or possibly that +the handle already is in used by this or another multi handle. +.IP 3 +Out of memory, you should never get this. +.IP 4 +You found a bug in TclCurl. +.sp +.SH multiHandle removehandle ?easyHandle? +.sp +When a transfer is done or if we want to stop a transfer before it is completed, +we can use the \fIremovehandle\fP command. Once removed from the multi handle, +we can again use other easy interface functions on it. + +Please note that when a single transfer is completed, the easy handle is still +left added to the multi stack. You need to remove it and then close or, possibly, +set new options to it and add it again to the multi handle to start another transfer. + +.sp +.B RETURN VALUE +The possible return values are: +.IP 0 +Handle removed ok. +.IP 1 +Invalid multi handle. +.IP 2 +Invalid 'easy' handle. +.IP 3 +Out of memory, you should never get this. +.IP 4 +You found a bug in TclCurl. +.sp +.SH multiHandle configure +So far the only option is: +.TP +.B -pipelining +Pass a 1 to enable or 0 to disable. Enabling pipelining on a multi handle will +make it attempt to perform HTTP Pipelining as far as possible for transfers using +this handle. This means that if you add a second request that can use an already +existing connection, the second request will be "piped" on the same connection +rather than being executed in parallel. +.TP +.B -maxconnects +Pass a number which will be used as the maximum amount of simultaneously open +connections that TclCurl may cache. Default is 10, and TclCurl will enlarge +the size for each added easy handle to make it fit 4 times the number of added +easy handles. + +By setting this option, you can prevent the cache size to grow beyond the limit +set by you. When the cache is full, curl closes the oldest one in the cache to +prevent the number of open connections to increase. + +This option is for the multi handle's use only, when using the easy interface you should instead use it's own \fBmaxconnects\fP option. +.sp +.SH multiHandle perform +Adding the easy handles to the multi stack does not start any transfer. +Remember that one of the main ideas with this interface is to let your +application drive. You drive the transfers by invoking +.I perform. +TclCurl will then transfer data if there is anything available to transfer. +It'll use the callbacks and everything else we have setup in the individual +easy handles. It'll transfer data on all current transfers in the multi stack +that are ready to transfer anything. It may be all, it may be none. + +When you call \fBperform\fP and the amount of Irunning handles is +changed from the previous call (or is less than the amount of easy handles +you added to the multi handle), you know that there is one or more +transfers less "running". You can then call \fIgetinfo\fP to +get information about each individual completed transfer. +.sp +.B RETURN VALUE +If everything goes well, it returns the number of running handles, '0' if all +are done. In case of error, it will return the error code. +.sp +.SH multiHandle active +In order to know if any of the easy handles are ready to transfer data before +invoking +.I perform +you can use the +.I active +command, it will return the number of transfers currently active. +.sp +.B RETURN VALUE +The number of active transfers or '-1' in case of error. + +.SH multiHandle getinfo +This procedure returns very simple information about the transfers, you +can get more detail information using the \fIgetinfo\fP +command on each of the easy handles. + +.sp +.B RETURN VALUE +A list with the following elements: +.TP +easyHandle about which the info is about. +.TP +state of the transfer, '1' if it is done. +.TP +exit code of the transfer, '0' if there was no error,... +.TP +Number of messages still in the info queue. +.TP +In case there are no messages in the queue it will return {"" 0 0 0}. + +.SH multiHandle cleanup +This procedure must be the last one to call for a multi stack, it is the opposite of the +.I curl::multiinit +procedure and must be called with the same +.I multiHandle +as input as the +.B curl::multiinit +call returned. + +.SH multiHandle auto ?-command \fIcommand\fP? +Using this command Tcl's event loop will take care of periodically invoking \fBperform\fP +for you, before using it, you must have already added at least one easy handle to +the multi handle. + +The \fBcommand\fP option allows you to specify a command to invoke after all the easy +handles have finished their transfers, even though I say it is an option, the truth is +you must use this command to cleanup all the handles, otherwise the transfered files +may not be complete. + +This support is still in a very experimental state, it may still change without warning. +Any and all comments are welcome. + +You can find a couple of examples at \fBtests/multi\fP. + +.SH curl::multistrerror errorCode +This procedure returns a string describing the error code passed in the argument. + +.SH "SEE ALSO" +.I tclcurl, curl. diff --git a/doc/tclcurl_share.html b/doc/tclcurl_share.html new file mode 100755 index 0000000..d3336ea --- /dev/null +++ b/doc/tclcurl_share.html @@ -0,0 +1,111 @@ +Manpage of TclCurl + +

TclCurl

+Section: TclCurl share data api (n)
Updated: 8 September 2008

+ +  +

NAME

+TclCurl: - get a URL with FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE or LDAP syntax. +  +

SYNOPSIS

+ +curl::shareinit + +

+shareHandle share ?data? + +

+shareHandle unshare ?data? + +

+shareHandle cleanup + +

+curl::sharestrerror errorCode + +

+

+  +

DESCRIPTION

+ +

+With the share API, you can have two or more 'easy' handles sharing data +among them, so far they can only share cookies and DNS data. +

+  +

curl::shareinit

+ +This procedure must be the first one to call, it returns a shareHandle +that you need to use to share data among handles using the -share option +to the configure command. The init MUST have a corresponding call to +cleanup when the operation is completed. +

+RETURN VALUE + +

+shareHandle to use. +

+  +

shareHandle share ?data?

+ +

+The parameter specifies a type of data that should be shared. This may be set +to one of the values described below: +

+

+
+
cookies + +
+Cookie data will be shared across the easy handles using this shared object. +

+

dns + +
+Cached DNS hosts will be shared across the easy handles using this shared object. +
+
+ +

+  +

shareHandle unshare ?data?

+ +This command does the opposite of share. The specified parameter will no +longer be shared. Valid values are the same as those for share. +

+  +

sharehandle cleanup

+ +

+Deletes a shared object. The share handle cannot be used anymore after this +function has been called. +

+  +

curl::sharestrerror errorCode

+ +Returns a string describing the error code passed in the argument. +

+  +

SEE ALSO

+ +curl, TclCurl + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
curl::shareinit
+
shareHandle share ?data?
+
shareHandle unshare ?data?
+
sharehandle cleanup
+
curl::sharestrerror errorCode
+
SEE ALSO
+
+
+This document was created by man2html, using the manual pages.
+ + diff --git a/doc/tclcurl_share.n b/doc/tclcurl_share.n new file mode 100644 index 0000000..5bedf8b --- /dev/null +++ b/doc/tclcurl_share.n @@ -0,0 +1,64 @@ +.\" You can view this file with: +.\" nroff -man [file] +.\" Adapted from libcurl docs by fandom@telefonica.net +.TH TclCurl n "8 September 2008" "TclCurl 7.19.0" "TclCurl share data api" +.SH NAME +TclCurl: - get a URL with FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE or LDAP syntax. +.SH SYNOPSIS +.BI "curl::shareinit" +.sp +.IB shareHandle " share " "?data?" +.sp +.IB shareHandle " unshare " "?data?" +.sp +.IB shareHandle " cleanup" +.sp +.BI "curl::sharestrerror " errorCode + + +.SH DESCRIPTION + +With the share API, you can have two or more 'easy' handles sharing data +among them, so far they can only share cookies and DNS data. + +.SH curl::shareinit +This procedure must be the first one to call, it returns a \fBshareHandle\fP +that you need to use to share data among handles using the \fB-share\fP option +to the \fBconfigure\fP command. The init MUST have a corresponding call to +\fBcleanup\fP when the operation is completed. + +.B RETURN VALUE +.sp +\fBshareHandle\fP to use. + +.SH shareHandle share ?data? + +The parameter specifies a type of data that should be shared. This may be set +to one of the values described below: + +.RS +.TP 5 +.B cookies +Cookie data will be shared across the easy handles using this shared object. + +.TP +.B dns +Cached DNS hosts will be shared across the easy handles using this shared object. +Note that when you use the multi interface, all easy handles added to the same multi +handle will share DNS cache by default without this having to be used! +.RE + +.SH shareHandle unshare ?data? +This command does the opposite of \fBshare\fP. The specified parameter will no +longer be shared. Valid values are the same as those for \fBshare\fP. + +.SH sharehandle cleanup + +Deletes a shared object. The share handle cannot be used anymore after this +function has been called. + +.SH curl::sharestrerror errorCode +Returns a string describing the error code passed in the argument. + +.SH "SEE ALSO" +.I curl, TclCurl diff --git a/generic/multi.c b/generic/multi.c new file mode 100755 index 0000000..c3dc202 --- /dev/null +++ b/generic/multi.c @@ -0,0 +1,905 @@ +/* + * multi.c -- + * + * Implementation of the part of the TclCurl extension that deals with libcurl's + * 'multi' interface. + * + * Copyright (c)2002-2009 Andres Garcia Garcia. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + */ + +#include "multi.h" +#include + +/* + *---------------------------------------------------------------------- + * + * Tclcurl_MultiInit -- + * + * This procedure initializes the 'multi' part of the package + * + * Results: + * A standard Tcl result. + * + *---------------------------------------------------------------------- + */ + +int +Tclcurl_MultiInit (Tcl_Interp *interp) { + + Tcl_CreateObjCommand (interp,"::curl::multiinit",curlInitMultiObjCmd, + (ClientData)NULL,(Tcl_CmdDeleteProc *)NULL); + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlCreateMultiObjCmd -- + * + * Looks for the first free handle (mcurl1, mcurl2,...) and creates a + * Tcl command for it. + * + * Results: + * A string with the name of the handle, don't forget to free it. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ + +char * +curlCreateMultiObjCmd (Tcl_Interp *interp,struct curlMultiObjData *curlMultiData) { + char *handleName; + int i; + Tcl_CmdInfo info; + Tcl_Command cmdToken; + + /* We try with mcurl1, if it already exists with mcurl2, ... */ + handleName=(char *)Tcl_Alloc(10); + for (i=1;;i++) { + sprintf(handleName,"mcurl%d",i); + if (!Tcl_GetCommandInfo(interp,handleName,&info)) { + cmdToken=Tcl_CreateObjCommand(interp,handleName,curlMultiObjCmd, + (ClientData)curlMultiData, + (Tcl_CmdDeleteProc *)curlMultiDeleteCmd); + break; + } + } + + curlMultiData->token=cmdToken; + + return handleName; +} + +/* + *---------------------------------------------------------------------- + * + * curlInitMultiObjCmd -- + * + * This procedure is invoked to process the "curl::multiInit" Tcl command. + * See the user documentation for details on what it does. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ + +int +curlInitMultiObjCmd (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]) { + + + Tcl_Obj *result; + struct curlMultiObjData *curlMultiData; + char *multiHandleName; + + curlMultiData=(struct curlMultiObjData *)Tcl_Alloc(sizeof(struct curlMultiObjData)); + if (curlMultiData==NULL) { + result=Tcl_NewStringObj("Couldn't allocate memory",-1); + Tcl_SetObjResult(interp,result); + return TCL_ERROR; + } + + memset(curlMultiData, 0, sizeof(struct curlMultiObjData)); + curlMultiData->interp=interp; + + curlMultiData->mcurl=curl_multi_init(); + + if (curlMultiData->mcurl==NULL) { + result=Tcl_NewStringObj("Couldn't open curl multi handle",-1); + Tcl_SetObjResult(interp,result); + return TCL_ERROR; + } + + multiHandleName=curlCreateMultiObjCmd(interp,curlMultiData); + + result=Tcl_NewStringObj(multiHandleName,-1); + Tcl_SetObjResult(interp,result); + Tcl_Free(multiHandleName); + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlMultiObjCmd -- + * + * This procedure is invoked to process the "multi curl" commands. + * See the user documentation for details on what it does. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ +int +curlMultiObjCmd (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]) { + + struct curlMultiObjData *curlMultiData=(struct curlMultiObjData *)clientData; + CURLMcode errorCode; + int tableIndex; + + if (objc<2) { + Tcl_WrongNumArgs(interp,1,objv,"option arg ?arg?"); + return TCL_ERROR; + } + if (Tcl_GetIndexFromObj(interp, objv[1], multiCommandTable, "option", + TCL_EXACT,&tableIndex)==TCL_ERROR) { + return TCL_ERROR; + } + switch(tableIndex) { + case 0: +/* fprintf(stdout,"Multi add handle\n"); */ + errorCode=curlAddMultiHandle(interp,curlMultiData->mcurl,objv[2]); + return curlReturnCURLMcode(interp,errorCode); + break; + case 1: +/* fprintf(stdout,"Multi remove handle\n"); */ + errorCode=curlRemoveMultiHandle(interp,curlMultiData->mcurl,objv[2]); + return curlReturnCURLMcode(interp,errorCode); + break; + case 2: +/* fprintf(stdout,"Multi perform\n"); */ + errorCode=curlMultiPerform(interp,curlMultiData->mcurl); + return errorCode; + break; + case 3: +/* fprintf(stdout,"Multi cleanup\n"); */ + Tcl_DeleteCommandFromToken(interp,curlMultiData->token); + break; + case 4: +/* fprintf(stdout,"Multi getInfo\n"); */ + curlMultiGetInfo(interp,curlMultiData->mcurl); + break; + case 5: +/* fprintf(stdout,"Multi activeTransfers\n"); */ + curlMultiActiveTransfers(interp,curlMultiData); + break; + case 6: +/* fprintf(stdout,"Multi auto transfer\n");*/ + curlMultiAutoTransfer(interp,curlMultiData,objc,objv); + break; + case 7: +/* fprintf(stdout,"Multi configure\n");*/ + curlMultiConfigTransfer(interp,curlMultiData,objc,objv); + break; + } + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlAddMultiHandle -- + * + * Adds an 'easy' curl handle to the stack of a 'multi' handle. + * + * Parameter: + * interp: Pointer to the interpreter we are using. + * curlMultiHandle: The handle into which we will add the easy one. + * objvPtr: The Tcl object with the name of the easy handle. + * + * Results: + * '0' all went well. + * 'non-zero' in case of error. + *---------------------------------------------------------------------- + */ +CURLMcode +curlAddMultiHandle(Tcl_Interp *interp,CURLM *curlMultiHandlePtr + ,Tcl_Obj *objvPtr) { + + struct curlObjData *curlDataPtr; + CURLMcode errorCode; + + + curlDataPtr=curlGetEasyHandle(interp,objvPtr); + + if (curlOpenFiles(interp,curlDataPtr)) { + return TCL_ERROR; + } + if (curlSetPostData(interp,curlDataPtr)) { + return TCL_ERROR; + } + + errorCode=curl_multi_add_handle(curlMultiHandlePtr,curlDataPtr->curl); + + curlEasyHandleListAdd(curlMultiHandlePtr,curlDataPtr->curl + ,Tcl_GetString(objvPtr)); + + return errorCode; +} + +/* + *---------------------------------------------------------------------- + * + * curlRemoveMultiHandle -- + * + * Removes an 'easy' curl handle to the stack of a 'multi' handle. + * + * Parameter: + * interp: Pointer to the interpreter we are using. + * curlMultiHandle: The handle into which we will add the easy one. + * objvPtr: The Tcl object with the name of the easy handle. + * + * Results: + * '0' all went well. + * 'non-zero' in case of error. + *---------------------------------------------------------------------- + */ +CURLMcode +curlRemoveMultiHandle(Tcl_Interp *interp,CURLM *curlMultiHandle + ,Tcl_Obj *objvPtr) { + struct curlObjData *curlDataPtr; + CURLMcode errorCode; + + curlDataPtr=curlGetEasyHandle(interp,objvPtr); + errorCode=curl_multi_remove_handle(curlMultiHandle,curlDataPtr->curl); + curlEasyHandleListRemove(curlMultiHandle,curlDataPtr->curl); + + curlCloseFiles(curlDataPtr); + curlResetPostData(curlDataPtr); + + if (curlDataPtr->bodyVarName) { + curlSetBodyVarName(interp,curlDataPtr); + } + + return errorCode; +} + +/* + *---------------------------------------------------------------------- + * + * curlMultiPerform -- + * + * Invokes the 'curl_multi_perform' function to update the current + * transfers. + * + * Parameter: + * interp: Pointer to the interpreter we are using. + * curlMultiHandle: The handle of the transfer to update. + * objvPtr: The Tcl object with the name of the easy handle. + * + * Results: + Usual Tcl result. + *---------------------------------------------------------------------- + */ +int +curlMultiPerform(Tcl_Interp *interp,CURLM *curlMultiHandlePtr) { + + CURLMcode errorCode; + int runningTransfers; + + for (errorCode=-1;errorCode<0;) { + errorCode=curl_multi_perform(curlMultiHandlePtr,&runningTransfers); + } + + if (errorCode==0) { + curlReturnCURLMcode(interp,runningTransfers); + return TCL_OK; + } + + curlReturnCURLMcode(interp,errorCode); + + return TCL_ERROR; +} + +/* + *---------------------------------------------------------------------- + * + * curlMultiDeleteCmd -- + * + * This procedure is invoked when curl multi handle is deleted. + * See the user documentation for details on what it does. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * Cleans the curl handle and frees the memory. + * + *---------------------------------------------------------------------- + */ +int +curlMultiDeleteCmd(ClientData clientData) { + struct curlMultiObjData *curlMultiData=(struct curlMultiObjData *)clientData; + CURLM *curlMultiHandle=curlMultiData->mcurl; + CURLMcode errorCode; + Tcl_Interp *interp=curlMultiData->interp; + struct easyHandleList *listPtr1,*listPtr2; + + listPtr1=curlMultiData->handleListFirst; + while (listPtr1!=NULL) { + listPtr2=listPtr1->next; + Tcl_Free(listPtr1->name); + Tcl_Free((char *)listPtr1); + listPtr1=listPtr2; + } + errorCode=curl_multi_cleanup(curlMultiHandle); + curlMultiFreeSpace(curlMultiData); + return curlReturnCURLMcode(interp,errorCode); +} + +/* + *---------------------------------------------------------------------- + * + * curlGetMultiInfo -- + * Invokes the curl_multi_info_read function in libcurl to get + * some info about the transfer, like if they are done and + * things like that. + * + * Parameter: + * interp: The Tcl interpreter we are using, mainly to report errors. + * curlMultiHandlePtr: Pointer to the multi handle of the transfer. + * + * Results: + * Standard Tcl codes. The Tcl command will return a list with the + * name of the Tcl command and other info. + *---------------------------------------------------------------------- + */ +int +curlMultiGetInfo(Tcl_Interp *interp,CURLM *curlMultiHandlePtr) { + struct CURLMsg *multiInfo; + int msgLeft; + Tcl_Obj *resultPtr; + + multiInfo=curl_multi_info_read(curlMultiHandlePtr, &msgLeft); + resultPtr=Tcl_NewListObj(0,(Tcl_Obj **)NULL); + if (multiInfo==NULL) { + Tcl_ListObjAppendElement(interp,resultPtr,Tcl_NewStringObj("",-1)); + Tcl_ListObjAppendElement(interp,resultPtr,Tcl_NewIntObj(0)); + Tcl_ListObjAppendElement(interp,resultPtr,Tcl_NewIntObj(0)); + Tcl_ListObjAppendElement(interp,resultPtr,Tcl_NewIntObj(0)); + } else { + Tcl_ListObjAppendElement(interp,resultPtr, + Tcl_NewStringObj(curlGetEasyName(curlMultiHandlePtr,multiInfo->easy_handle),-1)); + Tcl_ListObjAppendElement(interp,resultPtr,Tcl_NewIntObj(multiInfo->msg)); + Tcl_ListObjAppendElement(interp,resultPtr,Tcl_NewIntObj(multiInfo->data.result)); + Tcl_ListObjAppendElement(interp,resultPtr,Tcl_NewIntObj(msgLeft)); + } + Tcl_SetObjResult(interp,resultPtr); + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlMultiActiveTransfers -- + * This function is used to know whether an connection is ready to + * transfer data. This code has been copied almost verbatim from + * libcurl's examples. + * + * Parameter: + * multiHandlePtr: Pointer to the multi handle of the transfer. + * + * Results: + * + *---------------------------------------------------------------------- + */ +int +curlMultiGetActiveTransfers( struct curlMultiObjData *curlMultiData) { + struct timeval timeout; + int selectCode; + int maxfd; + + FD_ZERO(&(curlMultiData->fdread)); + FD_ZERO(&(curlMultiData->fdwrite)); + FD_ZERO(&(curlMultiData->fdexcep)); + + /* set a suitable timeout to play around with */ + timeout.tv_sec = 1; + timeout.tv_usec = 0; + + /* get file descriptors from the transfers */ + curl_multi_fdset(curlMultiData->mcurl, + &(curlMultiData->fdread), + &(curlMultiData->fdwrite), + &(curlMultiData->fdexcep), &maxfd); + + selectCode = select(maxfd+1, &(curlMultiData->fdread) + , &(curlMultiData->fdwrite), &(curlMultiData->fdexcep) + , &timeout); + + return selectCode; +} + +/* + *---------------------------------------------------------------------- + * + * curlMultiActiveTransfers -- + * Implements the Tcl 'active', it queries the multi handle to know + * if any of the connections are ready to transfer data. + * + * Parameter: + * interp: The Tcl interpreter we are using, mainly to report errors. + * curlMultiHandlePtr: Pointer to the multi handle of the transfer. + * + * Results: + * Standard Tcl codes. The Tcl command will return the number of + * transfers. + *---------------------------------------------------------------------- + */ +int +curlMultiActiveTransfers(Tcl_Interp *interp, struct curlMultiObjData *curlMultiData) { + int selectCode; + Tcl_Obj *resultPtr; + + selectCode = curlMultiGetActiveTransfers(curlMultiData); + + if (selectCode==-1) { + return TCL_ERROR; + } + + resultPtr=Tcl_NewIntObj(selectCode); + Tcl_SetObjResult(interp,resultPtr); + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlGetEasyHandle -- + * + * Given the name of an easy curl handle (curl1,...), in a Tcl object + * this function will return the pointer the 'internal' libcurl handle. + * + * Parameter: + * The Tcl object with the name. + * + * Results: + * The pointer to the libcurl handle + *---------------------------------------------------------------------- + */ +struct curlObjData * +curlGetEasyHandle(Tcl_Interp *interp,Tcl_Obj *nameObjPtr) { + + char *handleName; + Tcl_CmdInfo *infoPtr=(Tcl_CmdInfo *)Tcl_Alloc(sizeof(Tcl_CmdInfo)); + struct curlObjData *curlDataPtr; + + handleName=Tcl_GetString(nameObjPtr); + + if (0==Tcl_GetCommandInfo(interp,handleName,infoPtr)) { + return NULL; + } + curlDataPtr=(struct curlObjData *)(infoPtr->objClientData); + Tcl_Free((char *)infoPtr); + return curlDataPtr; +} + +/* + *---------------------------------------------------------------------- + * + * curlMultiFreeSpace -- + * + * Frees the space taken by a curlMultiObjData struct. + * + * Parameter: + * interp: Pointer to the interpreter we are using. + * curlMultiHandle: the curl handle for which the option is set. + * objc and objv: The usual in Tcl. + * + * Results: + * A standard Tcl result. + *---------------------------------------------------------------------- + */ +void +curlMultiFreeSpace(struct curlMultiObjData *curlMultiData) { + + curl_multi_cleanup(curlMultiData->mcurl); + + Tcl_Free(curlMultiData->postCommand); + Tcl_Free((char *)curlMultiData); +} + +/* + *---------------------------------------------------------------------- + * + * curlEasyHandleListAdd + * Adds an easy handle to the list of handles in a multiHandle. + * + * Parameter: + * multiDataPtr: Pointer to the struct of the multi handle. + * easyHandle: The easy handle to add to the list. + * + * Results: + *---------------------------------------------------------------------- + */ +void +curlEasyHandleListAdd(struct curlMultiObjData *multiDataPtr,CURL *easyHandlePtr,char *name) { + struct easyHandleList *easyHandleListPtr; + + easyHandleListPtr=(struct easyHandleList *)Tcl_Alloc(sizeof(struct easyHandleList)); + easyHandleListPtr->curl =easyHandlePtr; + easyHandleListPtr->name =curlstrdup(name); + easyHandleListPtr->next=NULL; + if (multiDataPtr->handleListLast==NULL) { + multiDataPtr->handleListFirst=easyHandleListPtr; + multiDataPtr->handleListLast =easyHandleListPtr; + } else { + multiDataPtr->handleListLast->next=easyHandleListPtr; + multiDataPtr->handleListLast=easyHandleListPtr; + } +} + +/* + *---------------------------------------------------------------------- + * + * curlEasyHandleListRemove + * When we remove an easy handle from the multiHandle, this function + * will remove said handle from the linked list. + * + * Parameter: + * multiDataPtr: Pointer to the struct of the multi handle. + * easyHandle: The easy handle to add to the list. + * + * Results: + *---------------------------------------------------------------------- + */ +void +curlEasyHandleListRemove(struct curlMultiObjData *multiDataPtr,CURL *easyHandle) { + struct easyHandleList *listPtr1,*listPtr2; + + listPtr1=NULL; + listPtr2=multiDataPtr->handleListFirst; + while(listPtr2!=NULL) { + if (listPtr2->curl==easyHandle) { + if (listPtr1==NULL) { + multiDataPtr->handleListFirst=listPtr2->next; + } else { + listPtr1->next=listPtr2->next; + } + if (listPtr2==multiDataPtr->handleListLast) { + multiDataPtr->handleListLast=listPtr1; + } + Tcl_Free(listPtr2->name); + Tcl_Free((char *)listPtr2); + break; + } + listPtr1=listPtr2; + listPtr2=listPtr2->next; + } +} +/* + *---------------------------------------------------------------------- + * + * curlGetEasyName + * + * Given the pointer to an easy handle, this function will return + * the name of the Tcl command. + * + * Parameter: + * multiDataPtr: Multi handle we are using. + * easyHandle: The easy handle whose Tcl command we want to know. + * + * Results: + * A string with the name of the command. + *---------------------------------------------------------------------- + */ +char * +curlGetEasyName(struct curlMultiObjData *multiDataPtr,CURL *easyHandle) { + struct easyHandleList *listPtr; + + listPtr=multiDataPtr->handleListFirst; + while(listPtr!=NULL) { + if (listPtr->curl==easyHandle) { + return listPtr->name; + } + listPtr=listPtr->next; + } + return NULL; +} + +/* + *---------------------------------------------------------------------- + * + * curlReturnCURLMcode + * + * When one of the command wants to return a CURLMcode, it calls + * this function. + * + * Parameter: + * interp: Pointer to the interpreter we are using. + * errorCode: the value to be returned. + * + * Results: + * A standard Tcl result. + *---------------------------------------------------------------------- + */ +int +curlReturnCURLMcode (Tcl_Interp *interp,CURLMcode errorCode) { + Tcl_Obj *resultPtr; + + resultPtr=Tcl_NewIntObj(errorCode); + Tcl_SetObjResult(interp,resultPtr); + + if (errorCode>0) { + return TCL_ERROR; + } + return TCL_OK; +} + + +/*---------------------------------------------------------------------- + * + * curlMultiAutoTransfer -- + * + * Creates the event source that will take care of downloading using + * the multi interface driven by Tcl's event loop. + * + * Parameters: + * The usual Tcl command parameters. + * + * Results: + * Standard Tcl return code. + *---------------------------------------------------------------------- + */ + +int +curlMultiAutoTransfer(Tcl_Interp *interp, struct curlMultiObjData *curlMultiData, + int objc,Tcl_Obj *CONST objv[]) { + + if (objc==4) { + Tcl_Free(curlMultiData->postCommand); + curlMultiData->postCommand=curlstrdup(Tcl_GetString(objv[3])); + } + + Tcl_CreateEventSource((Tcl_EventSetupProc *)curlEventSetup, + (Tcl_EventCheckProc *)curlEventCheck, (ClientData *)curlMultiData); + + /* We have to call perform once to boot the transfer, otherwise it seems nothing + works *shrug* */ + + while(CURLM_CALL_MULTI_PERFORM == + curl_multi_perform(curlMultiData->mcurl,&(curlMultiData->runningTransfers))) { + } + + return TCL_OK; +} + +/*---------------------------------------------------------------------- + * + * curlMultiConfigTrasnfer -- + * This procedure is invoked by the user command 'configure', it reads + * the options passed by the user to configure a multi handle. + * + * Parameters: + * The usual Tcl command parameters. + * + * Results: + * Standard Tcl return code. + *---------------------------------------------------------------------- + */ + +int +curlMultiConfigTransfer(Tcl_Interp *interp, struct curlMultiObjData *curlMultiData, + int objc,Tcl_Obj *CONST objv[]) { + int tableIndex; + int i,j; + + Tcl_Obj *resultPtr; + char errorMsg[500]; + + for(i=2,j=3;imcurl, + CURLMOPT_PIPELINING,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 1: + if (SetMultiOptLong(interp,curlMultiData->mcurl, + CURLMOPT_MAXCONNECTS,tableIndex,objv)) { + return TCL_ERROR; + } + break; + } + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * SetMultiOptLong -- + * + * Set the curl options that require a long + * + * Parameter: + * interp: The interpreter we are working with. + * curlMultiHandle: and the multi curl handle + * opt: the option to set + * tclObj: The Tcl with the value for the option. + * + * Results: + * 0 if all went well. + * 1 in case of error. + *---------------------------------------------------------------------- + */ +int +SetMultiOptLong(Tcl_Interp *interp,CURLM *curlMultiHandle,CURLMoption opt, + int tableIndex,Tcl_Obj *tclObj) { + long longNumber; + char *parPtr; + + if (Tcl_GetLongFromObj(interp,tclObj,&longNumber)) { + parPtr=curlstrdup(Tcl_GetString(tclObj)); + curlErrorSetOpt(interp,multiConfigTable,tableIndex,parPtr); + Tcl_Free(parPtr); + return 1; + } + if (curl_multi_setopt(curlMultiHandle,opt,longNumber)) { + parPtr=curlstrdup(Tcl_GetString(tclObj)); + curlErrorSetOpt(interp,multiConfigTable,tableIndex,parPtr); + Tcl_Free(parPtr); + return 1; + } + return 0; +} + +/*---------------------------------------------------------------------- + * + * curlEventSetup -- + * + * This function is invoked by Tcl just after curlMultiAutoTransfer and + * then every time just before curlEventCheck, I only use to set the + * maximun time without checking for events + * + * NOTE: I hate having a fixed value, I will have to look into it. + * + * Parameters: + * They are passed automagically by Tcl, but I don't use them. + *---------------------------------------------------------------------- + */ + +void +curlEventSetup(ClientData clientData, int flags) { + Tcl_Time time = {0 , 0}; + + Tcl_SetMaxBlockTime(&time); +} + +/*---------------------------------------------------------------------- + * + * curlEventCheck -- + * + * Invoked automagically by Tcl from time to time, we check if there + * are any active transfer, if so we put an event in the queue so that + * 'curl_multi_perfom' will be eventually called, if not we delete + * the event source. + * + * Parameters: + * They are passed automagically by Tcl. + *---------------------------------------------------------------------- + */ + +void +curlEventCheck(ClientData clientData, int flags) { + struct curlMultiObjData *curlMultiData=(struct curlMultiObjData *)clientData; + struct curlEvent *curlEventPtr; + int selectCode; + + selectCode=curlMultiGetActiveTransfers(curlMultiData); + + if (curlMultiData->runningTransfers==0) { + Tcl_DeleteEventSource((Tcl_EventSetupProc *)curlEventSetup, + (Tcl_EventCheckProc *)curlEventCheck, (ClientData *)curlMultiData); + } else { + if (selectCode>=0) { + curlEventPtr=(struct curlEvent *)Tcl_Alloc(sizeof(struct curlEvent)); + curlEventPtr->proc=curlEventProc; + curlEventPtr->curlMultiData=curlMultiData; + Tcl_QueueEvent((Tcl_Event *)curlEventPtr, TCL_QUEUE_TAIL); + } + } +} + +/*---------------------------------------------------------------------- + * + * curlEventProc -- + * + * Finally Tcl event loop decides it is time to transfer something. + * + * Parameters: + * They are passed automagically by Tcl. + *---------------------------------------------------------------------- +*/ + +int +curlEventProc(Tcl_Event *evPtr,int flags) { + struct curlMultiObjData *curlMultiData + =(struct curlMultiObjData *)((struct curlEvent *)evPtr)->curlMultiData; + CURLMcode errorCode; + Tcl_Obj *tclCommandObjPtr; + char tclCommand[300]; + + errorCode=curl_multi_perform(curlMultiData->mcurl,&curlMultiData->runningTransfers); + if (curlMultiData->runningTransfers==0) { + if (curlMultiData->postCommand!=NULL) { + snprintf(tclCommand,299,"%s",curlMultiData->postCommand); + tclCommandObjPtr=Tcl_NewStringObj(tclCommand,-1); + if (Tcl_EvalObjEx(curlMultiData->interp,tclCommandObjPtr,TCL_EVAL_GLOBAL)!=TCL_OK) { +/* + fprintf(stdout,"Error invoking command\n"); + fprintf(stdout,"Error: %s\n",Tcl_GetString(Tcl_GetObjResult(curlMultiData->interp))); +*/ + } + } + } + return 1; +} + + diff --git a/generic/multi.h b/generic/multi.h new file mode 100755 index 0000000..3fbd324 --- /dev/null +++ b/generic/multi.h @@ -0,0 +1,115 @@ +/* + * multi.h -- + * + * Header file for the part of the TclCurl extension that deals with libcurl's + * 'multi' interface. + * + * Copyright (c) 2002-2009 Andres Garcia Garcia. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + */ + +#define multi_h +#include "tclcurl.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +struct easyHandleList { + CURL *curl; + char *name; + struct easyHandleList *next; +}; + +struct curlMultiObjData { + CURLM *mcurl; + Tcl_Command token; + Tcl_Interp *interp; + struct easyHandleList *handleListFirst; + struct easyHandleList *handleListLast; + fd_set fdread; + fd_set fdwrite; + fd_set fdexcep; + int runningTransfers; + char *postCommand; +}; + +struct curlEvent { + Tcl_EventProc *proc; + struct Tcl_Event *nextPtr; + struct curlMultiObjData *curlMultiData; +}; + +CONST static char *multiCommandTable[] = { + "addhandle", + "removehandle", + "perform", + "cleanup", + "getinfo", + "active", + "auto", + "configure", + (char *) NULL +}; + +CONST static char *multiConfigTable[] = { + "-pipelining", "-maxconnects", + (char *)NULL +}; + +char *curlCreateMultiObjCmd (Tcl_Interp *interp,struct curlMultiObjData *curlMultiData); + +int Tclcurl_MultiInit (Tcl_Interp *interp); + +int curlMultiDeleteCmd(ClientData clientData); + +int curlInitMultiObjCmd (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]); + +int curlMultiObjCmd (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]); + +CURLMcode curlAddMultiHandle(Tcl_Interp *interp,CURLM *curlMultiHandle + ,Tcl_Obj *objvPtr); + +CURLMcode curlRemoveMultiHandle(Tcl_Interp *interp,CURLM *curlMultiHandle + ,Tcl_Obj *objvPtr); + +int curlMultiPerform(Tcl_Interp *interp,CURLM *curlMultiHandle); + +int curlMultiGetInfo(Tcl_Interp *interp,CURLM *curlMultiHandlePtr); + +int curlMultiGetActiveTransfers( struct curlMultiObjData *curlMultiData); +int curlMultiActiveTransfers(Tcl_Interp *interp, struct curlMultiObjData *curlMultiData); + +struct curlObjData *curlGetEasyHandle(Tcl_Interp *interp,Tcl_Obj *nameObjPtr); + +void curlMultiFreeSpace(struct curlMultiObjData *curlMultiData); + +int curlReturnCURLMcode(Tcl_Interp *interp,CURLMcode errorCode); + +void curlEasyHandleListAdd(struct curlMultiObjData *multiDataPtr,CURL *easyHandle,char *name); +void curlEasyHandleListRemove(struct curlMultiObjData *multiDataPtr,CURL *easyHandle); +char *curlGetEasyName(struct curlMultiObjData *multiDataPtr,CURL *easyHandle); + +int curlMultiAutoTransfer(Tcl_Interp *interp, struct curlMultiObjData *curlMultiData, int objc,Tcl_Obj *CONST objv[]); +int curlMultiSetOpts(Tcl_Interp *interp, struct curlMultiObjData *curlMultiData,Tcl_Obj *CONST objv,int tableIndex); +int SetMultiOptLong(Tcl_Interp *interp,CURLM *curlMultiHandle,CURLMoption opt, + int tableIndex,Tcl_Obj *tclObj); + +int curlMultiConfigTransfer(Tcl_Interp *interp, struct curlMultiObjData *curlMultiData, int objc,Tcl_Obj *CONST objv[]); + +void curlEventSetup(ClientData clientData, int flags); + +void curlEventCheck(ClientData clientData, int flags); + +int curlEventProc(Tcl_Event *evPtr,int flags); + +#ifdef __cplusplus +} + +#endif diff --git a/generic/tclcurl.c b/generic/tclcurl.c new file mode 100755 index 0000000..ae7a483 --- /dev/null +++ b/generic/tclcurl.c @@ -0,0 +1,4054 @@ +/* + * tclcurl.c -- + * + * Implementation of the TclCurl extension that creates the curl namespace + * so that Tcl interpreters can access libcurl. + * + * Copyright (c) 2001-2009 Andres Garcia Garcia. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + */ + +#include "tclcurl.h" + +#include +#include + +/* + *---------------------------------------------------------------------- + * + * Tclcurl_Init -- + * + * This procedure initializes the package + * + * Results: + * A standard Tcl result. + * + *---------------------------------------------------------------------- + */ + +int +Tclcurl_Init (Tcl_Interp *interp) { + + if(Tcl_InitStubs(interp,"8.1",0)==NULL) { + return TCL_ERROR; + } + + Tcl_CreateObjCommand (interp,"::curl::init",curlInitObjCmd, + (ClientData)NULL,(Tcl_CmdDeleteProc *)NULL); + Tcl_CreateObjCommand (interp,"::curl::version",curlVersion, + (ClientData)NULL,(Tcl_CmdDeleteProc *)NULL); + Tcl_CreateObjCommand (interp,"::curl::escape",curlEscape, + (ClientData)NULL,(Tcl_CmdDeleteProc *)NULL); + Tcl_CreateObjCommand (interp,"::curl::unescape",curlUnescape, + (ClientData)NULL,(Tcl_CmdDeleteProc *)NULL); + Tcl_CreateObjCommand (interp,"::curl::versioninfo",curlVersionInfo, + (ClientData)NULL,(Tcl_CmdDeleteProc *)NULL); + Tcl_CreateObjCommand (interp,"::curl::shareinit",curlShareInitObjCmd, + (ClientData)NULL,(Tcl_CmdDeleteProc *)NULL); + Tcl_CreateObjCommand (interp,"::curl::easystrerror", curlEasyStringError, + (ClientData)NULL,(Tcl_CmdDeleteProc *)NULL); + Tcl_CreateObjCommand (interp,"::curl::sharestrerror",curlShareStringError, + (ClientData)NULL,(Tcl_CmdDeleteProc *)NULL); + Tcl_CreateObjCommand (interp,"::curl::multistrerror",curlMultiStringError, + (ClientData)NULL,(Tcl_CmdDeleteProc *)NULL); + + Tclcurl_MultiInit(interp); + + Tcl_PkgProvide(interp,"TclCurl","7.19.6"); + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlCreateObjCmd -- + * + * Looks for the first free handle (curl1, curl2,...) and creates a + * Tcl command for it. + * + * Results: + * A string with the name of the handle, don't forget to free it. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ + +char * +curlCreateObjCmd (Tcl_Interp *interp,struct curlObjData *curlData) { + char *handleName; + int i; + Tcl_CmdInfo info; + Tcl_Command cmdToken; + + /* We try with curl1, if it already exists with curl2...*/ + handleName=(char *)Tcl_Alloc(10); + for (i=1;;i++) { + sprintf(handleName,"curl%d",i); + if (!Tcl_GetCommandInfo(interp,handleName,&info)) { + cmdToken=Tcl_CreateObjCommand(interp,handleName,curlObjCmd, + (ClientData)curlData, + (Tcl_CmdDeleteProc *)curlDeleteCmd); + break; + } + } + curlData->token=cmdToken; + + return handleName; +} + +/* + *---------------------------------------------------------------------- + * + * curlInitObjCmd -- + * + * This procedure is invoked to process the "curl::init" Tcl command. + * See the user documentation for details on what it does. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ + +int +curlInitObjCmd (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]) { + + Tcl_Obj *resultPtr; + CURL *curlHandle; + struct curlObjData *curlData; + char *handleName; + + curlData=(struct curlObjData *)Tcl_Alloc(sizeof(struct curlObjData)); + if (curlData==NULL) { + resultPtr=Tcl_NewStringObj("Couldn't allocate memory",-1); + Tcl_SetObjResult(interp,resultPtr); + return TCL_ERROR; + } + + memset(curlData, 0, sizeof(struct curlObjData)); + curlData->interp=interp; + + curlHandle=curl_easy_init(); + if (curlHandle==NULL) { + resultPtr=Tcl_NewStringObj("Couldn't open curl handle",-1); + Tcl_SetObjResult(interp,resultPtr); + return TCL_ERROR; + } + + handleName=curlCreateObjCmd(interp,curlData); + + curlData->curl=curlHandle; + + resultPtr=Tcl_NewStringObj(handleName,-1); + Tcl_SetObjResult(interp,resultPtr); + Tcl_Free(handleName); + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlObjCmd -- + * + * This procedure is invoked to process the "curl" commands. + * See the user documentation for details on what it does. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ +int +curlObjCmd (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]) { + + struct curlObjData *curlData=(struct curlObjData *)clientData; + CURL *curlHandle=curlData->curl; + int tableIndex; + + if (objc<2) { + Tcl_WrongNumArgs(interp,1,objv,"option arg ?arg?"); + return TCL_ERROR; + } + if (Tcl_GetIndexFromObj(interp, objv[1], commandTable, "option", + TCL_EXACT,&tableIndex)==TCL_ERROR) { + return TCL_ERROR; + } + + switch(tableIndex) { + case 0: + if (curlSetOptsTransfer(interp,curlData,objc,objv)==TCL_ERROR) { + return TCL_ERROR; + } + break; + case 1: +/* fprintf(stdout,"Perform\n"); */ + if (curlPerform(interp,curlHandle,curlData)) { + if (curlData->errorBuffer!=NULL) { + if (curlData->errorBufferKey==NULL) { + Tcl_SetVar(interp,curlData->errorBufferName, + curlData->errorBuffer,0); + } else { + Tcl_SetVar2(interp,curlData->errorBufferName, + curlData->errorBufferKey, + curlData->errorBuffer,0); + } + } + return TCL_ERROR; + } + break; + case 2: +/* fprintf(stdout,"Getinfo\n"); */ + if (Tcl_GetIndexFromObj(interp,objv[2],getInfoTable, + "getinfo option",TCL_EXACT,&tableIndex)==TCL_ERROR) { + return TCL_ERROR; + } + if (curlGetInfo(interp,curlHandle,tableIndex)) { + return TCL_ERROR; + } + break; + case 3: +/* fprintf(stdout,"Cleanup\n"); */ + Tcl_DeleteCommandFromToken(interp,curlData->token); + break; + case 4: +/* fprintf(stdout,"Configure\n"); */ + if (curlConfigTransfer(interp,curlData,objc,objv)==TCL_ERROR) { + return TCL_ERROR; + } + break; + case 5: +/* fprintf(stdout,"DupHandle\n"); */ + if (curlDupHandle(interp,curlData,objc,objv)==TCL_ERROR) { + return TCL_ERROR; + } + break; + case 6: +/* fprintf(stdout,"Reset\n"); */ + if (curlResetHandle(interp,curlData)==TCL_ERROR) { + return TCL_ERROR; + } + break; + case 7: +/* fprintf(stdout,"Pause\n"); */ + if (curl_easy_pause(curlData->curl,CURLPAUSE_ALL)==TCL_ERROR) { + return TCL_ERROR; + } + break; + + case 8: +/* fprintf(stdout,"Resume\n"); */ + if (curl_easy_pause(curlData->curl,CURLPAUSE_CONT)==TCL_ERROR) { + return TCL_ERROR; + } + break; + } + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlDeleteCmd -- + * + * This procedure is invoked when curl handle is deleted. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * Cleans the curl handle and frees the memory. + * + *---------------------------------------------------------------------- + */ +int +curlDeleteCmd(ClientData clientData) { + struct curlObjData *curlData=(struct curlObjData *)clientData; + CURL *curlHandle=curlData->curl; + + curl_easy_cleanup(curlHandle); + curlFreeSpace(curlData); + + Tcl_Free((char *)curlData); + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlPerform -- + * + * Invokes the libcurl function 'curl_easy_perform' + * + * Parameter: + * interp: Pointer to the interpreter we are using. + * curlHandle: the curl handle for which the option is set. + * objc and objv: The usual in Tcl. + * + * Results: + * Standard Tcl return codes. + *---------------------------------------------------------------------- + */ +int +curlPerform(Tcl_Interp *interp,CURL *curlHandle, + struct curlObjData *curlData) { + int exitCode; + Tcl_Obj *resultPtr; + + if (curlOpenFiles(interp,curlData)) { + return TCL_ERROR; + } + if (curlSetPostData(interp,curlData)) { + return TCL_ERROR; + } + exitCode=curl_easy_perform(curlHandle); + resultPtr=Tcl_NewIntObj(exitCode); + Tcl_SetObjResult(interp,resultPtr); + curlCloseFiles(curlData); + curlResetPostData(curlData); + if (curlData->bodyVarName) { + curlSetBodyVarName(interp,curlData); + } + if (curlData->command) { + Tcl_GlobalEval(interp,curlData->command); + } + return exitCode; +} + +/* + *---------------------------------------------------------------------- + * + * curlSetOptsTransfer -- + * + * This procedure is invoked when the user invokes the 'setopt' + * command, it is used to set the 'curl' options + * + * Parameter: + * interp: Pointer to the interpreter we are using. + * curlHandle: the curl handle for which the option is set. + * objc and objv: The usual in Tcl. + * + * Results: + * A standard Tcl result. + *---------------------------------------------------------------------- + */ +int +curlSetOptsTransfer(Tcl_Interp *interp, struct curlObjData *curlData, + int objc, Tcl_Obj *CONST objv[]) { + + int tableIndex; +fprintf(stdout,"Llegamos a curlSetOptsTrasnfer\n"); + if (Tcl_GetIndexFromObj(interp, objv[2], optionTable, "option", + TCL_EXACT, &tableIndex)==TCL_ERROR) { + return TCL_ERROR; + } +fprintf(stdout,"La opcion es la %d\n",tableIndex); + return curlSetOpts(interp,curlData,objv[3],tableIndex); +} + +/* + *---------------------------------------------------------------------- + * + * curlConfigTransfer -- + * + * This procedure is invoked by the user command 'configure', it reads + * the options passed by the user to configure a transfer, and passes + * then, one by one to 'curlSetOpts'. + * + * Parameter: + * interp: Pointer to the interpreter we are using. + * curlHandle: the curl handle for which the option is set. + * objc and objv: The usual in Tcl. + * + * Results: + * A standard Tcl result. + *---------------------------------------------------------------------- + */ +int +curlConfigTransfer(Tcl_Interp *interp, struct curlObjData *curlData, + int objc, Tcl_Obj *CONST objv[]) { + + int tableIndex; + int i,j; + + Tcl_Obj *resultPtr; + char errorMsg[500]; + + for(i=2,j=3;icurl; + int i,j,k; + + Tcl_Obj *resultObjPtr; + Tcl_Obj *tmpObjPtr; + + Tcl_RegExp regExp; + CONST char *startPtr; + CONST char *endPtr; + + int charLength; + long longNumber=0; + int intNumber; + char *tmpStr; + unsigned char *tmpUStr; + + Tcl_Obj **httpPostData; + Tcl_Obj **protocols; + int curlTableIndex,formaddError,formArrayIndex; + struct formArrayStruct *newFormArray; + struct curl_forms *formArray; + int curlformBufferSize; + size_t contentslen; + + ulong protocolMask; + + switch(tableIndex) { + case 0: + if (SetoptChar(interp,curlHandle,CURLOPT_URL, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 1: + Tcl_Free(curlData->outFile); + curlData->outFile=curlstrdup(Tcl_GetString(objv)); + if ((strcmp(curlData->outFile,""))&&(strcmp(curlData->outFile,"stdout"))) { + curlData->outFlag=1; + } else { + curlData->outFlag=0; + curl_easy_setopt(curlHandle,CURLOPT_WRITEDATA,stdout); + curlData->outFile=NULL; + } + curl_easy_setopt(curlHandle,CURLOPT_WRITEFUNCTION,NULL); + break; + case 2: + Tcl_Free(curlData->inFile); + curlData->inFile=curlstrdup(Tcl_GetString(objv)); + if ((strcmp(curlData->inFile,""))&&(strcmp(curlData->inFile,"stdin"))) { + curlData->inFlag=1; + } else { + curl_easy_setopt(curlHandle,CURLOPT_READDATA,stdin); + curlData->inFlag=0; + curlData->inFile=NULL; + } + curl_easy_setopt(curlHandle,CURLOPT_READFUNCTION,NULL); + break; + case 3: + if (SetoptChar(interp,curlHandle, + CURLOPT_USERAGENT,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 4: + if (SetoptChar(interp,curlHandle,CURLOPT_REFERER,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 5: + if (SetoptInt(interp,curlHandle,CURLOPT_VERBOSE,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 6: + if (SetoptInt(interp,curlHandle,CURLOPT_HEADER,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 7: + if (SetoptInt(interp,curlHandle,CURLOPT_NOBODY,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 8: + if (SetoptChar(interp,curlHandle,CURLOPT_PROXY,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 9: + if (SetoptLong(interp,curlHandle,CURLOPT_PROXYPORT,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 10: + if (SetoptInt(interp,curlHandle,CURLOPT_HTTPPROXYTUNNEL,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 11: + if (SetoptInt(interp,curlHandle,CURLOPT_FAILONERROR,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 12: + if (SetoptLong(interp,curlHandle,CURLOPT_TIMEOUT,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 13: + if (SetoptLong(interp,curlHandle,CURLOPT_LOW_SPEED_LIMIT,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 14: + if (SetoptLong(interp,curlHandle,CURLOPT_LOW_SPEED_TIME,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 15: + if (SetoptLong(interp,curlHandle,CURLOPT_RESUME_FROM,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 16: + if (SetoptLong(interp,curlHandle,CURLOPT_INFILESIZE,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 17: + if (SetoptInt(interp,curlHandle,CURLOPT_UPLOAD,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 137: + case 18: + if (SetoptInt(interp,curlHandle,CURLOPT_DIRLISTONLY,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 136: + case 19: + if (SetoptInt(interp,curlHandle,CURLOPT_APPEND,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 20: + if (Tcl_GetIndexFromObj(interp, objv, netrcTable, + "netrc option",TCL_EXACT,&curlTableIndex)==TCL_ERROR) { + return TCL_ERROR; + } + if (curl_easy_setopt(curlHandle,CURLOPT_NETRC,curlTableIndex)) { + curlErrorSetOpt(interp,configTable,tableIndex,netrcTable[curlTableIndex]); + return 1; + } + break; + case 21: + if (SetoptInt(interp,curlHandle,CURLOPT_FOLLOWLOCATION,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 22: + if (SetoptInt(interp,curlHandle,CURLOPT_TRANSFERTEXT,tableIndex, + objv)) { + return TCL_ERROR; + } + Tcl_GetIntFromObj(interp,objv,&curlData->transferText); + break; + case 23: + if (SetoptInt(interp,curlHandle,CURLOPT_PUT,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 24: /* The CURLOPT_MUTE option no longer does anything.*/ + break; + case 25: + if (SetoptChar(interp,curlHandle,CURLOPT_USERPWD,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 26: + if (SetoptChar(interp,curlHandle,CURLOPT_PROXYUSERPWD,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 27: + if (SetoptChar(interp,curlHandle,CURLOPT_RANGE,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 28: + tmpStr=curlstrdup(Tcl_GetString(objv)); + regExp=Tcl_RegExpCompile(interp,"(.*)(?:\\()(.*)(?:\\))"); + exitCode=Tcl_RegExpExec(interp,regExp,tmpStr,tmpStr); + switch(exitCode) { + case -1: + Tcl_Free((char *)tmpStr); + return TCL_ERROR; + break; + case 0: + if (*tmpStr!=0) { + curlData->errorBufferName=curlstrdup(tmpStr); + } else { + curlData->errorBuffer=NULL; + } + curlData->errorBufferKey=NULL; + break; + case 1: + Tcl_RegExpRange(regExp,1,&startPtr,&endPtr); + charLength=endPtr-startPtr; + curlData->errorBufferName=Tcl_Alloc(charLength+1); + strncpy(curlData->errorBufferName,startPtr,charLength); + curlData->errorBufferName[charLength]=0; + Tcl_RegExpRange(regExp,2,&startPtr,&endPtr); + charLength=endPtr-startPtr; + curlData->errorBufferKey=Tcl_Alloc(charLength+1); + strncpy(curlData->errorBufferKey,startPtr,charLength); + curlData->errorBufferKey[charLength]=0; + break; + } + Tcl_Free((char *)tmpStr); + if (curlData->errorBufferName!=NULL) { + curlData->errorBuffer=Tcl_Alloc(CURL_ERROR_SIZE); + if (curl_easy_setopt(curlHandle,CURLOPT_ERRORBUFFER, + curlData->errorBuffer)) { + Tcl_Free((char *)curlData->errorBuffer); + curlData->errorBuffer=NULL; + return TCL_ERROR; + } + } else { + Tcl_Free(curlData->errorBuffer); + } + break; + case 29: + if (SetoptLong(interp,curlHandle,CURLOPT_HTTPGET,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 30: + if (SetoptInt(interp,curlHandle,CURLOPT_POST,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 31: + if (SetoptChar(interp,curlHandle, + CURLOPT_COPYPOSTFIELDS,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 33: + if (SetoptChar(interp,curlHandle, + CURLOPT_FTPPORT,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 34: + if (SetoptChar(interp,curlHandle,CURLOPT_COOKIE,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 35: + if (SetoptChar(interp,curlHandle,CURLOPT_COOKIEFILE,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 36: + if(SetoptsList(interp,&curlData->headerList,objv)) { + curlErrorSetOpt(interp,configTable,tableIndex,"Header list invalid"); + return TCL_ERROR; + } + if (curl_easy_setopt(curlHandle,CURLOPT_HTTPHEADER,curlData->headerList)) { + curl_slist_free_all(curlData->headerList); + curlData->headerList=NULL; + return TCL_ERROR; + } + return TCL_OK; + break; + case 37: + if (Tcl_ListObjGetElements(interp,objv,&k,&httpPostData) + ==TCL_ERROR) { + return TCL_ERROR; + } + formaddError=0; + newFormArray=(struct formArrayStruct *)Tcl_Alloc(sizeof(struct formArrayStruct)); + formArray=(struct curl_forms *)Tcl_Alloc(k*(sizeof(struct curl_forms))); + formArrayIndex=0; + + newFormArray->next=curlData->formArray; + newFormArray->formArray=formArray; + newFormArray->formHeaderList=NULL; + + for(i=0,j=0;iformHeaderList,httpPostData[i+1])) { + curlErrorSetOpt(interp,configTable,tableIndex,"Header list invalid"); + formaddError=1; + return TCL_ERROR; + } + formArray[formArrayIndex].value = (char *)newFormArray->formHeaderList; + break; + case 5: +/* fprintf(stdout,"FileName: %s\n",Tcl_GetString(httpPostData[i+1])); */ + formArray[formArrayIndex].option = CURLFORM_FILENAME; + formArray[formArrayIndex].value = curlstrdup(Tcl_GetString(httpPostData[i+1])); + break; + case 6: +/* fprintf(stdout,"BufferName: %s\n",Tcl_GetString(httpPostData[i+1])); */ + formArray[formArrayIndex].option = CURLFORM_BUFFER; + formArray[formArrayIndex].value = curlstrdup(Tcl_GetString(httpPostData[i+1])); + break; + case 7: +/* fprintf(stdout,"Buffer: %s\n",Tcl_GetString(httpPostData[i+1])); */ + tmpUStr=Tcl_GetByteArrayFromObj + (httpPostData[i+1],&curlformBufferSize); + formArray[formArrayIndex].option = CURLFORM_BUFFERPTR; + formArray[formArrayIndex].value = (char *) + memcpy(Tcl_Alloc(curlformBufferSize), tmpUStr, curlformBufferSize); + formArrayIndex++; + formArray[formArrayIndex].option = CURLFORM_BUFFERLENGTH; + contentslen=curlformBufferSize; + formArray[formArrayIndex].value = (char *)contentslen; + break; + case 8: +/* fprintf(stdout,"FileName: %s\n",Tcl_GetString(httpPostData[i+1])); */ + formArray[formArrayIndex].option = CURLFORM_FILECONTENT; + formArray[formArrayIndex].value = curlstrdup(Tcl_GetString(httpPostData[i+1])); + break; + } + formArrayIndex++; + } + formArray[formArrayIndex].option=CURLFORM_END; + curlData->formArray=newFormArray; + + if (0==formaddError) { + formaddError=curl_formadd(&(curlData->postListFirst) + ,&(curlData->postListLast), CURLFORM_ARRAY, formArray + , CURLFORM_END); + } + if (formaddError!=CURL_FORMADD_OK) { + curlResetFormArray(formArray); + curlData->formArray=newFormArray->next; + Tcl_Free((char *)newFormArray); + tmpStr=Tcl_Alloc(10); + snprintf(tmpStr,10,"%d",formaddError); + resultObjPtr=Tcl_NewStringObj(tmpStr,-1); + Tcl_SetObjResult(interp,resultObjPtr); + Tcl_Free(tmpStr); + return TCL_ERROR; + } + return TCL_OK; + break; + case 38: + if (SetoptChar(interp,curlHandle,CURLOPT_SSLCERT,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 39: + if (SetoptChar(interp,curlHandle,CURLOPT_SSLCERTPASSWD,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 40: + if (Tcl_GetIndexFromObj(interp, objv, sslversion, + "sslversion ",TCL_EXACT,&intNumber)==TCL_ERROR) { + return TCL_ERROR; + } + switch(intNumber) { + case 0: + longNumber=CURL_SSLVERSION_DEFAULT; + break; + case 1: + longNumber=CURL_SSLVERSION_TLSv1; + break; + case 2: + longNumber=CURL_SSLVERSION_SSLv2; + break; + case 3: + longNumber=CURL_SSLVERSION_SSLv3; + } + tmpObjPtr=Tcl_NewLongObj(longNumber); + if (SetoptLong(interp,curlHandle,CURLOPT_SSLVERSION, + tableIndex,tmpObjPtr)) { + return TCL_ERROR; + } + break; + case 41: + if (SetoptInt(interp,curlHandle,CURLOPT_CRLF,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 42: + if(SetoptsList(interp,&curlData->quote,objv)) { + curlErrorSetOpt(interp,configTable,tableIndex,"quote list invalid"); + return TCL_ERROR; + } + if (curl_easy_setopt(curlHandle,CURLOPT_QUOTE,curlData->quote)) { + curl_slist_free_all(curlData->quote); + curlData->quote=NULL; + return TCL_ERROR; + } + return TCL_OK; + break; + case 43: + if(SetoptsList(interp,&curlData->postquote,objv)) { + curlErrorSetOpt(interp,configTable,tableIndex,"postqoute invalid"); + return TCL_ERROR; + } + if (curl_easy_setopt(curlHandle,CURLOPT_POSTQUOTE,curlData->postquote)) { + curlErrorSetOpt(interp,configTable,tableIndex,"postqoute invalid"); + curl_slist_free_all(curlData->postquote); + curlData->postquote=NULL; + return TCL_ERROR; + } + return TCL_OK; + break; + case 44: + Tcl_Free(curlData->headerFile); + curlData->headerFile=curlstrdup(Tcl_GetString(objv)); + if ((strcmp(curlData->headerFile,""))&&(strcmp(curlData->headerFile,"stdout")) + &&(strcmp(curlData->headerFile,"stderr"))) { + curlData->headerFlag=1; + } else { + if ((strcmp(curlData->headerFile,"stdout"))) { + curl_easy_setopt(curlHandle,CURLOPT_HEADERDATA,stderr); + } else { + curl_easy_setopt(curlHandle,CURLOPT_HEADERDATA,stdout); + } + curlData->headerFlag=0; + curlData->headerFile=NULL; + } + break; + case 45: + if (Tcl_GetIndexFromObj(interp, objv, timeCond, + "time cond option",TCL_EXACT, &intNumber)==TCL_ERROR) { + return TCL_ERROR; + } + if (intNumber==0) { + longNumber=CURL_TIMECOND_IFMODSINCE; + } else { + longNumber=CURL_TIMECOND_IFUNMODSINCE; + } + if (curl_easy_setopt(curlHandle,CURLOPT_TIMECONDITION,longNumber)) { + return TCL_ERROR; + } + break; + case 46: + if (SetoptLong(interp,curlHandle,CURLOPT_TIMEVALUE,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 47: + if (SetoptChar(interp,curlHandle,CURLOPT_CUSTOMREQUEST,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 48: + Tcl_Free(curlData->stderrFile); + curlData->stderrFile=curlstrdup(Tcl_GetString(objv)); + if ((strcmp(curlData->stderrFile,""))&&(strcmp(curlData->stderrFile,"stdout")) + &&(strcmp(curlData->stderrFile,"stderr"))) { + curlData->stderrFlag=1; + } else { + curlData->stderrFlag=0; + if (strcmp(curlData->stderrFile,"stdout")) { + curl_easy_setopt(curlHandle,CURLOPT_STDERR,stderr); + } else { + curl_easy_setopt(curlHandle,CURLOPT_STDERR,stdout); + } + curlData->stderrFile=NULL; + } + break; + case 49: + if (SetoptChar(interp,curlHandle,CURLOPT_INTERFACE,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 50: + case 132: + if (SetoptChar(interp,curlHandle,CURLOPT_KRBLEVEL,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 51: + if (SetoptLong(interp,curlHandle,CURLOPT_SSL_VERIFYPEER,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 52: + if (SetoptChar(interp,curlHandle,CURLOPT_CAINFO,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 53: + if (SetoptLong(interp,curlHandle,CURLOPT_FILETIME,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 54: + if (SetoptLong(interp,curlHandle,CURLOPT_MAXREDIRS,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 55: + if (SetoptLong(interp,curlHandle,CURLOPT_MAXCONNECTS,tableIndex, + objv)) { + return TCL_ERROR; + } + break; + case 56: + curlErrorSetOpt(interp,configTable,tableIndex,"option is obsolete"); + return TCL_ERROR; + break; + case 57: + if (SetoptChar(interp,curlHandle,CURLOPT_RANDOM_FILE,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 58: + if (SetoptChar(interp,curlHandle,CURLOPT_EGDSOCKET,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 59: + if (SetoptLong(interp,curlHandle,CURLOPT_CONNECTTIMEOUT, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 60: + if (SetoptLong(interp,curlHandle,CURLOPT_NOPROGRESS, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 61: + if (curl_easy_setopt(curlHandle,CURLOPT_HEADERFUNCTION, + curlHeaderReader)) { + return TCL_ERROR; + } + Tcl_Free(curlData->headerVar); + curlData->headerVar=curlstrdup(Tcl_GetString(objv)); + if (curl_easy_setopt(curlHandle,CURLOPT_HEADERDATA, + (FILE *)curlData)) { + return TCL_ERROR; + } + break; + case 62: + Tcl_Free(curlData->bodyVarName); + curlData->bodyVarName=curlstrdup(Tcl_GetString(objv)); + if (curl_easy_setopt(curlHandle,CURLOPT_WRITEFUNCTION, + curlBodyReader)) { + return TCL_ERROR; + } + if (curl_easy_setopt(curlHandle,CURLOPT_WRITEDATA,curlData)) { + return TCL_ERROR; + } + break; + case 63: + Tcl_Free(curlData->progressProc); + curlData->progressProc=curlstrdup(Tcl_GetString(objv)); + if (strcmp(curlData->progressProc,"")) { + if (curl_easy_setopt(curlHandle,CURLOPT_PROGRESSFUNCTION, + curlProgressCallback)) { + return TCL_ERROR; + } + if (curl_easy_setopt(curlHandle,CURLOPT_PROGRESSDATA, + curlData)) { + return TCL_ERROR; + } + } else { + if (curl_easy_setopt(curlHandle,CURLOPT_PROGRESSFUNCTION,NULL)) { + return TCL_ERROR; + } + } + break; + case 64: + if (curlData->cancelTransVarName) { + Tcl_UnlinkVar(curlData->interp,curlData->cancelTransVarName); + Tcl_Free(curlData->cancelTransVarName); + } + curlData->cancelTransVarName=curlstrdup(Tcl_GetString(objv)); + Tcl_LinkVar(interp,curlData->cancelTransVarName, + (char *)&(curlData->cancelTrans),TCL_LINK_INT); + break; + case 65: + curlData->writeProc=curlstrdup(Tcl_GetString(objv)); + curlData->outFlag=0; + if (curl_easy_setopt(curlHandle,CURLOPT_WRITEFUNCTION, + curlWriteProcInvoke)) { + curl_easy_setopt(curlHandle,CURLOPT_WRITEFUNCTION,NULL); + return TCL_ERROR; + } + if (curl_easy_setopt(curlHandle,CURLOPT_WRITEDATA,curlData)) { + curl_easy_setopt(curlHandle,CURLOPT_WRITEFUNCTION,NULL); + return TCL_ERROR; + } + break; + case 66: + curlData->readProc=curlstrdup(Tcl_GetString(objv)); + curlData->inFlag=0; + if (strcmp(curlData->readProc,"")) { + if (curl_easy_setopt(curlHandle,CURLOPT_READFUNCTION, + curlReadProcInvoke)) { + return TCL_ERROR; + } + } else { + curl_easy_setopt(curlHandle,CURLOPT_READFUNCTION,NULL); + return TCL_OK; + } + if (curl_easy_setopt(curlHandle,CURLOPT_READDATA,curlData)) { + return TCL_ERROR; + } + break; + case 67: + if (SetoptLong(interp,curlHandle,CURLOPT_SSL_VERIFYHOST, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 68: + if (SetoptChar(interp,curlHandle,CURLOPT_COOKIEJAR,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 69: + if (SetoptChar(interp,curlHandle,CURLOPT_SSL_CIPHER_LIST,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 70: + if (Tcl_GetIndexFromObj(interp, objv, httpVersionTable, + "http version",TCL_EXACT,&tableIndex)==TCL_ERROR) { + return TCL_ERROR; + } + if (curl_easy_setopt(curlHandle,CURLOPT_HTTP_VERSION, + tableIndex)) { + tmpStr=curlstrdup(Tcl_GetString(objv)); + curlErrorSetOpt(interp,configTable,70,tmpStr); + Tcl_Free(tmpStr); + return TCL_ERROR; + } + break; + case 71: + if (SetoptLong(interp,curlHandle,CURLOPT_FTP_USE_EPSV, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 72: + if (SetoptChar(interp,curlHandle,CURLOPT_SSLCERTTYPE,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 73: + if (SetoptChar(interp,curlHandle,CURLOPT_SSLKEY,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 74: + if (SetoptChar(interp,curlHandle,CURLOPT_SSLKEYTYPE,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 135: + case 75: + if (SetoptChar(interp,curlHandle,CURLOPT_KEYPASSWD,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 76: + if (SetoptChar(interp,curlHandle,CURLOPT_SSLENGINE,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 77: + if (SetoptLong(interp,curlHandle,CURLOPT_SSLENGINE_DEFAULT,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 78: + if(SetoptsList(interp,&curlData->prequote,objv)) { + curlErrorSetOpt(interp,configTable,tableIndex,"pretqoute invalid"); + return TCL_ERROR; + } + if (curl_easy_setopt(curlHandle,CURLOPT_PREQUOTE,curlData->prequote)) { + curlErrorSetOpt(interp,configTable,tableIndex,"preqoute invalid"); + curl_slist_free_all(curlData->prequote); + curlData->prequote=NULL; + return TCL_ERROR; + } + return TCL_OK; + break; + case 79: + curlData->debugProc=curlstrdup(Tcl_GetString(objv)); + if (curl_easy_setopt(curlHandle,CURLOPT_DEBUGFUNCTION, + curlDebugProcInvoke)) { + return TCL_ERROR; + } + if (curl_easy_setopt(curlHandle,CURLOPT_DEBUGDATA,curlData)) { + return TCL_ERROR; + } + break; + case 80: + if (SetoptLong(interp,curlHandle,CURLOPT_DNS_CACHE_TIMEOUT, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 81: + if (SetoptLong(interp,curlHandle,CURLOPT_DNS_USE_GLOBAL_CACHE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 82: + if (SetoptLong(interp,curlHandle,CURLOPT_COOKIESESSION, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 83: + if (SetoptChar(interp,curlHandle,CURLOPT_CAPATH,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 84: + if (SetoptLong(interp,curlHandle,CURLOPT_BUFFERSIZE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 85: + if (SetoptLong(interp,curlHandle,CURLOPT_NOSIGNAL, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 86: + if (Tcl_GetIndexFromObj(interp, objv, encodingTable, + "encoding",TCL_EXACT,&tableIndex)==TCL_ERROR) { + return TCL_ERROR; + } + if (tableIndex==2) { + if (curl_easy_setopt(curlHandle,CURLOPT_ENCODING,"")) { + curlErrorSetOpt(interp,configTable,86,"all"); + return 1; + } + } else { + if (SetoptChar(interp,curlHandle,CURLOPT_ENCODING,86,objv)) { + return TCL_ERROR; + } + } + break; + case 87: + if (Tcl_GetIndexFromObj(interp, objv, proxyTypeTable, + "proxy type",TCL_EXACT,&tableIndex)==TCL_ERROR) { + return TCL_ERROR; + } + switch(tableIndex) { + case 0: + curl_easy_setopt(curlHandle,CURLOPT_PROXYTYPE, + CURLPROXY_HTTP); + case 1: + curl_easy_setopt(curlHandle,CURLOPT_PROXYTYPE, + CURLPROXY_SOCKS4); + case 2: + curl_easy_setopt(curlHandle,CURLOPT_PROXYTYPE, + CURLPROXY_SOCKS4A); + case 4: + curl_easy_setopt(curlHandle,CURLOPT_PROXYTYPE, + CURLPROXY_SOCKS5); + case 5: + curl_easy_setopt(curlHandle,CURLOPT_PROXYTYPE, + CURLPROXY_SOCKS5_HOSTNAME); + } + break; + case 88: + if(SetoptsList(interp,&curlData->http200aliases,objv)) { + curlErrorSetOpt(interp,configTable,tableIndex,"http200aliases invalid"); + return TCL_ERROR; + } + if (curl_easy_setopt(curlHandle,CURLOPT_HTTP200ALIASES,curlData->http200aliases)) { + curlErrorSetOpt(interp,configTable,tableIndex,"http200aliases invalid"); + curl_slist_free_all(curlData->http200aliases); + curlData->http200aliases=NULL; + return TCL_ERROR; + } + return TCL_OK; + break; + case 89: + if (SetoptInt(interp,curlHandle,CURLOPT_UNRESTRICTED_AUTH + ,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 90: + if (SetoptLong(interp,curlHandle,CURLOPT_FTP_USE_EPRT, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 91: + Tcl_Free(curlData->command); + curlData->command=curlstrdup(Tcl_GetString(objv)); + break; + case 92: + if (Tcl_GetIndexFromObj(interp, objv, httpAuthMethods, + "authentication method",TCL_EXACT,&intNumber)==TCL_ERROR) { + return TCL_ERROR; + } + curlData->anyAuthFlag=0; + switch(intNumber) { + case 0: + longNumber=CURLAUTH_BASIC; + break; + case 1: + longNumber=CURLAUTH_DIGEST; + break; + case 2: + longNumber=CURLAUTH_DIGEST_IE; + break; + case 3: + longNumber=CURLAUTH_GSSNEGOTIATE; + break; + case 4: + longNumber=CURLAUTH_NTLM; + break; + case 5: + longNumber=CURLAUTH_ANY; + curlData->anyAuthFlag=1; + break; + case 6: + longNumber=CURLAUTH_ANYSAFE; + break; + } + tmpObjPtr=Tcl_NewLongObj(longNumber); + if (SetoptLong(interp,curlHandle,CURLOPT_HTTPAUTH + ,tableIndex,tmpObjPtr)) { + return TCL_ERROR; + } + break; + case 93: + if (SetoptLong(interp,curlHandle,CURLOPT_FTP_CREATE_MISSING_DIRS, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 94: + if (Tcl_GetIndexFromObj(interp, objv, httpAuthMethods, + "authentication method",TCL_EXACT,&intNumber)==TCL_ERROR) { + return TCL_ERROR; + } + switch(intNumber) { + case 0: + longNumber=CURLAUTH_BASIC; + break; + case 1: + longNumber=CURLAUTH_DIGEST; + break; + case 2: + longNumber=CURLAUTH_GSSNEGOTIATE; + break; + case 3: + longNumber=CURLAUTH_NTLM; + break; + case 4: + longNumber=CURLAUTH_ANY; + break; + case 5: + longNumber=CURLAUTH_ANYSAFE; + break; + } + tmpObjPtr=Tcl_NewLongObj(longNumber); + if (SetoptLong(interp,curlHandle,CURLOPT_PROXYAUTH + ,tableIndex,tmpObjPtr)) { + return TCL_ERROR; + } + break; + case 95: + if (SetoptLong(interp,curlHandle,CURLOPT_FTP_RESPONSE_TIMEOUT, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 96: + if (Tcl_GetIndexFromObj(interp, objv, ipresolve, + "ip version",TCL_EXACT,&curlTableIndex)==TCL_ERROR) { + return TCL_ERROR; + } + switch(curlTableIndex) { + case 0: + longNumber=CURL_IPRESOLVE_WHATEVER; + break; + case 1: + longNumber=CURL_IPRESOLVE_V4; + break; + case 2: + longNumber=CURL_IPRESOLVE_V6; + break; + } + tmpObjPtr=Tcl_NewLongObj(longNumber); + if (SetoptLong(interp,curlHandle,CURLOPT_IPRESOLVE + ,tableIndex,tmpObjPtr)) { + return TCL_ERROR; + } + break; + case 97: + if (SetoptLong(interp,curlHandle,CURLOPT_MAXFILESIZE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 98: + if (SetoptChar(interp,curlHandle,CURLOPT_NETRC_FILE,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 99: + case 138: + if (Tcl_GetIndexFromObj(interp, objv, ftpssl, + "ftps method ",TCL_EXACT,&intNumber)==TCL_ERROR) { + return TCL_ERROR; + } + switch(intNumber) { + case 0: + longNumber=CURLUSESSL_NONE; + break; + case 1: + longNumber=CURLUSESSL_TRY; + break; + case 2: + longNumber=CURLUSESSL_CONTROL; + break; + case 3: + longNumber=CURLUSESSL_ALL; + break; + } + tmpObjPtr=Tcl_NewLongObj(longNumber); + if (SetoptLong(interp,curlHandle,CURLOPT_USE_SSL, + tableIndex,tmpObjPtr)) { + return TCL_ERROR; + } + break; + case 100: + if (SetoptSHandle(interp,curlHandle,CURLOPT_SHARE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 101: + if (SetoptLong(interp,curlHandle,CURLOPT_PORT, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 102: + if (SetoptLong(interp,curlHandle,CURLOPT_TCP_NODELAY, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 103: + if (SetoptLong(interp,curlHandle,CURLOPT_AUTOREFERER, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 104: + curlErrorSetOpt(interp,configTable,tableIndex,"option is obsolete"); + return TCL_ERROR; + break; + case 105: + curlErrorSetOpt(interp,configTable,tableIndex,"option is obsolete"); + return TCL_ERROR; + break; + case 106: + curlErrorSetOpt(interp,configTable,tableIndex,"option is obsolete"); + return TCL_ERROR; + break; + case 107: + curlErrorSetOpt(interp,configTable,tableIndex,"option is obsolete, check '-ftpport'"); + return TCL_ERROR; + break; + case 108: + curlErrorSetOpt(interp,configTable,tableIndex,"option is obsolete, check '-ftpport'"); + return TCL_ERROR; + break; + case 109: + curlErrorSetOpt(interp,configTable,tableIndex,"option is obsolete"); + return TCL_ERROR; + break; + case 110: + curlErrorSetOpt(interp,configTable,tableIndex,"option is obsolete"); + return TCL_ERROR; + break; + case 111: + if (Tcl_GetIndexFromObj(interp, objv, ftpsslauth, + "ftpsslauth method ",TCL_EXACT,&intNumber)==TCL_ERROR) { + return TCL_ERROR; + } + switch(intNumber) { + case 0: + longNumber=CURLFTPAUTH_DEFAULT; + break; + case 1: + longNumber=CURLFTPAUTH_SSL; + break; + case 2: + longNumber=CURLFTPAUTH_TLS; + break; + } + tmpObjPtr=Tcl_NewLongObj(longNumber); + if (SetoptLong(interp,curlHandle,CURLOPT_FTPSSLAUTH, + tableIndex,tmpObjPtr)) { + return TCL_ERROR; + } + break; + case 112: + curlErrorSetOpt(interp,configTable,tableIndex,"option is obsolete"); + return TCL_ERROR; + break; + case 113: + curlErrorSetOpt(interp,configTable,tableIndex,"option is obsolete"); + return TCL_ERROR; + break; + case 114: + if (SetoptChar(interp,curlHandle,CURLOPT_FTP_ACCOUNT,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 115: + if (SetoptLong(interp,curlHandle,CURLOPT_IGNORE_CONTENT_LENGTH, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 116: + if (SetoptChar(interp,curlHandle,CURLOPT_COOKIELIST,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 117: + if (SetoptLong(interp,curlHandle,CURLOPT_FTP_SKIP_PASV_IP, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 118: + if (Tcl_GetIndexFromObj(interp, objv, ftpfilemethod, + "ftp file method ",TCL_EXACT,&intNumber)==TCL_ERROR) { + return TCL_ERROR; + } + switch(intNumber) { + case 0: + case 1: + longNumber=1; /* FTPFILE_MULTICWD */ + break; + case 2: + longNumber=2; /* FTPFILE_NOCWD */ + break; + case 3: + longNumber=3; /* FTPFILE_SINGLECWD */ + break; + } + tmpObjPtr=Tcl_NewLongObj(longNumber); + if (SetoptLong(interp,curlHandle,CURLOPT_FTP_FILEMETHOD, + tableIndex,tmpObjPtr)) { + return TCL_ERROR; + } + break; + case 119: + if (SetoptLong(interp,curlHandle,CURLOPT_LOCALPORT, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 120: + if (SetoptLong(interp,curlHandle,CURLOPT_LOCALPORTRANGE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 121: + if (SetoptCurlOffT(interp,curlHandle,CURLOPT_MAX_SEND_SPEED_LARGE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 122: + if (SetoptCurlOffT(interp,curlHandle,CURLOPT_MAX_RECV_SPEED_LARGE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 123: + if (SetoptChar(interp,curlHandle, + CURLOPT_FTP_ALTERNATIVE_TO_USER,tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 124: + if (SetoptLong(interp,curlHandle,CURLOPT_SSL_SESSIONID_CACHE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 125: + if (Tcl_GetIndexFromObj(interp, objv, sshauthtypes, + "ssh auth type ",TCL_EXACT,&intNumber)==TCL_ERROR) { + return TCL_ERROR; + } + switch(intNumber) { + case 0: + longNumber=CURLSSH_AUTH_PUBLICKEY; + break; + case 1: + longNumber=CURLSSH_AUTH_PASSWORD; + break; + case 2: + longNumber=CURLSSH_AUTH_HOST; + break; + case 3: + longNumber=CURLSSH_AUTH_KEYBOARD; + break; + case 4: + longNumber=CURLSSH_AUTH_ANY; + break; + } + tmpObjPtr=Tcl_NewLongObj(longNumber); + if (SetoptLong(interp,curlHandle,CURLOPT_SSH_AUTH_TYPES, + tableIndex,tmpObjPtr)) { + return TCL_ERROR; + } + break; + case 126: + if (SetoptChar(interp,curlHandle,CURLOPT_SSH_PUBLIC_KEYFILE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 127: + if (SetoptChar(interp,curlHandle,CURLOPT_SSH_PRIVATE_KEYFILE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 128: + if (SetoptLong(interp,curlHandle,CURLOPT_TIMEOUT_MS, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 129: + if (SetoptLong(interp,curlHandle,CURLOPT_CONNECTTIMEOUT_MS, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 130: + if (SetoptLong(interp,curlHandle,CURLOPT_HTTP_CONTENT_DECODING, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 131: + if (SetoptLong(interp,curlHandle,CURLOPT_HTTP_TRANSFER_DECODING, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + /* 132 is together with case 50 */ + case 133: + if (SetoptLong(interp,curlHandle,CURLOPT_NEW_FILE_PERMS, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 134: + if (SetoptLong(interp,curlHandle,CURLOPT_NEW_DIRECTORY_PERMS, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + /* case 135 with 75, case 136 with 19, case 137 with 18 and case 138 with 99 */ + case 139: + case 146: + if (Tcl_GetIndexFromObj(interp, objv, postredir, + "Postredir option ",TCL_EXACT,&intNumber)==TCL_ERROR) { + return TCL_ERROR; + } + switch(intNumber) { + case 0: + longNumber=CURL_REDIR_POST_301; + break; + case 1: + longNumber=CURL_REDIR_POST_302; + break; + case 2: + longNumber=CURL_REDIR_POST_ALL; + break; + } + tmpObjPtr=Tcl_NewLongObj(longNumber); + if (SetoptLong(interp,curlHandle,CURLOPT_POSTREDIR, + tableIndex,tmpObjPtr)) { + return TCL_ERROR; + } + break; + case 140: + if (SetoptChar(interp,curlHandle,CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 141: + if (SetoptLong(interp,curlHandle,CURLOPT_PROXY_TRANSFER_MODE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 142: + if (SetoptChar(interp,curlHandle,CURLOPT_CRLFILE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 143: + if (SetoptChar(interp,curlHandle,CURLOPT_ISSUERCERT, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 144: + if (SetoptLong(interp,curlHandle,CURLOPT_ADDRESS_SCOPE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 145: + if (SetoptLong(interp,curlHandle,CURLOPT_CERTINFO, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + /* case 146 is together with 139*/ + case 147: + if (SetoptChar(interp,curlHandle,CURLOPT_USERNAME, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 148: + if (SetoptChar(interp,curlHandle,CURLOPT_PASSWORD, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 149: + if (SetoptChar(interp,curlHandle,CURLOPT_PROXYUSERNAME, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 150: + if (SetoptChar(interp,curlHandle,CURLOPT_PROXYPASSWORD, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 151: + if (SetoptLong(interp,curlHandle,CURLOPT_TFTP_BLKSIZE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 152: + if (SetoptChar(interp,curlHandle,CURLOPT_SOCKS5_GSSAPI_SERVICE, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 153: + if (SetoptLong(interp,curlHandle,CURLOPT_SOCKS5_GSSAPI_NEC, + tableIndex,objv)) { + return TCL_ERROR; + } + break; + case 154: + case 155: + if (Tcl_ListObjGetElements(interp,objv,&j,&protocols)==TCL_ERROR) { + return 1; + } + + for (i=0,protocolMask=0;isshkeycallProc=curlstrdup(Tcl_GetString(objv)); + break; + } + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * SetoptInt -- + * + * Sets the curl options that require an int + * + * Parameter: + * interp: The interpreter we are working with. + * curlHandle: and the curl handle + * opt: the option to set + * tclObj: The Tcl with the value for the option. + * + * Results: + * 0 if all went well. + * 1 in case of error. + *---------------------------------------------------------------------- + */ +int +SetoptInt(Tcl_Interp *interp,CURL *curlHandle,CURLoption opt, + int tableIndex,Tcl_Obj *tclObj) { + int intNumber; + char *parPtr; + + if (Tcl_GetIntFromObj(interp,tclObj,&intNumber)) { + parPtr=curlstrdup(Tcl_GetString(tclObj)); + curlErrorSetOpt(interp,configTable,tableIndex,parPtr); + Tcl_Free(parPtr); + return 1; + } + if (curl_easy_setopt(curlHandle,opt,intNumber)) { + parPtr=curlstrdup(Tcl_GetString(tclObj)); + curlErrorSetOpt(interp,configTable,tableIndex,parPtr); + Tcl_Free(parPtr); + return 1; + } + return 0; +} + +/* + *---------------------------------------------------------------------- + * + * SetoptLong -- + * + * Set the curl options that require a long + * + * Parameter: + * interp: The interpreter we are working with. + * curlHandle: and the curl handle + * opt: the option to set + * tclObj: The Tcl with the value for the option. + * + * Results: + * 0 if all went well. + * 1 in case of error. + *---------------------------------------------------------------------- + */ +int +SetoptLong(Tcl_Interp *interp,CURL *curlHandle,CURLoption opt, + int tableIndex,Tcl_Obj *tclObj) { + long longNumber; + char *parPtr; + + if (Tcl_GetLongFromObj(interp,tclObj,&longNumber)) { + parPtr=curlstrdup(Tcl_GetString(tclObj)); + curlErrorSetOpt(interp,configTable,tableIndex,parPtr); + Tcl_Free(parPtr); + return 1; + } + if (curl_easy_setopt(curlHandle,opt,longNumber)) { + parPtr=curlstrdup(Tcl_GetString(tclObj)); + curlErrorSetOpt(interp,configTable,tableIndex,parPtr); + Tcl_Free(parPtr); + return 1; + } + + return 0; +} + +/* + *---------------------------------------------------------------------- + * + * curlSetoptCurlOffT -- + * + * Set the curl options that require a curl_off_t, even if we really + * use a long to do it. (Cutting and pasting at its worst) + * + * Parameter: + * interp: The interpreter we are working with. + * curlHandle: and the curl handle + * opt: the option to set + * tclObj: The Tcl with the value for the option. + * + * Results: + * 0 if all went well. + * 1 in case of error. + *---------------------------------------------------------------------- + */ +int +SetoptCurlOffT(Tcl_Interp *interp,CURL *curlHandle,CURLoption opt, + int tableIndex,Tcl_Obj *tclObj) { + long longNumber; + char *parPtr; + + if (Tcl_GetLongFromObj(interp,tclObj,&longNumber)) { + parPtr=curlstrdup(Tcl_GetString(tclObj)); + curlErrorSetOpt(interp,configTable,tableIndex,parPtr); + Tcl_Free(parPtr); + return 1; + } + + if (curl_easy_setopt(curlHandle,opt,(curl_off_t)longNumber)) { + parPtr=curlstrdup(Tcl_GetString(tclObj)); + curlErrorSetOpt(interp,configTable,tableIndex,parPtr); + Tcl_Free(parPtr); + return 1; + } + + return 0; +} + + +/* + *---------------------------------------------------------------------- + * + * SetoptChar -- + * + * Set the curl options that require a string + * + * Parameter: + * interp: The interpreter we are working with. + * curlHandle: and the curl handle + * opt: the option to set + * tclObj: The Tcl with the value for the option. + * + * Results: + * 0 if all went well. + * 1 in case of error. + *---------------------------------------------------------------------- + */ +int +SetoptChar(Tcl_Interp *interp,CURL *curlHandle, + CURLoption opt,int tableIndex,Tcl_Obj *tclObj) { + char *optionPtr; + + optionPtr=curlstrdup(Tcl_GetString(tclObj)); + if (curl_easy_setopt(curlHandle,opt,optionPtr)) { + curlErrorSetOpt(interp,configTable,tableIndex,optionPtr); + Tcl_Free(optionPtr); + return 1; + } + Tcl_Free(optionPtr); + return 0; +} + +/* + *---------------------------------------------------------------------- + * + * SetoptSHandle -- + * + * Set the curl options that require a share handle (there is only + * one but you never know. + * + * Parameter: + * interp: The interpreter we are working with. + * curlHandle: the curl handle + * opt: the option to set + * tclObj: The Tcl with the value for the option. + * + * Results: + * 0 if all went well. + * 1 in case of error. + *---------------------------------------------------------------------- + */ +int +SetoptSHandle(Tcl_Interp *interp,CURL *curlHandle, + CURLoption opt,int tableIndex,Tcl_Obj *tclObj) { + + char *shandleName; + Tcl_CmdInfo *infoPtr=(Tcl_CmdInfo *)Tcl_Alloc(sizeof(Tcl_CmdInfo)); + struct shcurlObjData *shandleDataPtr; + + shandleName=Tcl_GetString(tclObj); + if (0==Tcl_GetCommandInfo(interp,shandleName,infoPtr)) { + return 1; + } + shandleDataPtr=(struct shcurlObjData *)(infoPtr->objClientData); + Tcl_Free((char *)infoPtr); + if (curl_easy_setopt(curlHandle,opt,shandleDataPtr->shandle)) { + curlErrorSetOpt(interp,configTable,tableIndex,shandleName); + return 1; + } + return 0; +} + +/* + *---------------------------------------------------------------------- + * + * SetoptsList -- + * + * Prepares a slist for future use. + * + * Parameter: + * slistPtr: Pointer to the slist to prepare. + * objv: Tcl object with a list of the data. + * + * Results: + * 0 if all went well. + * 1 in case of error. + *---------------------------------------------------------------------- + */ +int +SetoptsList(Tcl_Interp *interp,struct curl_slist **slistPtr, + Tcl_Obj *CONST objv) { + int i,headerNumber; + Tcl_Obj **headers; + + if (slistPtr!=NULL) { + curl_slist_free_all(*slistPtr); + *slistPtr=NULL; + } + + if (Tcl_ListObjGetElements(interp,objv,&headerNumber,&headers) + ==TCL_ERROR) { + return 1; + } + + for (i=0;iinterp,"(.*?)(?::\\s*)(.*?)(\\r*)(\\n)"); + match=Tcl_RegExpExec(curlData->interp,regExp,header,header); + + if (match) { + Tcl_RegExpRange(regExp,1,&startPtr,&endPtr); + charLength=endPtr-startPtr; + headerName=Tcl_Alloc(charLength+1); + strncpy(headerName,startPtr,charLength); + headerName[charLength]=0; + + Tcl_RegExpRange(regExp,2,&startPtr,&endPtr); + charLength=endPtr-startPtr; + headerContent=Tcl_Alloc(charLength+1); + strncpy(headerContent,startPtr,charLength); + headerContent[charLength]=0; + /* There may be multiple 'Set-Cookie' headers, so we use a list */ + if (Tcl_StringCaseMatch(headerName,"Set-Cookie",1)) { + Tcl_SetVar2(curlData->interp,curlData->headerVar,headerName, \ + headerContent,TCL_LIST_ELEMENT|TCL_APPEND_VALUE); + } else { + Tcl_SetVar2(curlData->interp,curlData->headerVar,headerName, + headerContent,0); + } + } + regExp=Tcl_RegExpCompile(curlData->interp,"(^(HTTP|http)[^\r]+)(\r*)(\n)"); + match=Tcl_RegExpExec(curlData->interp,regExp,header,header); + if (match) { + Tcl_RegExpRange(regExp,1,&startPtr,&endPtr); + charLength=endPtr-startPtr; + httpStatus=Tcl_Alloc(charLength+1); + strncpy(httpStatus,startPtr,charLength); + httpStatus[charLength]=0; + + Tcl_SetVar2(curlData->interp,curlData->headerVar,"http", + httpStatus,0); + } + return size*nmemb; +} + +/* + *---------------------------------------------------------------------- + * + * curlBodyReader -- + * + * This is the function that will be invoked as a callback while + * transferring the body of a request into a Tcl variable. + * + * This function has been adapted from an example in libcurl's FAQ. + * + * Parameter: + * header: string with the header line. + * size and nmemb: it so happens size * nmemb if the size of the + * header string. + * curlData: A pointer to the curlData structure for the transfer. + * + * Returns + * The number of bytes actually written or -1 in case of error, in + * which case 'libcurl' will abort the transfer. + *----------------------------------------------------------------------- + */ +size_t +curlBodyReader(void *ptr,size_t size,size_t nmemb,FILE *curlDataPtr) { + + register int realsize = size * nmemb; + struct MemoryStruct *mem=&(((struct curlObjData *)curlDataPtr)->bodyVar); + + mem->memory = (char *)Tcl_Realloc(mem->memory,mem->size + realsize); + if (mem->memory) { + memcpy(&(mem->memory[mem->size]), ptr, realsize); + mem->size += realsize; + } + return realsize; +} + +/* + *---------------------------------------------------------------------- + * + * curlProgressCallback -- + * + * This is the function that will be invoked as a callback during a + * transfer. + * + * This function has been adapted from an example in libcurl's FAQ. + * + * Parameter: + * clientData: The curlData struct for the transfer. + * dltotal: Total amount of bytes to download. + * dlnow: Bytes downloaded so far. + * ultotal: Total amount of bytes to upload. + * ulnow: Bytes uploaded so far. + * + * Returns + * Returning a non-zero value will make 'libcurl' abort the transfer + * and return 'CURLE_ABORTED_BY_CALLBACK'. + *----------------------------------------------------------------------- + */ +int +curlProgressCallback(void *clientData,double dltotal,double dlnow, + double ultotal,double ulnow) { + + struct curlObjData *curlData=(struct curlObjData *)clientData; + Tcl_Obj *tclProcPtr; + char tclCommand[300]; + + snprintf(tclCommand,299,"%s %f %f %f %f",curlData->progressProc,dltotal, + dlnow,ultotal,ulnow); + tclProcPtr=Tcl_NewStringObj(tclCommand,-1); + if (curlData->cancelTransVarName) { + if (curlData->cancelTrans) { + curlData->cancelTrans=0; + return -1; + } + } + if (Tcl_EvalObjEx(curlData->interp,tclProcPtr,TCL_EVAL_GLOBAL)!=TCL_OK) { + return -1; + } + return 0; +} + +/* + *---------------------------------------------------------------------- + * + * curlWriteProcInvoke -- + * + * This is the function that will be invoked as a callback when the user + * wants to invoke a Tcl procedure to write the recieved data. + * + * This function has been adapted from an example in libcurl's FAQ. + * + * Parameter: + * ptr: A pointer to the data. + * size and nmemb: it so happens size * nmemb if the size of the + * data read. + * curlData: A pointer to the curlData structure for the transfer. + * + * Returns + * The number of bytes actually written or -1 in case of error, in + * which case 'libcurl' will abort the transfer. + *----------------------------------------------------------------------- + */ +size_t +curlWriteProcInvoke(void *ptr,size_t size,size_t nmemb,FILE *curlDataPtr) { + register int realsize = size * nmemb; + struct curlObjData *curlData=(struct curlObjData *)curlDataPtr; + Tcl_Obj *objv[2]; + + objv[0]=Tcl_NewStringObj(curlData->writeProc,-1); + objv[1]=Tcl_NewByteArrayObj(ptr,realsize); + if (curlData->cancelTransVarName) { + if (curlData->cancelTrans) { + curlData->cancelTrans=0; + return -1; + } + } + if (Tcl_EvalObjv(curlData->interp,2,objv,TCL_EVAL_GLOBAL)!=TCL_OK) { + return -1; + } + + return realsize; +} + +/* + *---------------------------------------------------------------------- + * + * curlReadProcInvoke -- + * + * This is the function that will be invoked as a callback when the user + * wants to invoke a Tcl procedure to read the data to send. + * + * Parameter: + * header: string with the header line. + * size and nmemb: it so happens size * nmemb if the size of the + * header string. + * curlData: A pointer to the curlData structure for the transfer. + * + * Returns + * The number of bytes actually read or CURL_READFUNC_ABORT in case + * of error, in which case 'libcurl' will abort the transfer. + *----------------------------------------------------------------------- + */ +size_t +curlReadProcInvoke(void *ptr,size_t size,size_t nmemb,FILE *curlDataPtr) { + register int realsize = size * nmemb; + struct curlObjData *curlData=(struct curlObjData *)curlDataPtr; + Tcl_Obj *tclProcPtr; + Tcl_Obj *readDataPtr; + char tclCommand[300]; + unsigned char *readBytes; + int sizeRead; + + snprintf(tclCommand,300,"%s %d",curlData->readProc,realsize); + tclProcPtr=Tcl_NewStringObj(tclCommand,-1); + + if (curlData->cancelTransVarName) { + if (curlData->cancelTrans) { + curlData->cancelTrans=0; + return CURL_READFUNC_ABORT; + } + } + if (Tcl_EvalObjEx(curlData->interp,tclProcPtr,TCL_EVAL_GLOBAL)!=TCL_OK) { + return CURL_READFUNC_ABORT; + } + readDataPtr=Tcl_GetObjResult(curlData->interp); + readBytes=Tcl_GetByteArrayFromObj(readDataPtr,&sizeRead); + memcpy(ptr,readBytes,sizeRead); + + return sizeRead; +} + +/* + *---------------------------------------------------------------------- + * + * curlshkeyextract -- + * + * Out of one of libcurl's ssh key struct, this function will return a + * Tcl_Obj with a list, the first element is the type ok key, the second + * the key itself. + * + * Parameter: + * interp: The interp need to deal with the objects. + * key: a curl_khkey struct with the key. + * + * Returns + * The object with the list. + *----------------------------------------------------------------------- + */ +Tcl_Obj * +curlsshkeyextract(Tcl_Interp *interp,const struct curl_khkey *key) { + + Tcl_Obj *keyObjPtr; + + keyObjPtr=Tcl_NewListObj(0,(Tcl_Obj **)NULL); + + switch(key->keytype) { + case CURLKHTYPE_RSA1: + Tcl_ListObjAppendElement(interp,keyObjPtr,Tcl_NewStringObj("rsa1",-1)); + break; + case CURLKHTYPE_RSA: + Tcl_ListObjAppendElement(interp,keyObjPtr,Tcl_NewStringObj("rsa",-1)); + break; + case CURLKHTYPE_DSS: + Tcl_ListObjAppendElement(interp,keyObjPtr,Tcl_NewStringObj("dss",-1)); + break; + default: + Tcl_ListObjAppendElement(interp,keyObjPtr,Tcl_NewStringObj("unknnown",-1)); + break; + } + Tcl_ListObjAppendElement(interp,keyObjPtr,Tcl_NewStringObj(key->key,-1)); + + return keyObjPtr; +} + +/* + *---------------------------------------------------------------------- + * + * curlshkeycallback -- + * + * This is the function that will be invoked as a callback when the user + * wants to invoke a Tcl procedure to decide about this new ssh host + * + * Parameter: + * curl: curl's easy handle for the connection. + * knownkey: The key from the hosts_file. + * foundkey: The key from the remote site. + * match: What libcurl thinks about how they match + * curlDataPtr: Points to the structure with all the TclCurl data + * for the connection. + * + * Returns + * A libcurl return code so that libcurl knows what to do. + *----------------------------------------------------------------------- + */ +size_t +curlsshkeycallback(CURL *curl ,const struct curl_khkey *knownkey, + const struct curl_khkey *foundkey, enum curl_khmatch match,void *curlDataPtr) { + + struct curlObjData *tclcurlDataPtr=(struct curlObjData *)curlDataPtr; + Tcl_Interp *interp; + + Tcl_Obj *objv[4]; + Tcl_Obj *returnObjPtr; + + int action; + + interp=tclcurlDataPtr->interp; + + objv[0]=Tcl_NewStringObj(tclcurlDataPtr->sshkeycallProc,-1); + objv[1]=curlsshkeyextract(interp,knownkey); + objv[2]=curlsshkeyextract(interp,foundkey); + + switch(match) { + case CURLKHMATCH_OK: + objv[3]=Tcl_NewStringObj("match",-1); + break; + case CURLKHMATCH_MISMATCH: + objv[3]=Tcl_NewStringObj("mismatch",-1); + break; + case CURLKHMATCH_MISSING: + objv[3]=Tcl_NewStringObj("missing",-1); + break; + case CURLKHMATCH_LAST: + objv[3]=Tcl_NewStringObj("error",-1); + } + + if (Tcl_EvalObjv(interp,4,objv,TCL_EVAL_GLOBAL)!=TCL_OK) {return CURLKHSTAT_REJECT;} + + returnObjPtr=Tcl_GetObjResult(interp); + + if (Tcl_GetIntFromObj(interp,returnObjPtr,&action)!=TCL_OK) {return CURLKHSTAT_REJECT;} + + switch(action) { + case 0: + return CURLKHSTAT_FINE_ADD_TO_FILE; + case 1: + return CURLKHSTAT_FINE; + case 2: + return CURLKHSTAT_REJECT; + case 3: + return CURLKHSTAT_DEFER; + } + return CURLKHSTAT_REJECT; +} + +/* + *---------------------------------------------------------------------- + * + * curlDebugProcInvoke -- + * + * This is the function that will be invoked as a callback when the user + * wants to invoke a Tcl procedure to write the debug data produce by + * the verbose option. + * + * Parameter: + * curlHandle: A pointer to the handle for the transfer. + * infoType: Integer with the type of data. + * dataPtr: the data passed to the procedure. + * curlDataPtr: ointer to the curlData structure for the transfer. + * + * Returns + * The number of bytes actually written or -1 in case of error, in + * which case 'libcurl' will abort the transfer. + *----------------------------------------------------------------------- + */ +int +curlDebugProcInvoke(CURL *curlHandle, curl_infotype infoType, + unsigned char * dataPtr, size_t size, void *curlDataPtr) { + struct curlObjData *curlData=(struct curlObjData *)curlDataPtr; + Tcl_Obj *tclProcPtr; + Tcl_Obj *objv[3]; + char tclCommand[300]; + + snprintf(tclCommand,300,"%s %d %d",curlData->debugProc,infoType,size); + tclProcPtr=Tcl_NewStringObj(tclCommand,-1); + + objv[0]=Tcl_NewStringObj(curlData->debugProc,-1); + objv[1]=Tcl_NewIntObj(infoType); + objv[2]=Tcl_NewByteArrayObj(dataPtr,size); + + if (curlData->cancelTransVarName) { + if (curlData->cancelTrans) { + curlData->cancelTrans=0; + return -1; + } + } + + Tcl_EvalObjv(curlData->interp,3,objv,TCL_EVAL_GLOBAL); + + return 0; +} + +/* + *---------------------------------------------------------------------- + * + * curlGetInfo -- + * + * Invokes the 'curl_easy_getinfo' function in libcurl. + * + * Parameter: + * + * Results: + * 0 if all went well. + * The CURLcode for the error. + *---------------------------------------------------------------------- + */ +CURLcode +curlGetInfo(Tcl_Interp *interp,CURL *curlHandle,int tableIndex) { + char *charPtr; + long longNumber; + double doubleNumber; + struct curl_slist *slistPtr; + struct curl_certinfo *certinfoPtr=NULL; + int i; + + CURLcode exitCode; + + Tcl_Obj *resultObjPtr; + + switch(tableIndex) { + case 0: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_EFFECTIVE_URL,&charPtr); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewStringObj(charPtr,-1); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 1: + case 2: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_RESPONSE_CODE,&longNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewLongObj(longNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 3: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_FILETIME,&longNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewLongObj(longNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 4: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_TOTAL_TIME,&doubleNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewDoubleObj(doubleNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 5: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_NAMELOOKUP_TIME, + &doubleNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewDoubleObj(doubleNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 6: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_CONNECT_TIME, + &doubleNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewDoubleObj(doubleNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 7: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_PRETRANSFER_TIME, + &doubleNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewDoubleObj(doubleNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 8: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_SIZE_UPLOAD, + &doubleNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewDoubleObj(doubleNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 9: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_SIZE_DOWNLOAD, + &doubleNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewDoubleObj(doubleNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 10: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_SPEED_DOWNLOAD, + &doubleNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewDoubleObj(doubleNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 11: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_SPEED_UPLOAD, + &doubleNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewDoubleObj(doubleNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 12: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_HEADER_SIZE, + &longNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewLongObj(longNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 13: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_REQUEST_SIZE, + &longNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewLongObj(longNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 14: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_SSL_VERIFYRESULT, + &longNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewLongObj(longNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 15: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_CONTENT_LENGTH_DOWNLOAD, + &doubleNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewDoubleObj(doubleNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 16: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_CONTENT_LENGTH_UPLOAD, + &doubleNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewDoubleObj(doubleNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 17: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_STARTTRANSFER_TIME,&doubleNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewDoubleObj(doubleNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 18: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_CONTENT_TYPE,&charPtr); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewStringObj(charPtr,-1); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 19: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_REDIRECT_TIME,&doubleNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewDoubleObj(doubleNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 20: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_REDIRECT_COUNT,&longNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewLongObj(longNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 21: + case 22: + if (tableIndex==21) { + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_HTTPAUTH_AVAIL,&longNumber); + } else { + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_PROXYAUTH_AVAIL,&longNumber); + } + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewListObj(0,(Tcl_Obj **)NULL); + if (longNumber&CURLAUTH_BASIC) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("basic",-1)); + } + if (longNumber&CURLAUTH_DIGEST) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("digest",-1)); + } + if (longNumber&CURLAUTH_GSSNEGOTIATE) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("gssnegotiate",-1)); + } + if (longNumber&CURLAUTH_NTLM) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("NTLM",-1)); + } + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 23: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_OS_ERRNO,&longNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewLongObj(longNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 24: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_NUM_CONNECTS,&longNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewLongObj(longNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 25: + exitCode=curl_easy_getinfo \ + (curlHandle,CURLINFO_SSL_ENGINES,&slistPtr); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewListObj(0,(Tcl_Obj **)NULL); + while(slistPtr!=NULL) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj(slistPtr->data,-1)); + slistPtr=slistPtr->next; + } + curl_slist_free_all(slistPtr); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 26: + exitCode=curl_easy_getinfo \ + (curlHandle,CURLINFO_HTTP_CONNECTCODE,&longNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewLongObj(longNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 27: + exitCode=curl_easy_getinfo \ + (curlHandle,CURLINFO_COOKIELIST,&slistPtr); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewListObj(0,(Tcl_Obj **)NULL); + while(slistPtr!=NULL) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj(slistPtr->data,-1)); + slistPtr=slistPtr->next; + } + curl_slist_free_all(slistPtr); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 28: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_FTP_ENTRY_PATH,&charPtr); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewStringObj(charPtr,-1); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 29: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_REDIRECT_URL,&charPtr); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewStringObj(charPtr,-1); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 30: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_PRIMARY_IP,&charPtr); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewStringObj(charPtr,-1); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 31: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_APPCONNECT_TIME,&doubleNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewDoubleObj(doubleNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 32: + exitCode=curl_easy_getinfo(curlHandle,CURLINFO_CERTINFO,&certinfoPtr); + if (exitCode) { + return exitCode; + } + charPtr=(char *)Tcl_Alloc(3); + sprintf(charPtr,"%d",certinfoPtr->num_of_certs); + resultObjPtr=Tcl_NewListObj(0,(Tcl_Obj **)NULL); + Tcl_ListObjAppendElement(interp,resultObjPtr,Tcl_NewStringObj(charPtr,-1)); + Tcl_Free(charPtr); + for(i=0; i < certinfoPtr->num_of_certs; i++) { + for(slistPtr = certinfoPtr->certinfo[i]; slistPtr; slistPtr=slistPtr->next) { + Tcl_ListObjAppendElement(interp,resultObjPtr,Tcl_NewStringObj(slistPtr->data,-1)); + } + } + Tcl_SetObjResult(interp,resultObjPtr); + break; + case 33: + exitCode=curl_easy_getinfo \ + (curlHandle,CURLINFO_CONDITION_UNMET,&longNumber); + if (exitCode) { + return exitCode; + } + resultObjPtr=Tcl_NewLongObj(longNumber); + Tcl_SetObjResult(interp,resultObjPtr); + break; + } + return 0; +} + +/* + *---------------------------------------------------------------------- + * + * curlFreeSpace -- + * + * Frees the space taken by a curlObjData struct either because we are + * deleting the handle or reseting it. + * + * Parameter: + * interp: Pointer to the interpreter we are using. + * curlHandle: the curl handle for which the option is set. + * objc and objv: The usual in Tcl. + * + * Results: + * A standard Tcl result. + *---------------------------------------------------------------------- + */ +void +curlFreeSpace(struct curlObjData *curlData) { + + curl_slist_free_all(curlData->headerList); + curl_slist_free_all(curlData->quote); + curl_slist_free_all(curlData->prequote); + curl_slist_free_all(curlData->postquote); + + Tcl_Free(curlData->outFile); + Tcl_Free(curlData->inFile); + Tcl_Free(curlData->proxy); + Tcl_Free(curlData->errorBuffer); + Tcl_Free(curlData->errorBufferName); + Tcl_Free(curlData->errorBufferKey); + Tcl_Free(curlData->stderrFile); + Tcl_Free(curlData->randomFile); + Tcl_Free(curlData->headerVar); + Tcl_Free(curlData->bodyVarName); + if (curlData->bodyVar.memory) { + Tcl_Free(curlData->bodyVar.memory); + } + Tcl_Free(curlData->progressProc); + if (curlData->cancelTransVarName) { + Tcl_UnlinkVar(curlData->interp,curlData->cancelTransVarName); + Tcl_Free(curlData->cancelTransVarName); + } + Tcl_Free(curlData->writeProc); + Tcl_Free(curlData->readProc); + Tcl_Free(curlData->debugProc); + curl_slist_free_all(curlData->http200aliases); + Tcl_Free(curlData->sshkeycallProc); + Tcl_Free(curlData->command); +} + +/* + *---------------------------------------------------------------------- + * + * curlDupHandle -- + * + * This function is invoked by the 'duphandle' command, it will + * create a duplicate of the given handle. + * + * Parameters: + * The stantard parameters for Tcl commands + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ +int +curlDupHandle(Tcl_Interp *interp, struct curlObjData *curlData, + int objc, Tcl_Obj *CONST objv[]) { + + CURL *newCurlHandle; + Tcl_Obj *result; + struct curlObjData *newCurlData; + char *handleName; + + newCurlHandle=curl_easy_duphandle(curlData->curl); + if (newCurlHandle==NULL) { + result=Tcl_NewStringObj("Couldn't create new handle.",-1); + Tcl_SetObjResult(interp,result); + return TCL_ERROR; + } + + newCurlData=(struct curlObjData *)Tcl_Alloc(sizeof(struct curlObjData)); + + curlCopyCurlData(curlData,newCurlData); + + handleName=curlCreateObjCmd(interp,newCurlData); + + newCurlData->curl=newCurlHandle; + + result=Tcl_NewStringObj(handleName,-1); + Tcl_SetObjResult(interp,result); + Tcl_Free(handleName); + + return TCL_OK; +} + + +/* + *---------------------------------------------------------------------- + * + * curlResetHandle -- + * + * This function is invoked by the 'reset' command, it reset all the + * options in the handle to the state it had when 'init' was invoked. + * + * Parameters: + * The stantard parameters for Tcl commands + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ +int +curlResetHandle(Tcl_Interp *interp, struct curlObjData *curlData) { + struct curlObjData *tmpPtr= + (struct curlObjData *)Tcl_Alloc(sizeof(struct curlObjData)); + + tmpPtr->curl = curlData->curl; + tmpPtr->token = curlData->token; + tmpPtr->shareToken = curlData->shareToken; + tmpPtr->interp = curlData->interp; + + curlFreeSpace(curlData); + memset(curlData, 0, sizeof(struct curlObjData)); + + curlData->curl = tmpPtr->curl; + curlData->token = tmpPtr->token; + curlData->shareToken = tmpPtr->shareToken; + curlData->interp = tmpPtr->interp; + + curl_easy_reset(curlData->curl); + + Tcl_Free((char *)tmpPtr); + + return TCL_OK; + +} + +/* + *---------------------------------------------------------------------- + * + * curlVersion -- + * + * This procedure is invoked to process the "curl::init" Tcl command. + * See the user documentation for details on what it does. + * + * Parameters: + * The stantard parameters for Tcl commands + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ +int +curlVersion (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]) { + + Tcl_Obj *versionPtr; + char tclversion[200]; + + sprintf(tclversion,"TclCurl Version %s (%s)",TclCurlVersion, + curl_version()); + versionPtr=Tcl_NewStringObj(tclversion,-1); + Tcl_SetObjResult(interp,versionPtr); + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlEscape -- + * + * This function is invoked to process the "curl::escape" Tcl command. + * See the user documentation for details on what it does. + * + * + * Parameters: + * The stantard parameters for Tcl commands + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ +int +curlEscape(ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]) { + + Tcl_Obj *resultObj; + char *escapedStr; + + escapedStr=curl_easy_escape(NULL,Tcl_GetString(objv[1]),0); + + if(!escapedStr) { + resultObj=Tcl_NewStringObj("curl::escape bad parameter",-1); + Tcl_SetObjResult(interp,resultObj); + return TCL_ERROR; + } + resultObj=Tcl_NewStringObj(escapedStr,-1); + Tcl_SetObjResult(interp,resultObj); + curl_free(escapedStr); + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlUnescape -- + * + * This function is invoked to process the "curl::Unescape" Tcl command. + * See the user documentation for details on what it does. + * + * + * Parameters: + * The stantard parameters for Tcl commands + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ +int +curlUnescape(ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]) { + + Tcl_Obj *resultObj; + char *unescapedStr; + + unescapedStr=curl_easy_unescape(NULL,Tcl_GetString(objv[1]),0,NULL); + if(!unescapedStr) { + resultObj=Tcl_NewStringObj("curl::unescape bad parameter",-1); + Tcl_SetObjResult(interp,resultObj); + return TCL_ERROR; + } + resultObj=Tcl_NewStringObj(unescapedStr,-1); + Tcl_SetObjResult(interp,resultObj); + curl_free(unescapedStr); + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlVersionInfo -- + * + * This function invokes 'curl_version_info' to query how 'libcurl' was + * compiled. + * + * Parameters: + * The standard parameters for Tcl commands, but nothing is used. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ +int +curlVersionInfo (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]) { + + int tableIndex; + int i; + curl_version_info_data *infoPtr; + Tcl_Obj *resultObjPtr=NULL; + char tmp[7]; + + if (objc!=2) { + resultObjPtr=Tcl_NewStringObj("usage: curl::versioninfo -option",-1); + Tcl_SetObjResult(interp,resultObjPtr); + return TCL_ERROR; + } + + if (Tcl_GetIndexFromObj(interp, objv[1], versionInfoTable, "option", + TCL_EXACT,&tableIndex)==TCL_ERROR) { + return TCL_ERROR; + } + + infoPtr=curl_version_info(CURLVERSION_NOW); + + switch(tableIndex) { + case 0: + resultObjPtr=Tcl_NewStringObj(infoPtr->version,-1); + break; + case 1: + sprintf(tmp,"%X",infoPtr->version_num); + resultObjPtr=Tcl_NewStringObj(tmp,-1); + break; + case 2: + resultObjPtr=Tcl_NewStringObj(infoPtr->host,-1); + break; + case 3: + resultObjPtr=Tcl_NewListObj(0,(Tcl_Obj **)NULL); + if (infoPtr->features&CURL_VERSION_IPV6) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("IPV6",-1)); + } + if (infoPtr->features&CURL_VERSION_KERBEROS4) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("KERBEROS4",-1)); + } + if (infoPtr->features&CURL_VERSION_SSL) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("SSL",-1)); + } + if (infoPtr->features&CURL_VERSION_LIBZ) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("LIBZ",-1)); + } + if (infoPtr->features&CURL_VERSION_NTLM) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("NTLM",-1)); + } + if (infoPtr->features&CURL_VERSION_GSSNEGOTIATE) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("GSSNEGOTIATE",-1)); + } + if (infoPtr->features&CURL_VERSION_DEBUG) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("DEBUG",-1)); + } + if (infoPtr->features&CURL_VERSION_ASYNCHDNS) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("ASYNCHDNS",-1)); + } + if (infoPtr->features&CURL_VERSION_SPNEGO) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("SPNEGO",-1)); + } + if (infoPtr->features&CURL_VERSION_LARGEFILE) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("LARGEFILE",-1)); + } + if (infoPtr->features&CURL_VERSION_IDN) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("IDN",-1)); + } + if (infoPtr->features&CURL_VERSION_SSPI) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("SSPI",-1)); + } + break; + if (infoPtr->features&CURL_VERSION_CONV) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj("CONV",-1)); + } + case 4: + resultObjPtr=Tcl_NewStringObj(infoPtr->ssl_version,-1); + break; + case 5: + resultObjPtr=Tcl_NewLongObj(infoPtr->ssl_version_num); + break; + case 6: + resultObjPtr=Tcl_NewStringObj(infoPtr->libz_version,-1); + break; + case 7: + resultObjPtr=Tcl_NewListObj(0,(Tcl_Obj **)NULL); + for(i=0;;i++) { + if (infoPtr->protocols[i]!=NULL) { + Tcl_ListObjAppendElement(interp,resultObjPtr + ,Tcl_NewStringObj(infoPtr->protocols[i],-1)); + } else { + break; + } + } + } + + Tcl_SetObjResult(interp,resultObjPtr); + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlCopyCurlData -- + * + * This function copies the contents of a curlData struct into another. + * + * Parameters: + * curlDataOld: The original one. + * curlDataNew: The new one + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ +int +curlCopyCurlData (struct curlObjData *curlDataOld, + struct curlObjData *curlDataNew) { + + /* This takes care of the int and long values */ + memcpy(curlDataNew, curlDataOld, sizeof(struct curlObjData)); + + /* Some of the data doesn't get copied */ + + curlDataNew->headerList=NULL; + curlDataNew->quote=NULL; + curlDataNew->prequote=NULL; + curlDataNew->postquote=NULL; + curlDataNew->formArray=NULL; + curlDataNew->postListFirst=NULL; + curlDataNew->postListLast=NULL; + curlDataNew->formArray=NULL; + curlDataNew->outHandle=NULL; + curlDataNew->outFlag=0; + curlDataNew->inHandle=NULL; + curlDataNew->inFlag=0; + curlDataNew->headerHandle=NULL; + curlDataNew->headerFlag=0; + curlDataNew->stderrHandle=NULL; + curlDataNew->stderrFlag=0; + curlDataNew->http200aliases=NULL; + + /* The strings need a special treatment. */ + + curlDataNew->outFile=curlstrdup(curlDataOld->outFile); + curlDataNew->inFile=curlstrdup(curlDataOld->inFile); + curlDataNew->proxy=curlstrdup(curlDataOld->proxy); + curlDataNew->errorBuffer=curlstrdup(curlDataOld->errorBuffer); + curlDataNew->errorBufferName=curlstrdup(curlDataOld->errorBufferName); + curlDataNew->errorBufferKey=curlstrdup(curlDataOld->errorBufferKey); + curlDataNew->headerFile=curlstrdup(curlDataOld->headerFile); + curlDataNew->stderrFile=curlstrdup(curlDataOld->stderrFile); + curlDataNew->randomFile=curlstrdup(curlDataOld->randomFile); + curlDataNew->headerVar=curlstrdup(curlDataOld->headerVar); + curlDataNew->bodyVarName=curlstrdup(curlDataOld->bodyVarName); + curlDataNew->progressProc=curlstrdup(curlDataOld->progressProc); + curlDataNew->cancelTransVarName=curlstrdup(curlDataOld->cancelTransVarName); + curlDataNew->writeProc=curlstrdup(curlDataOld->writeProc); + curlDataNew->readProc=curlstrdup(curlDataOld->readProc); + curlDataNew->debugProc=curlstrdup(curlDataOld->debugProc); + curlDataNew->command=curlstrdup(curlDataOld->command); + curlDataNew->sshkeycallProc=curlstrdup(curlDataOld->sshkeycallProc); + + curlDataNew->bodyVar.memory=(char *)Tcl_Alloc(curlDataOld->bodyVar.size); + memcpy(curlDataNew->bodyVar.memory,curlDataOld->bodyVar.memory + ,curlDataOld->bodyVar.size); + curlDataNew->bodyVar.size=curlDataOld->bodyVar.size; + + return TCL_OK; +} + +/*---------------------------------------------------------------------- + * + * curlOpenFiles -- + * + * Before doing a transfer with the easy interface or adding an easy + * handle to a multi one, this function takes care of opening all + * necessary files for the transfer. + * + * Parameter: + * curlData: The pointer to the struct with the transfer data. + * + * Results: + * '0' all went well, '1' in case of error. + *---------------------------------------------------------------------- + */ +int +curlOpenFiles(Tcl_Interp *interp,struct curlObjData *curlData) { + + if (curlData->outFlag) { + if (curlOpenFile(interp,curlData->outFile,&(curlData->outHandle),1, + curlData->transferText)) { + return 1; + } + curl_easy_setopt(curlData->curl,CURLOPT_WRITEDATA,curlData->outHandle); + } + if (curlData->inFlag) { + if (curlOpenFile(interp,curlData->inFile,&(curlData->inHandle),0, + curlData->transferText)) { + return 1; + } + curl_easy_setopt(curlData->curl,CURLOPT_READDATA,curlData->inHandle); + if (curlData->anyAuthFlag) { + curl_easy_setopt(curlData->curl, CURLOPT_SEEKFUNCTION, curlseek); + curl_easy_setopt(curlData->curl, CURLOPT_SEEKDATA, curlData->inHandle); + } + } + if (curlData->headerFlag) { + if (curlOpenFile(interp,curlData->headerFile,&(curlData->headerHandle),1,1)) { + return 1; + } + curl_easy_setopt(curlData->curl,CURLOPT_HEADERDATA,curlData->headerHandle); + } + if (curlData->stderrFlag) { + if (curlOpenFile(interp,curlData->stderrFile,&(curlData->stderrHandle),1,1)) { + return 1; + } + curl_easy_setopt(curlData->curl,CURLOPT_STDERR,curlData->stderrHandle); + } + return 0; +} + +/*---------------------------------------------------------------------- + * + * curlCloseFiles -- + * + * Closes the files opened during a transfer. + * + * Parameter: + * curlData: The pointer to the struct with the transfer data. + * + *---------------------------------------------------------------------- + */ +void +curlCloseFiles(struct curlObjData *curlData) { + if (curlData->outHandle!=NULL) { + fclose(curlData->outHandle); + curlData->outHandle=NULL; + } + if (curlData->inHandle!=NULL) { + fclose(curlData->inHandle); + curlData->inHandle=NULL; + } + if (curlData->headerHandle!=NULL) { + fclose(curlData->headerHandle); + curlData->headerHandle=NULL; + } + if (curlData->stderrHandle!=NULL) { + fclose(curlData->stderrHandle); + curlData->stderrHandle=NULL; + } +} + +/*---------------------------------------------------------------------- + * + * curlOpenFile -- + * + * Opens a file to be used during a transfer. + * + * Parameter: + * fileName: name of the file. + * handle: the handle for the file + * writing: '0' if reading, '1' if writing. + * text: '0' if binary, '1' if text. + * + * Results: + * '0' all went well, '1' in case of error. + *---------------------------------------------------------------------- + */ +int +curlOpenFile(Tcl_Interp *interp,char *fileName, FILE **handle, int writing, int text) { + Tcl_Obj *resultObjPtr; + char errorMsg[300]; + + if (*handle!=NULL) { + fclose(*handle); + } + if (writing==1) { + if (text==1) { + *handle=fopen(fileName,"w"); + } else { + *handle=fopen(fileName,"wb"); + } + } else { + if (text==1) { + *handle=fopen(fileName,"r"); + } else { + *handle=fopen(fileName,"rb"); + } + } + if (*handle==NULL) { + snprintf(errorMsg,300,"Couldn't open file %s.",fileName); + resultObjPtr=Tcl_NewStringObj(errorMsg,-1); + Tcl_SetObjResult(interp,resultObjPtr); + return 1; + } + return 0; +} + +/*---------------------------------------------------------------------- + * + * curlseek -- + * + * When the user requests the 'any' auth, libcurl may need + * to send the PUT/POST data more than once and thus may need to ask + * the app to "rewind" the read data stream to start. + * + *---------------------------------------------------------------------- + */ + +static curlioerr curlseek(void *instream, curl_off_t offset, int origin) +{ + if(-1 == fseek((FILE *)instream, 0, origin)) { + return CURLIOE_FAILRESTART; + } + + return CURLIOE_OK; +} + +/*---------------------------------------------------------------------- + * + * curlSetPostData -- + * + * In case there is going to be a post transfer, this function sets the + * data that is going to be posted. + * + * Parameter: + * interp: Tcl interpreter we are using. + * curlData: A pointer to the struct with the transfer data. + * + * Results: + * A standard Tcl result. + *---------------------------------------------------------------------- + */ +int +curlSetPostData(Tcl_Interp *interp,struct curlObjData *curlDataPtr) { + Tcl_Obj *errorMsgObjPtr; + + if (curlDataPtr->postListFirst!=NULL) { + if (curl_easy_setopt(curlDataPtr->curl,CURLOPT_HTTPPOST,curlDataPtr->postListFirst)) { + curl_formfree(curlDataPtr->postListFirst); + errorMsgObjPtr=Tcl_NewStringObj("Error setting the data to post",-1); + Tcl_SetObjResult(interp,errorMsgObjPtr); + return TCL_ERROR; + } + } + return TCL_OK; +} + +/*---------------------------------------------------------------------- + * + * curlResetPostData -- + * + * After performing a transfer, this function is invoked to erease the + * posr data. + * + * Parameter: + * curlData: A pointer to the struct with the transfer data. + *---------------------------------------------------------------------- + */ +void +curlResetPostData(struct curlObjData *curlDataPtr) { + struct formArrayStruct *tmpPtr; + + if (curlDataPtr->postListFirst) { + curl_formfree(curlDataPtr->postListFirst); + curlDataPtr->postListFirst=NULL; + curlDataPtr->postListLast=NULL; + curl_easy_setopt(curlDataPtr->curl,CURLOPT_HTTPPOST,NULL); + + while(curlDataPtr->formArray!=NULL) { + if (curlDataPtr->formArray->formHeaderList!=NULL) { + curl_slist_free_all(curlDataPtr->formArray->formHeaderList); + curlDataPtr->formArray->formHeaderList=NULL; + } + curlResetFormArray(curlDataPtr->formArray->formArray); + tmpPtr=curlDataPtr->formArray->next; + Tcl_Free((char *)curlDataPtr->formArray); + curlDataPtr->formArray=tmpPtr; + } + } +} +/*---------------------------------------------------------------------- + * + * curlResetFormArray -- + * + * Cleans the contents of the formArray, it is done after a transfer or + * if 'curl_formadd' returns an error. + * + * Parameter: + * formArray: A pointer to the array to clean up. + *---------------------------------------------------------------------- + */ +void +curlResetFormArray(struct curl_forms *formArray) { + int i; + + for (i=0;formArray[i].option!=CURLFORM_END;i++) { + switch (formArray[i].option) { + case CURLFORM_COPYNAME: + case CURLFORM_COPYCONTENTS: + case CURLFORM_FILE: + case CURLFORM_CONTENTTYPE: + case CURLFORM_FILENAME: + case CURLFORM_FILECONTENT: + case CURLFORM_BUFFER: + case CURLFORM_BUFFERPTR: + Tcl_Free((char *)(formArray[i].value)); + break; + default: + break; + } + } + Tcl_Free((char *)formArray); +} + +/*---------------------------------------------------------------------- + * + * curlSetBodyVarName -- + * + * After performing a transfer, this function is invoked to set the + * body of the recieved transfer into a user defined Tcl variable. + * + * Parameter: + * interp: The Tcl interpreter we are using. + * curlData: A pointer to the struct with the transfer data. + *---------------------------------------------------------------------- + */ +void +curlSetBodyVarName(Tcl_Interp *interp,struct curlObjData *curlDataPtr) { + Tcl_Obj *bodyVarNameObjPtr, *bodyVarObjPtr; + + bodyVarNameObjPtr=Tcl_NewStringObj(curlDataPtr->bodyVarName,-1); + bodyVarObjPtr=Tcl_NewByteArrayObj((unsigned char *)curlDataPtr->bodyVar.memory, + curlDataPtr->bodyVar.size); + + Tcl_ObjSetVar2(interp,bodyVarNameObjPtr,(Tcl_Obj *)NULL,bodyVarObjPtr,0); + + curlDataPtr->bodyVar.size=0; + + Tcl_Free(curlDataPtr->bodyVarName); + curlDataPtr->bodyVarName=NULL; +} + +/*---------------------------------------------------------------------- + * + * curlstrdup -- + * The same as strdup, but won't seg fault if the string to copy is NULL. + * + * Parameter: + * old: The original one. + * + * Results: + * Returns a pointer to the new string. + *---------------------------------------------------------------------- + */ +char +*curlstrdup (char *old) { + char *tmpPtr; + + if (old==NULL) { + return NULL; + } + tmpPtr=Tcl_Alloc(strlen(old)+1); + strcpy(tmpPtr,old); + + return tmpPtr; +} + +/* + *---------------------------------------------------------------------- + * + * curlShareInitObjCmd -- + * + * Looks for the first free share handle (scurl1, scurl2,...) and + * creates a Tcl command for it. + * + * Results: + * A string with the name of the handle, don't forget to free it. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ + +char * +curlCreateShareObjCmd (Tcl_Interp *interp,struct shcurlObjData *shcurlData) { + char *shandleName; + int i; + Tcl_CmdInfo info; + Tcl_Command cmdToken; + + /* We try with scurl1, if it already exists with scurl2...*/ + shandleName=(char *)Tcl_Alloc(10); + for (i=1;;i++) { + sprintf(shandleName,"scurl%d",i); + if (!Tcl_GetCommandInfo(interp,shandleName,&info)) { + cmdToken=Tcl_CreateObjCommand(interp,shandleName,curlShareObjCmd, + (ClientData)shcurlData, + (Tcl_CmdDeleteProc *)curlCleanUpShareCmd); + break; + } + } + shcurlData->token=cmdToken; + + return shandleName; +} + +/* + *---------------------------------------------------------------------- + * + * curlShareInitObjCmd -- + * + * This procedure is invoked to process the "curl::shareinit" Tcl command. + * See the user documentation for details on what it does. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ + +int +curlShareInitObjCmd (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]) { + + Tcl_Obj *resultPtr; + CURL *shcurlHandle; + struct shcurlObjData *shcurlData; + char *shandleName; + + shcurlData=(struct shcurlObjData *)Tcl_Alloc(sizeof(struct shcurlObjData)); + if (shcurlData==NULL) { + resultPtr=Tcl_NewStringObj("Couldn't allocate memory",-1); + Tcl_SetObjResult(interp,resultPtr); + return TCL_ERROR; + } + + memset(shcurlData, 0, sizeof(struct shcurlObjData)); + + shcurlHandle=curl_share_init(); + if (shcurlHandle==NULL) { + resultPtr=Tcl_NewStringObj("Couldn't create share handle",-1); + Tcl_SetObjResult(interp,resultPtr); + return TCL_ERROR; + } + + shandleName=curlCreateShareObjCmd(interp,shcurlData); + + shcurlData->shandle=shcurlHandle; + + resultPtr=Tcl_NewStringObj(shandleName,-1); + Tcl_SetObjResult(interp,resultPtr); + Tcl_Free(shandleName); + +#ifdef TCL_THREADS + curl_share_setopt(shcurlHandle, CURLSHOPT_LOCKFUNC, curlShareLockFunc); + curl_share_setopt(shcurlHandle, CURLSHOPT_LOCKFUNC, curlShareUnLockFunc); +#endif + + return TCL_OK; +} + +#ifdef TCL_THREADS +/* + *---------------------------------------------------------------------- + * + * curlShareLockFunc -- + * + * This will be the function invoked by libcurl when it wants to lock + * some data for the share interface. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ + +void +curlShareLockFunc (CURL *handle, curl_lock_data data, curl_lock_access access + , void *userptr) { + + switch(data) { + CURL_LOCK_DATA_COOKIE: + Tcl_MutexLock(&cookieLock); + break; + CURL_LOCK_DATA_DNS: + Tcl_MutexLock(&dnsLock); + break; + CURL_LOCK_DATA_SSL_SESSION: + Tcl_MutexLock(&sslLock); + break; + CURL_LOCK_DATA_CONNECT: + Tcl_MutexLock(&connectLock); + break; + default: + /* Prevent useless compile warnings */ + break; + } +} + +/* + *---------------------------------------------------------------------- + * + * curlShareUnLockFunc -- + * + * This will be the function invoked by libcurl when it wants to unlock + * the previously locked data. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ +void +curlShareUnLockFunc(CURL *handle, curl_lock_data data, void *userptr) { + + switch(data) { + CURL_LOCK_DATA_COOKIE: + Tcl_MutexUnlock(&cookieLock); + break; + CURL_LOCK_DATA_DNS: + Tcl_MutexUnlock(&dnsLock); + break; + CURL_LOCK_DATA_SSL_SESSION: + Tcl_MutexUnlock(&sslLock); + break; + CURL_LOCK_DATA_CONNECT: + Tcl_MutexUnlock(&connectLock); + break; + default: + break; + } +} + +#endif + +/* + *---------------------------------------------------------------------- + * + * curlShareObjCmd -- + * + * This procedure is invoked to process the "share curl" commands. + * See the user documentation for details on what it does. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ +int +curlShareObjCmd (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]) { + + struct shcurlObjData *shcurlData=(struct shcurlObjData *)clientData; + CURLSH *shcurlHandle=shcurlData->shandle; + int tableIndex, dataIndex; + int dataToLock=0; + + if (objc<2) { + Tcl_WrongNumArgs(interp,1,objv,"option arg ?arg?"); + return TCL_ERROR; + } + + if (Tcl_GetIndexFromObj(interp, objv[1], shareCmd, "option",TCL_EXACT,&tableIndex)==TCL_ERROR) { + return TCL_ERROR; + } + + switch(tableIndex) { + case 0: + case 1: + if (Tcl_GetIndexFromObj(interp, objv[2], lockData, + "data to lock ",TCL_EXACT,&dataIndex)==TCL_ERROR) { + return TCL_ERROR; + } + switch(dataIndex) { + case 0: + dataToLock=CURL_LOCK_DATA_COOKIE; + break; + case 1: + dataToLock=CURL_LOCK_DATA_DNS; + break; + } + if (tableIndex==0) { + curl_share_setopt(shcurlHandle, CURLSHOPT_SHARE, dataToLock); + } else { + curl_share_setopt(shcurlHandle, CURLSHOPT_UNSHARE, dataToLock); + } + break; + case 2: + Tcl_DeleteCommandFromToken(interp,shcurlData->token); + break; + } + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlCleanUpShareCmd -- + * + * This procedure is invoked when curl share handle is deleted. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * Cleans the curl share handle and frees the memory. + * + *---------------------------------------------------------------------- + */ +int +curlCleanUpShareCmd(ClientData clientData) { + struct shcurlObjData *shcurlData=(struct shcurlObjData *)clientData; + CURLSH *shcurlHandle=shcurlData->shandle; + + curl_share_cleanup(shcurlHandle); + Tcl_Free((char *)shcurlData); + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlErrorStrings -- + * + * All the commands to return the error string from the error code have + * this function in common. + * + * Results: + * '0': All went well. + * '1': The error code didn't make sense. + *---------------------------------------------------------------------- + */ +int +curlErrorStrings (Tcl_Interp *interp, Tcl_Obj *CONST objv,int type) { + + Tcl_Obj *resultPtr; + int errorCode; + char errorMsg[500]; + + if (Tcl_GetIntFromObj(interp,objv,&errorCode)) { + snprintf(errorMsg,500,"Invalid error code: %s",Tcl_GetString(objv)); + resultPtr=Tcl_NewStringObj(errorMsg,-1); + Tcl_SetObjResult(interp,resultPtr); + return 1; + } + switch(type) { + case 0: + resultPtr=Tcl_NewStringObj(curl_easy_strerror(errorCode),-1); + break; + case 1: + resultPtr=Tcl_NewStringObj(curl_share_strerror(errorCode),-1); + break; + case 2: + resultPtr=Tcl_NewStringObj(curl_multi_strerror(errorCode),-1); + break; + default: + resultPtr=Tcl_NewStringObj("You're kidding,right?",-1); + } + Tcl_SetObjResult(interp,resultPtr); + + return 0; +} + +/* + *---------------------------------------------------------------------- + * + * curlEasyStringError -- + * + * This function is invoked to process the "curl::easystrerror" Tcl command. + * It will return a string with an explanation of the error code given. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * The interpreter will contain as a result the string with the error + * message. + * + *---------------------------------------------------------------------- + */ +int +curlEasyStringError (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]) { + + if (objc<2) { + Tcl_WrongNumArgs(interp,1,objv,"errorCode"); + return TCL_ERROR; + } + + if (curlErrorStrings(interp,objv[1],0)) { + return TCL_ERROR; + } + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlShareStringError -- + * + * This function is invoked to process the "curl::sharestrerror" Tcl command. + * It will return a string with an explanation of the error code given. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * The interpreter will contain as a result the string with the error + * message. + * + *---------------------------------------------------------------------- + */ +int +curlShareStringError (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]) { + + if (objc<2) { + Tcl_WrongNumArgs(interp,1,objv,"errorCode"); + return TCL_ERROR; + } + + if (curlErrorStrings(interp,objv[1],1)) { + return TCL_ERROR; + } + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * curlMultiStringError -- + * + * This function is invoked to process the "curl::multirerror" Tcl command. + * It will return a string with an explanation of the error code given. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * The interpreter will contain as a result the string with the error + * message. + * + *---------------------------------------------------------------------- + */ +int +curlMultiStringError (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]) { + + if (objc<2) { + Tcl_WrongNumArgs(interp,1,objv,"errorCode"); + return TCL_ERROR; + } + + if (curlErrorStrings(interp,objv[1],2)) { + return TCL_ERROR; + } + return TCL_OK; +} diff --git a/generic/tclcurl.h b/generic/tclcurl.h new file mode 100755 index 0000000..01f4c4b --- /dev/null +++ b/generic/tclcurl.h @@ -0,0 +1,482 @@ +/* + * tclcurl.h -- + * + * Header file for the TclCurl extension to enable Tcl interpreters + * to access libcurl. + * + * Copyright (c) 2001-2009 Andres Garcia Garcia. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + */ + +#if (defined(WIN32) || defined(_WIN32)) +#define CURL_STATICLIB 1 +#endif + +#include +#include +#include +#include +#include +#include +#include + +#define _MPRINTF_REPLACE +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Windows needs to know which symbols to export. Unix does not. + * BUILD_tclcurl should be undefined for Unix. + * Actually I don't use this, but it was in TEA so I keep in case + * I ever understand what it is for. + */ + +#ifdef BUILD_tclcurl +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLEXPORT +#endif + +#define TclCurlVersion "7.19.6" + +/* + * This struct will contain the data of a transfer if the user wants + * to put the body into a Tcl variable + */ +struct MemoryStruct { + char *memory; + size_t size; +}; + +/* + * Struct that will be used for a linked list with all the + * data for a post + */ +struct formArrayStruct { + struct curl_forms *formArray; + struct curl_slist *formHeaderList; + struct formArrayStruct *next; +}; + +struct curlObjData { + CURL *curl; + Tcl_Command token; + Tcl_Command shareToken; + Tcl_Interp *interp; + struct curl_slist *headerList; + struct curl_slist *quote; + struct curl_slist *prequote; + struct curl_slist *postquote; + struct curl_httppost *postListFirst; + struct curl_httppost *postListLast; + struct formArrayStruct *formArray; + char *outFile; + FILE *outHandle; + int outFlag; + char *inFile; + FILE *inHandle; + int inFlag; + char *proxy; + int transferText; + char *errorBuffer; + char *errorBufferName; + char *errorBufferKey; + char *headerFile; + FILE *headerHandle; + int headerFlag; + char *stderrFile; + FILE *stderrHandle; + int stderrFlag; + char *randomFile; + char *headerVar; + char *bodyVarName; + struct MemoryStruct bodyVar; + char *progressProc; + char *cancelTransVarName; + int cancelTrans; + char *writeProc; + char *readProc; + char *debugProc; + struct curl_slist *http200aliases; + char *command; + int anyAuthFlag; + char *sshkeycallProc; +}; + +struct shcurlObjData { + Tcl_Command token; + CURLSH *shandle; +}; + +#ifndef multi_h + +CONST static char *commandTable[] = { + "setopt", + "perform", + "getinfo", + "cleanup", + "configure", + "duphandle", + "reset", + "pause", + "resume", + (char *) NULL +}; + +CONST static char *optionTable[] = { + "CURLOPT_URL", "CURLOPT_FILE", "CURLOPT_INFILE", + "CURLOPT_USERAGENT", "CURLOPT_REFERER", "CURLOPT_VERBOSE", + "CURLOPT_HEADER", "CURLOPT_NOBODY", "CURLOPT_PROXY", + "CURLOPT_PROXYPORT", "CURLOPT_HTTPPROXYTUNNEL", "CURLOPT_FAILONERROR", + "CURLOPT_TIMEOUT", "CURLOPT_LOW_SPEED_LIMIT", "CURLOPT_LOW_SPEED_TIME", + "CURLOPT_RESUME_FROM", "CURLOPT_INFILESIZE", "CURLOPT_UPLOAD", + "CURLOPT_FTPLISTONLY", "CURLOPT_FTPAPPEND", "CURLOPT_NETRC", + "CURLOPT_FOLLOWLOCATION","CURLOPT_TRANSFERTEXT", "CURLOPT_PUT", + "CURLOPT_MUTE", "CURLOPT_USERPWD", "CURLOPT_PROXYUSERPWD", + "CURLOPT_RANGE", "CURLOPT_ERRORBUFFER", "CURLOPT_HTTPGET", + "CURLOPT_POST", "CURLOPT_POSTFIELDS", "CURLOPT_POSTFIELDSIZE", + "CURLOPT_FTPPORT", "CURLOPT_COOKIE", "CURLOPT_COOKIEFILE", + "CURLOPT_HTTPHEADER", "CURLOPT_HTTPPOST", "CURLOPT_SSLCERT", + "CURLOPT_SSLCERTPASSWD", "CURLOPT_SSLVERSION", "CURLOPT_CRLF", + "CURLOPT_QUOTE", "CURLOPT_POSTQUOTE", "CURLOPT_WRITEHEADER", + "CURLOPT_TIMECONDITION", "CURLOPT_TIMEVALUE", "CURLOPT_CUSTOMREQUEST", + "CURLOPT_STDERR", "CURLOPT_INTERFACE", "CURLOPT_KRB4LEVEL", + "CURLOPT_SSL_VERIFYPEER","CURLOPT_CAINFO", "CURLOPT_FILETIME", + "CURLOPT_MAXREDIRS", "CURLOPT_MAXCONNECTS", "CURLOPT_CLOSEPOLICY", + "CURLOPT_RANDOM_FILE", "CURLOPT_EGDSOCKET", "CURLOPT_CONNECTTIMEOUT", + "CURLOPT_NOPROGRESS", "CURLOPT_HEADERVAR", "CURLOPT_BODYVAR", + "CURLOPT_PROGRESSPROC","CURLOPT_CANCELTRANSVARNAME","CURLOPT_WRITEPROC", + "CURLOPT_READPROC", "CURLOPT_SSL_VERIFYHOST", "CURLOPT_COOKIEJAR", + "CURLOPT_SSL_CIPHER_LIST","CURLOPT_HTTP_VERSION", "CURLOPT_FTP_USE_EPSV", + "CURLOPT_SSLCERTTYPE", "CURLOPT_SSLKEY", "CURLOPT_SSLKEYTYPE", + "CURLOPT_SSLKEYPASSWD", "CURLOPT_SSL_ENGINE", "CURLOPT_SSL_ENGINEDEFAULT", + "CURLOPT_PREQUOTE", "CURLOPT_DEBUGPROC", "CURLOPT_DNS_CACHE_TIMEOUT", + "CURLOPT_DNS_USE_GLOBAL_CACHE", "CURLOPT_COOKIESESSION","CURLOPT_CAPATH", + "CURLOPT_BUFFERSIZE", "CURLOPT_NOSIGNAL", "CURLOPT_ENCODING", + "CURLOPT_PROXYTYPE", "CURLOPT_HTTP200ALIASES", "CURLOPT_UNRESTRICTED_AUTH", + "CURLOPT_FTP_USE_EPRT", "CURLOPT_NOSUCHOPTION", "CURLOPT_HTTPAUTH", + "CURLOPT_FTP_CREATE_MISSING_DIRS", "CURLOPT_PROXYAUTH", + "CURLOPT_FTP_RESPONSE_TIMEOUT", "CURLOPT_IPRESOLVE", + "CURLOPT_MAXFILESIZE", "CURLOPT_NETRC_FILE", "CURLOPT_FTP_SSL", + "CURLOPT_SHARE", "CURLOPT_PORT", "CURLOPT_TCP_NODELAY", + "CURLOPT_AUTOREFERER", "CURLOPT_SOURCE_HOST", "CURLOPT_SOURCE_USERPWD", + "CURLOPT_SOURCE_PATH", "CURLOPT_SOURCE_PORT", "CURLOPT_PASV_HOST", + "CURLOPT_SOURCE_PREQUOTE","CURLOPT_SOURCE_POSTQUOTE", + "CURLOPT_FTPSSLAUTH", "CURLOPT_SOURCE_URL", "CURLOPT_SOURCE_QUOTE", + "CURLOPT_FTP_ACCOUNT", "CURLOPT_IGNORE_CONTENT_LENGTH", + "CURLOPT_COOKIELIST", "CURLOPT_FTP_SKIP_PASV_IP", + "CURLOPT_FTP_FILEMETHOD", "CURLOPT_LOCALPORT", "CURLOPT_LOCALPORTRANGE", + "CURLOPT_MAX_SEND_SPEED_LARGE", "CURLOPT_MAX_RECV_SPEED_LARGE", + "CURLOPT_FTP_ALTERNATIVE_TO_USER", "CURLOPT_SSL_SESSIONID_CACHE", + "CURLOPT_SSH_AUTH_TYPES", "CURLOPT_SSH_PUBLIC_KEYFILE", + "CURLOPT_SSH_PRIVATE_KEYFILE", "CURLOPT_TIMEOUT_MS", + "CURLOPT_CONNECTTIMEOUT_MS", "CURLOPT_HTTP_CONTENT_DECODING", + "CURLOPT_HTTP_TRANSFER_DECODING", "CURLOPT_KRBLEVEL", + "CURLOPT_NEW_FILE_PERMS", "CURLOPT_NEW_DIRECTORY_PERMS", + "CURLOPT_KEYPASSWD", "CURLOPT_APPEND", "CURLOPT_DIRLISTONLY", + "CURLOPT_USE_SSL", "CURLOPT_POST301", "CURLOPT_SSH_HOST_PUBLIC_KEY_MD5", + "CURLOPT_PROXY_TRANSFER_MODE", "CURLOPT_CRLFILE", + "CURLOPT_ISSUERCERT", "CURLOPT_ADDRESS_SCOPE", "CURLOPT_CERTINFO", + "CURLOPT_POSTREDIR", "CURLOPT_USERNAME", "CURLOPT_PASSWORD", + "CURLOPT_PROXYUSERNAME", "CURLOPT_PROXYPASSWORD", "CURLOPT_TFTP_BLKSIZE", + "CURLOPT_SOCKS5_GSSAPI_SERVICE", "CURLOPT_SOCKS5_GSSAPI_NEC", + "CURLOPT_PROTOCOLS", "CURLOPT_REDIR_PROTOCOLS","CURLOPT_FTP_SSL_CC", + "CURLOPT_SSH_KNOWNHOSTS", "CURLOPT_SSH_KEYFUNCTION", + (char *)NULL +}; + +CONST static char *configTable[] = { + "-url", "-file", "-infile", + "-useragent", "-referer", "-verbose", + "-header", "-nobody", "-proxy", + "-proxyport", "-httpproxytunnel", "-failonerror", + "-timeout", "-lowspeedlimit", "-lowspeedtime", + "-resumefrom", "-infilesize", "-upload", + "-ftplistonly", "-ftpappend", "-netrc", + "-followlocation", "-transfertext", "-put", + "-mute", "-userpwd", "-proxyuserpwd", + "-range", "-errorbuffer", "-httpget", + "-post", "-postfields", "-postfieldssize", + "-ftpport", "-cookie", "-cookiefile", + "-httpheader", "-httppost", "-sslcert", + "-sslcertpasswd", "-sslversion", "-crlf", + "-quote", "-postquote", "-writeheader", + "-timecondition", "-timevalue", "-customrequest", + "-stderr", "-interface", "-krb4level", + "-sslverifypeer", "-cainfo", "-filetime", + "-maxredirs", "-maxconnects", "-closepolicy", + "-randomfile", "-egdsocket", "-connecttimeout", + "-noprogress", "-headervar", "-bodyvar", + "-progressproc", "-canceltransvarname", "-writeproc", + "-readproc", "-sslverifyhost", "-cookiejar", + "-sslcipherlist", "-httpversion", "-ftpuseepsv", + "-sslcerttype", "-sslkey", "-sslkeytype", + "-sslkeypasswd", "-sslengine", "-sslenginedefault", + "-prequote", "-debugproc", "-dnscachetimeout", + "-dnsuseglobalcache", "-cookiesession", "-capath", + "-buffersize", "-nosignal", "-encoding", + "-proxytype", "-http200aliases", "-unrestrictedauth", + "-ftpuseeprt", "-command", "-httpauth", + "-ftpcreatemissingdirs", "-proxyauth", + "-ftpresponsetimeout", "-ipresolve", + "-maxfilesize", "-netrcfile", "-ftpssl", + "-share", "-port", "-tcpnodelay", + "-autoreferer", "-sourcehost", "-sourceuserpwd", + "-sourcepath", "-sourceport", "-pasvhost", + "-sourceprequote", "-sourcepostquote", "-ftpsslauth", + "-sourceurl", "-sourcequote", "-ftpaccount", + "-ignorecontentlength", "-cookielist", + "-ftpskippasvip", "-ftpfilemethod", "-localport", + "-localportrange", + "-maxsendspeed", "-maxrecvspeed", + "-ftpalternativetouser", "-sslsessionidcache", + "-sshauthtypes", "-sshpublickeyfile", "-sshprivatekeyfile", + "-timeoutms", "-connecttimeoutms", "-contentdecoding", + "-transferdecoding", "-krblevel", "-newfileperms", + "-newdirectoryperms", "-keypasswd", "-append", + "-dirlistonly", "-usessl", "-post301", + "-sshhostpublickeymd5", "-proxytransfermode", + "-crlfile", "-issuercert", "-addressscope", + "-certinfo", "-postredir", "-username", + "-password", "-proxyuser", "-proxypassword", + "-tftpblksize", "-socks5gssapiservice","-socks5gssapinec", + "-protocols", "-redirprotocols", "-ftpsslcc", + "-sshknownhosts", "-sshkeyproc", + (char *) NULL +}; + +CONST static char *timeCond[] = { + "ifmodsince", "ifunmodsince", + (char *)NULL +}; + +CONST static char *getInfoTable[]={ + "effectiveurl", "httpcode", "responsecode", + "filetime", "totaltime", "namelookuptime", + "connecttime", "pretransfertime","sizeupload", + "sizedownload", "speeddownload", "speedupload", + "headersize", "requestsize", "sslverifyresult", + "contentlengthdownload", "contentlengthupload", + "starttransfertime", "contenttype", + "redirecttime", "redirectcount", "httpauthavail", + "proxyauthavail", "oserrno", "numconnects", + "sslengines", "httpconnectcode","cookielist", + "ftpentrypath", "redirecturl", "primaryip", + "appconnecttime", "certinfo", "conditionunmet", + (char *)NULL +}; + +CONST static char *curlFormTable[]={ + "name", "contents", "file", "contenttype", "contentheader", "filename", + "bufferName", "buffer", "filecontent", (char *)NULL +}; + +CONST static char *httpVersionTable[] = { + "none", "1.0", "1.1", (char *)NULL +}; + +CONST static char *netrcTable[] = { + "optional", "ignored", "required", (char *)NULL +}; + +CONST static char *encodingTable[] = { + "identity", "deflated", "all", (char *)NULL +}; + +CONST static char *versionInfoTable[] = { + "-version", "-versionnum", "-host", "-features", + "-sslversion", "-sslversionnum", "-libzversion", + "-protocols", (char *)NULL +}; + +CONST static char *proxyTypeTable[] = { + "http", "socks4", "socks4a", "socks5", "socks5hostname", (char *)NULL +}; + +CONST static char *httpAuthMethods[] = { + "basic", "digest", "digestie", "gssnegotiate", "ntlm", "any", "anysafe", (char *)NULL +}; + +CONST static char *ipresolve[] = { + "whatever", "v4", "v6", (char *)NULL +}; + +CONST static char *ftpssl[] = { + "nope", "try", "control", "all", (char *)NULL +}; + +CONST static char *shareCmd[] = { + "share", "unshare", "cleanup", (char *)NULL +}; + +CONST static char *lockData[] = { + "cookies", "dns", (char *)NULL +}; + +CONST static char *ftpsslauth[] = { + "default", "ssl", "tls", (char *)NULL +}; + +CONST static char *ftpsslccc[] = { + "none", "passive", "active", (char *)NULL +}; + +CONST static char *sslversion[] = { + "default", "tlsv1", "sslv2", "sslv3", (char *)NULL +}; + +CONST static char *ftpfilemethod[] = { + "default", "multicwd", "nocwd", "singlecwd", (char *)NULL +}; + +CONST static char *sshauthtypes[] = { + "publickey", "password", "host", "keyboard", "any", (char *)NULL +}; + +CONST static char *postredir[] = { + "301", "302", "all", (char *)NULL +}; + +CONST static char *protocolNames[] = { + "http", "https", "ftp", "ftps", "scp", "sftp", "telnet", "ldap", + "ldaps","dict", "file","tftp", "all", (char*)NULL +}; + +static curlioerr curlseek(void *instream, curl_off_t offset, int origin); + +int Tclcurl_MultiInit (Tcl_Interp *interp); + +#endif + +int Tclcurl_Init(Tcl_Interp *interp); + +char *curlCreateObjCmd(Tcl_Interp *interp,struct curlObjData *curlData); +int curlInitObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +int curlObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]); +int curlDeleteCmd(ClientData clientData); + +int curlPerform(Tcl_Interp *interp,CURL *curlHandle,struct curlObjData *curlData); + +int curlSetOptsTransfer(Tcl_Interp *interp, struct curlObjData *curlData,int objc, + Tcl_Obj *CONST objv[]); + +int curlConfigTransfer(Tcl_Interp *interp, struct curlObjData *curlData,int objc, + Tcl_Obj *CONST objv[]); + + +int curlDupHandle(Tcl_Interp *interp, struct curlObjData *curlData,int objc, + Tcl_Obj *CONST objv[]); + +int curlResetHandle(Tcl_Interp *interp, struct curlObjData *curlData); + +int curlSetOpts(Tcl_Interp *interp, struct curlObjData *curlData, + Tcl_Obj *CONST objv,int tableIndex); + +int SetoptInt(Tcl_Interp *interp,CURL *curlHandle,CURLoption opt,int tableIndex, + Tcl_Obj *tclObj); +int SetoptLong(Tcl_Interp *interp,CURL *curlHandle,CURLoption opt,int tableIndex, + Tcl_Obj *tclObj); +int SetoptCurlOffT(Tcl_Interp *interp,CURL *curlHandle,CURLoption opt,int tableIndex, + Tcl_Obj *tclObj); +int SetoptChar(Tcl_Interp *interp,CURL *curlHandle,CURLoption opt, + int tableIndex,Tcl_Obj *tclObj); +int SetoptSHandle(Tcl_Interp *interp,CURL *curlHandle,CURLoption opt, + int tableIndex,Tcl_Obj *tclObj); +int SetoptsList(Tcl_Interp *interp,struct curl_slist **slistPtr,Tcl_Obj *CONST objv); + +CURLcode curlGetInfo(Tcl_Interp *interp,CURL *curlHandle,int tableIndex); + +void curlFreeSpace(struct curlObjData *curlData); + +void curlErrorSetOpt(Tcl_Interp *interp,CONST char **configTable, int option,CONST char *parPtr); + +size_t curlHeaderReader(void *ptr,size_t size,size_t nmemb,FILE *stream); + +size_t curlBodyReader(void *ptr,size_t size,size_t nmemb,FILE *curlDataPtr); + +int curlProgressCallback(void *clientp,double dltotal,double dlnow, + double ultotal,double ulnow); + +size_t curlWriteProcInvoke(void *ptr,size_t size,size_t nmemb,FILE *curlDataPtr); +size_t curlReadProcInvoke(void *ptr,size_t size,size_t nmemb,FILE *curlDataPtr); + + +/* Puts a ssh key into a Tcl object */ +Tcl_Obj *curlsshkeyextract(Tcl_Interp *interp,const struct curl_khkey *key); + +/* Function that will be invoked by libcurl to see what the user wants to + do about the new ssh host */ +size_t curlsshkeycallback(CURL *easy, /* easy handle */ + const struct curl_khkey *knownkey, /* known */ + const struct curl_khkey *foundkey, /* found */ + enum curl_khmatch, /* libcurl's view on the keys */ + void *curlData); + +int curlDebugProcInvoke(CURL *curlHandle, curl_infotype infoType, + unsigned char * dataPtr, size_t size, void *curlData); + +int curlVersion (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]); + +int curlEscape(ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]); + +int curlUnescape(ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]); + +int curlVersionInfo (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]); + +int curlCopyCurlData (struct curlObjData *curlDataOld, + struct curlObjData *curlDataNew); + +int curlOpenFile(Tcl_Interp *interp,char *fileName, FILE **handle, int writing, int text); + +int curlOpenFiles (Tcl_Interp *interp,struct curlObjData *curlData); +void curlCloseFiles(struct curlObjData *curlData); + +int curlSetPostData(Tcl_Interp *interp,struct curlObjData *curlData); +void curlResetPostData(struct curlObjData *curlDataPtr); +void curlResetFormArray(struct curl_forms *formArray); + +void curlSetBodyVarName(Tcl_Interp *interp,struct curlObjData *curlDataPtr); + +char *curlstrdup (char *old); + + +char *curlCreateShareObjCmd (Tcl_Interp *interp,struct shcurlObjData *shcurlData); +int curlShareInitObjCmd (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]); +int curlShareObjCmd (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]); +int curlCleanUpShareCmd(ClientData clientData); + +#ifdef TCL_THREADS + TCL_DECLARE_MUTEX(cookieLock) + TCL_DECLARE_MUTEX(dnsLock) + TCL_DECLARE_MUTEX(sslLock) + TCL_DECLARE_MUTEX(connectLock) + + void curlShareLockFunc (CURL *handle, curl_lock_data data + , curl_lock_access access, void *userptr); + void curlShareUnLockFunc(CURL *handle, curl_lock_data data, void *userptr); +#endif + +int curlErrorStrings (Tcl_Interp *interp, Tcl_Obj *CONST objv,int type); +int curlEasyStringError (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]); +int curlShareStringError (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]); +int curlMultiStringError (ClientData clientData, Tcl_Interp *interp, + int objc,Tcl_Obj *CONST objv[]); + +#ifdef __cplusplus +} +#endif diff --git a/generic/tclcurl.tcl b/generic/tclcurl.tcl new file mode 100755 index 0000000..bc34636 --- /dev/null +++ b/generic/tclcurl.tcl @@ -0,0 +1,140 @@ +################################################################################ +################################################################################ +#### tclcurl.tcl +################################################################################ +################################################################################ +## Includes the tcl part of TclCurl +################################################################################ +################################################################################ +## (c) 2001-2009 Andres Garcia Garcia. fandom@telefonica.net +## See the file "license.terms" for information on usage and redistribution +## of this file and for a DISCLAIMER OF ALL WARRANTIES. +################################################################################ +################################################################################ + +package provide TclCurl 7.19.6 + +namespace eval curl { + +################################################################################ +# configure +# Invokes the 'curl-config' script to be able to know what features have +# been compiled in the installed version of libcurl. +# Possible options are '-prefix', '-feature' and 'vernum' +################################################################################ +proc ::curl::curlConfig {option} { + + if {$::tcl_platform(platform)=="windows"} { + error "This command is not available in Windows" + } + + switch -exact -- $option { + -prefix { + return [exec curl-config --prefix] + } + -feature { + set featureList [exec curl-config --feature] + regsub -all {\\n} $featureList { } featureList + return $featureList + } + -vernum { + return [exec curl-config --vernum] + } + -ca { + return [exec curl-config --ca] + } + default { + error "bad option '$option': must be '-prefix', '-feature', '-vernum' or '-ca'" + } + } + return +} + +################################################################################ +# transfer +# The transfer command is used for simple transfers in which you don't +# want to request more than one file. +# +# Parameters: +# Use the same parameters you would use in the 'configure' command to +# configure the download and the same as in 'getinfo' with a 'info' +# prefix to get info about the transfer. +################################################################################ +proc ::curl::transfer {args} { + variable getInfo + variable curlBodyVar + + set i 0 + set newArgs "" + catch {unset getInfo} + + foreach {option value} $args { + set noPassOption 0 + set block 1 + switch -regexp -- $option { + -info.* { + set noPassOption 1 + regsub -- {-info} $option {} option + set getInfo($option) $value + } + -block { + set noPassOption 1 + set block $value + } + -bodyvar { + upvar $value curlBodyVar + set value curlBodyVar + } + -headervar { + upvar $value curlHeaderVar + set value curlHeaderVar + } + -errorbuffer { + upvar $value curlErrorVar + set value curlErrorVar + } + } + if {$noPassOption==0} { + lappend newArgs $option $value + } + } + + if {[catch {::curl::init} curlHandle]} { + error "Could not init a curl session: $curlHandle" + } + + if {[catch {eval $curlHandle configure $newArgs} result]} { + $curlHandle cleanup + error $result + } + + if {$block==1} { + if {[catch {$curlHandle perform} result]} { + $curlHandle cleanup + error $result + } + if {[info exists getInfo]} { + foreach {option var} [array get getInfo] { + upvar $var info + set info [eval $curlHandle getinfo $option] + } + } + if {[catch {$curlHandle cleanup} result]} { + error $result + } + } else { + # We create a multiHandle + set multiHandle [curl::multiinit] + + # We add the easy handle to the multi handle. + $multiHandle addhandle $curlHandle + + # So now we create the event source passing the multiHandle as a parameter. + curl::createEventSource $multiHandle + + # And we return, it is non blocking after all. + } + return 0 +} + +} diff --git a/license.terms b/license.terms new file mode 100755 index 0000000..9f023c4 --- /dev/null +++ b/license.terms @@ -0,0 +1,38 @@ +This software is copyrighted by Andres Garcia Garcia and other parties. +The following terms apply to all files associated with the +software unless explicitly disclaimed in individual files. + +The authors hereby grant permission to use, copy, modify, distribute, +and license this software and its documentation for any purpose, provided +that existing copyright notices are retained in all copies and that this +notice is included verbatim in any distributions. No written agreement, +license, or royalty fee is required for any of the authorized uses. +Modifications to this software may be copyrighted by their authors +and need not follow the licensing terms described here, provided that +the new terms are clearly indicated on the first page of each file where +they apply. + +IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY +FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY +DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE +IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE +NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR +MODIFICATIONS. + +GOVERNMENT USE: If you are acquiring this software on behalf of the +U.S. government, the Government shall have only "Restricted Rights" +in the software and related documentation as defined in the Federal +Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you +are acquiring the software on behalf of the Department of Defense, the +software shall be classified as "Commercial Computer Software" and the +Government shall have only "Restricted Rights" as defined in Clause +252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the +authors grant the U.S. Government and others acting in its behalf +permission to use and distribute the software in accordance with the +terms specified in this license. diff --git a/packages/Linux/tclcurl-7.19.6.spec b/packages/Linux/tclcurl-7.19.6.spec new file mode 100755 index 0000000..668a997 --- /dev/null +++ b/packages/Linux/tclcurl-7.19.6.spec @@ -0,0 +1,42 @@ +Name: tclcurl +Version: 7.19.6 +Release: 1 +License: BSD revised +Group: Development/Libraries +Packager: Andres Garcia +Vendor: Fandom Enterprise +Source: http://personal1.iddeo.es/andresgarci/tclcurl/download/tarball/tclcurl-7.19.6.tar.gz +Summary: A Tcl interface for libcurl. + +%description + +TclCurl provides a binding to libcurl, with it you can upload +and download files using FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE or LDAP syntax. + +%prep +%setup + +%build +./configure --mandir=/usr/share/man --prefix=/usr +make + +%install +make install +mkdir -p /usr/share/doc/tclcurl-7.19.6/tests +cp -f ReadMe.txt /usr/share/doc/tclcurl-7.19.6/ +cp -f ToDo.txt /usr/share/doc/tclcurl-7.19.6/ +cp -f license.terms /usr/share/doc/tclcurl-7.19.6/ +cp -f doc/tclcurl.html /usr/share/doc/tclcurl-7.19.6/ +cp -f doc/tclcurl_multi.html /usr/share/doc/tclcurl-7.19.6/ +cp -f doc/tclcurl_share.html /usr/share/doc/tclcurl-7.19.6/ +cp -f doc/aolserver.txt /usr/share/doc/tclcurl-7.19.6/ +cp -f tests/*.tcl /usr/share/doc/tclcurl-7.19.6/tests + +%files +/usr/lib/TclCurl7.19.6/ +/usr/share/doc/tclcurl-7.19.6/ +/usr/share/man/mann/tclcurl.n.gz +/usr/share/man/mann/tclcurl_multi.n.gz +/usr/share/man/mann/tclcurl_share.n.gz + + diff --git a/packages/Windows/SetUp.tcl b/packages/Windows/SetUp.tcl new file mode 100755 index 0000000..f59f10f --- /dev/null +++ b/packages/Windows/SetUp.tcl @@ -0,0 +1,40 @@ +# This script installs TclCurl in a Windows system, you only +# have to double-click on it and, provided Tcl/Tk is already +# installed, TclCurl will be ready to use. +# +# Copyright (c) 2001-2009 Andres Garcia Garcia. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. + + +wm withdraw . + +set tclLibDir [file dirname $tcl_library] +set tclBinDir [file join [file dirname $tclLibDir] bin] +set windowsSystem [file join $env(windir) SYSTEM] + +foreach oldie [glob -nocomplain $tclLibDir/tclcurl*] { + catch {file delete -force $oldie} +} + +file copy -force tclcurl7.19.6 $tclLibDir + +foreach sslFile [glob -nocomplain ssl/*] { + catch {file copy -force $sslFile $windowsSystem} +} +foreach sslFile [glob -nocomplain certs/*] { + file copy -force $sslFile [file join $env(windir) curl-ca-bundle.crt] +} + +package forget TclCurl + +if {[catch {package require TclCurl} version]} { + tk_messageBox -icon error -type ok -title Error \ + -message "Install failed\n$version" +} else { + tk_messageBox -icon info -type ok -title Installed \ + -message "Version $version installed" +} + +exit diff --git a/packages/Windows/tclcurl.mk b/packages/Windows/tclcurl.mk new file mode 100755 index 0000000..f9934d3 --- /dev/null +++ b/packages/Windows/tclcurl.mk @@ -0,0 +1,97 @@ +TCL_VERSION = 8.5.7 +TCLCURL_VERSION = 7.19.6 +TclCurl_nodot = 7.196 +CURL_VERSION = 7.19.6 +ZLIB_VERSION = 1.2.3 + +installFiles = ChangeLog.txt changes.txt license.terms ReadMe.txt ReadMeW32.txt ToDo.txt packages/Windows/SetUp.tcl +installDirs = tests +certFiles = curl-${CURL_VERSION}/lib/cacert.pem +sslFiles = libeay32.dll libssl32.dll +docFiles = aolserver.txt OpenSSL-LICENSE.txt tclcurl.html tclcurl_multi.html tclcurl_share.html + +tclcurl-plain: DESTDIR = TclCurl-${TCLCURL_VERSION} +tclcurl-plain: TclCurlFlags= --disable-threads + +tclcurl-ssl: DESTDIR = TclCurl-SSL-${TCLCURL_VERSION} +tclcurl-ssl: TclCurlFlags = --enable-ssl --disable-threads +tclcurl-ssl: curlFlags = --with-ssl=/usr/local/ + +tclcurl-threaded: DESTDIR = TclCurl-THREADED-${TCLCURL_VERSION} +tclcurl-threaded: TclFlags = --enable-threads + +tclcurl-threaded-ssl: DESTDIR = TclCurl-THREADED-SSL-${TCLCURL_VERSION} +tclcurl-threaded-ssl: TclFlags = --enable-threads +tclcurl-threaded-ssl: TclCurlFlags = --enable-ssl +tclcurl-threaded-ssl: curlFlags = --with-ssl=/usr/local/ + +tclcurl-plain: tcl zlib curl tclcurlComp createDir extraFiles extraDirs docs rar + +tclcurl-ssl: tcl zlib curl tclcurlComp createDir extraFiles extraDirs docs ssl rar + +tclcurl-threaded: tcl zlib curl tclcurlComp createDir extraFiles extraDirs docs rar + +tclcurl-threaded-ssl: tcl zlib curl tclcurlComp createDir extraFiles extraDirs docs ssl rar + +clean: + rm TclCurl-${TCLCURL_VERSION}.exe TclCurl-SSL-${TCLCURL_VERSION}.exe TclCurl-THREADED-${TCLCURL_VERSION}.exe TclCurl-THREADED-SSL-${TCLCURL_VERSION}.exe + +tcl: + cd tcl${TCL_VERSION}/win ;\ + make distclean ;\ + ./configure ${TclFlags} ;\ + make ;\ + make install + +curl: + cd curl-${CURL_VERSION} ;\ + ./configure ${curlFlags} --enable-shared=no ;\ + make ;\ + make install-strip + +zlib: + cd zlib-${ZLIB_VERSION} ;\ + make distclean ;\ + ./configure ;\ + make ;\ + make install ;\ + +tclcurlComp: + cd TclCurl ;\ + make distclean ;\ + CC=gcc ./configure ${TclFlags} ${TclCurlFlags} -enable-zlib ;\ + make ;\ + make install + +createDir: + mkdir ${DESTDIR} ;\ + cp -r /usr/local/lib/TclCurl${TCLCURL_VERSION} ${DESTDIR} ;\ + +extraFiles: + for f in $(installFiles) ; do \ + cp TclCurl/$$f ${DESTDIR} ;\ + done + +extraDirs: + for f in $(installDirs) ; do \ + cp -r TclCurl/$$f ${DESTDIR}/TclCurl${TCLCURL_VERSION} ;\ + done + +ssl: + mkdir ${DESTDIR}/certs ;\ + cp ${certFiles} ${DESTDIR}/certs ;\ + mkdir ${DESTDIR}/ssl ;\ + for f in $(sslFiles) ; do \ + cp -r /usr/local/bin/$$f ${DESTDIR}/ssl ;\ + done + +docs: + mkdir ${DESTDIR}/tclcurl${TCLCURL_VERSION}/doc ;\ + for f in $(docFiles) ; do \ + cp -r TclCurl/doc/$$f ${DESTDIR}/tclcurl${TCLCURL_VERSION}/doc;\ + done + +rar: + c:/Archiv~1/WinRAR/rar a -r -s -sfx ${DESTDIR}.exe ${DESTDIR};\ + rm -r ${DESTDIR} + diff --git a/pkgIndex.tcl.in b/pkgIndex.tcl.in new file mode 100755 index 0000000..d7566b4 --- /dev/null +++ b/pkgIndex.tcl.in @@ -0,0 +1,5 @@ +# +# Tcl package index file +# +package ifneeded @PACKAGE_NAME@ @PACKAGE_VERSION@ \ + [list load [file join $dir @PKG_LIB_FILE@] @PACKAGE_NAME@] diff --git a/tclconfig/install-sh b/tclconfig/install-sh new file mode 100755 index 0000000..0ff4b6a --- /dev/null +++ b/tclconfig/install-sh @@ -0,0 +1,119 @@ +#!/bin/sh + +# +# install - install a program, script, or datafile +# This comes from X11R5; it is not part of GNU. +# +# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ +# +# This script is compatible with the BSD install script, but was written +# from scratch. +# + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" + +instcmd="$mvprog" +chmodcmd="" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +fi + +if [ x"$dst" = x ] +then + echo "install: no destination specified" + exit 1 +fi + + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + +if [ -d $dst ] +then + dst="$dst"/`basename $src` +fi + +# Make a temp file name in the proper directory. + +dstdir=`dirname $dst` +dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + +$doit $instcmd $src $dsttmp + +# and set any options; do chmod last to preserve setuid bits + +if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi +if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi +if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi +if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi + +# Now rename the file to the real destination. + +$doit $rmcmd $dst +$doit $mvcmd $dsttmp $dst + + +exit 0 diff --git a/tclconfig/tcl.m4 b/tclconfig/tcl.m4 new file mode 100644 index 0000000..ef99a37 --- /dev/null +++ b/tclconfig/tcl.m4 @@ -0,0 +1,4148 @@ +# tcl.m4 -- +# +# This file provides a set of autoconf macros to help TEA-enable +# a Tcl extension. +# +# Copyright (c) 1999-2000 Ajuba Solutions. +# Copyright (c) 2002-2005 ActiveState Corporation. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# RCS: @(#) $Id: tcl.m4,v 1.135 2009/04/28 00:40:24 hobbs Exp $ + +AC_PREREQ(2.57) + +dnl TEA extensions pass us the version of TEA they think they +dnl are compatible with (must be set in TEA_INIT below) +dnl TEA_VERSION="3.7" + +# Possible values for key variables defined: +# +# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') +# TEA_PLATFORM - windows unix +# + +#------------------------------------------------------------------------ +# TEA_PATH_TCLCONFIG -- +# +# Locate the tclConfig.sh file and perform a sanity check on +# the Tcl compile flags +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-tcl=... +# +# Defines the following vars: +# TCL_BIN_DIR Full path to the directory containing +# the tclConfig.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_TCLCONFIG], [ + dnl TEA specific: Make sure we are initialized + AC_REQUIRE([TEA_INIT]) + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + AC_ARG_WITH(tcl, + AC_HELP_STRING([--with-tcl], + [directory containing tcl configuration (tclConfig.sh)]), + with_tclconfig=${withval}) + AC_MSG_CHECKING([for Tcl configuration]) + AC_CACHE_VAL(ac_cv_c_tclconfig,[ + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + case ${with_tclconfig} in + */tclConfig.sh ) + if test -f ${with_tclconfig}; then + AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) + with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test "${TEA_PLATFORM}" = "windows" \ + -a -f "$i/win/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/win; pwd)` + break + fi + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tcl.framework/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` + break + fi + done + fi + + # TEA specific: on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test "${TEA_PLATFORM}" = "windows" \ + -a -f "$i/win/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/win; pwd)` + break + fi + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + AC_MSG_ERROR([Can't find Tcl configuration definitions]) + else + no_tcl= + TCL_BIN_DIR=${ac_cv_c_tclconfig} + AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_PATH_TKCONFIG -- +# +# Locate the tkConfig.sh file +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-tk=... +# +# Defines the following vars: +# TK_BIN_DIR Full path to the directory containing +# the tkConfig.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_TKCONFIG], [ + # + # Ok, lets find the tk configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tk + # + + if test x"${no_tk}" = x ; then + # we reset no_tk in case something fails here + no_tk=true + AC_ARG_WITH(tk, + AC_HELP_STRING([--with-tk], + [directory containing tk configuration (tkConfig.sh)]), + with_tkconfig=${withval}) + AC_MSG_CHECKING([for Tk configuration]) + AC_CACHE_VAL(ac_cv_c_tkconfig,[ + + # First check to see if --with-tkconfig was specified. + if test x"${with_tkconfig}" != x ; then + case ${with_tkconfig} in + */tkConfig.sh ) + if test -f ${with_tkconfig}; then + AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) + with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tkconfig}/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` + else + AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) + fi + fi + + # then check for a private Tk library + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ../tk \ + `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../tk \ + `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../../tk \ + `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test "${TEA_PLATFORM}" = "windows" \ + -a -f "$i/win/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/win; pwd)` + break + fi + if test -f "$i/unix/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tk.framework/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` + break + fi + done + fi + + # TEA specific: on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ${srcdir}/../tk \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test "${TEA_PLATFORM}" = "windows" \ + -a -f "$i/win/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/win; pwd)` + break + fi + if test -f "$i/unix/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_tkconfig}" = x ; then + TK_BIN_DIR="# no Tk configs found" + AC_MSG_ERROR([Can't find Tk configuration definitions]) + else + no_tk= + TK_BIN_DIR=${ac_cv_c_tkconfig} + AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_TCLCONFIG -- +# +# Load the tclConfig.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# TCL_BIN_DIR +# +# Results: +# +# Subst the following vars: +# TCL_BIN_DIR +# TCL_SRC_DIR +# TCL_LIB_FILE +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_TCLCONFIG], [ + AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) + + if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then + AC_MSG_RESULT([loading]) + . "${TCL_BIN_DIR}/tclConfig.sh" + else + AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tcl.framework installed in an arbitrary location. + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then + for i in "`cd ${TCL_BIN_DIR}; pwd`" \ + "`cd ${TCL_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then + TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" + break + fi + done + fi + if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then + TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" + TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + AC_SUBST(TCL_VERSION) + AC_SUBST(TCL_BIN_DIR) + AC_SUBST(TCL_SRC_DIR) + + AC_SUBST(TCL_LIB_FILE) + AC_SUBST(TCL_LIB_FLAG) + AC_SUBST(TCL_LIB_SPEC) + + AC_SUBST(TCL_STUB_LIB_FILE) + AC_SUBST(TCL_STUB_LIB_FLAG) + AC_SUBST(TCL_STUB_LIB_SPEC) + + # TEA specific: + AC_SUBST(TCL_LIBS) + AC_SUBST(TCL_DEFS) + AC_SUBST(TCL_EXTRA_CFLAGS) + AC_SUBST(TCL_LD_FLAGS) + AC_SUBST(TCL_SHLIB_LD_LIBS) +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_TKCONFIG -- +# +# Load the tkConfig.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# TK_BIN_DIR +# +# Results: +# +# Sets the following vars that should be in tkConfig.sh: +# TK_BIN_DIR +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_TKCONFIG], [ + AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) + + if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then + AC_MSG_RESULT([loading]) + . "${TK_BIN_DIR}/tkConfig.sh" + else + AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) + fi + + # eval is required to do the TK_DBGX substitution + eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" + eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" + + # If the TK_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TK_LIB_SPEC will be set to the value + # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC + # instead of TK_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TK_BIN_DIR}/Makefile" ; then + TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} + TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} + TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tk.framework installed in an arbitrary location. + case ${TK_DEFS} in + *TK_FRAMEWORK*) + if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then + for i in "`cd ${TK_BIN_DIR}; pwd`" \ + "`cd ${TK_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then + TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" + break + fi + done + fi + if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then + TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" + TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TK_DBGX substitution + eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" + eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" + eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" + eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" + + # TEA specific: Ensure windowingsystem is defined + if test "${TEA_PLATFORM}" = "unix" ; then + case ${TK_DEFS} in + *MAC_OSX_TK*) + AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) + TEA_WINDOWINGSYSTEM="aqua" + ;; + *) + TEA_WINDOWINGSYSTEM="x11" + ;; + esac + elif test "${TEA_PLATFORM}" = "windows" ; then + TEA_WINDOWINGSYSTEM="win32" + fi + + AC_SUBST(TK_VERSION) + AC_SUBST(TK_BIN_DIR) + AC_SUBST(TK_SRC_DIR) + + AC_SUBST(TK_LIB_FILE) + AC_SUBST(TK_LIB_FLAG) + AC_SUBST(TK_LIB_SPEC) + + AC_SUBST(TK_STUB_LIB_FILE) + AC_SUBST(TK_STUB_LIB_FLAG) + AC_SUBST(TK_STUB_LIB_SPEC) + + # TEA specific: + AC_SUBST(TK_LIBS) + AC_SUBST(TK_XINCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_PROG_TCLSH +# Determine the fully qualified path name of the tclsh executable +# in the Tcl build directory or the tclsh installed in a bin +# directory. This macro will correctly determine the name +# of the tclsh executable even if tclsh has not yet been +# built in the build directory. The tclsh found is always +# associated with a tclConfig.sh file. This tclsh should be used +# only for running extension test cases. It should never be +# or generation of files (like pkgIndex.tcl) at build time. +# +# Arguments +# none +# +# Results +# Subst's the following values: +# TCLSH_PROG +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PROG_TCLSH], [ + AC_MSG_CHECKING([for tclsh]) + if test -f "${TCL_BIN_DIR}/Makefile" ; then + # tclConfig.sh is in Tcl build directory + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="${TCL_BIN_DIR}/tclsh" + fi + else + # tclConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" + fi + list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${TCLSH_PROG}" ; then + REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" + fi + AC_MSG_RESULT([${TCLSH_PROG}]) + AC_SUBST(TCLSH_PROG) +]) + +#------------------------------------------------------------------------ +# TEA_PROG_WISH +# Determine the fully qualified path name of the wish executable +# in the Tk build directory or the wish installed in a bin +# directory. This macro will correctly determine the name +# of the wish executable even if wish has not yet been +# built in the build directory. The wish found is always +# associated with a tkConfig.sh file. This wish should be used +# only for running extension test cases. It should never be +# or generation of files (like pkgIndex.tcl) at build time. +# +# Arguments +# none +# +# Results +# Subst's the following values: +# WISH_PROG +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PROG_WISH], [ + AC_MSG_CHECKING([for wish]) + if test -f "${TK_BIN_DIR}/Makefile" ; then + # tkConfig.sh is in Tk build directory + if test "${TEA_PLATFORM}" = "windows"; then + WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" + else + WISH_PROG="${TK_BIN_DIR}/wish" + fi + else + # tkConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" + else + WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" + fi + list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TK_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${WISH_PROG}" ; then + REAL_TK_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" + fi + AC_MSG_RESULT([${WISH_PROG}]) + AC_SUBST(WISH_PROG) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_SHARED -- +# +# Allows the building of shared libraries +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-shared=yes|no +# +# Defines the following vars: +# STATIC_BUILD Used for building import/export libraries +# on Windows. +# +# Sets the following vars: +# SHARED_BUILD Value of 1 or 0 +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_SHARED], [ + AC_MSG_CHECKING([how to build libraries]) + AC_ARG_ENABLE(shared, + AC_HELP_STRING([--enable-shared], + [build and link with shared libraries (default: on)]), + [tcl_ok=$enableval], [tcl_ok=yes]) + + if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" ; then + AC_MSG_RESULT([shared]) + SHARED_BUILD=1 + else + AC_MSG_RESULT([static]) + SHARED_BUILD=0 + AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) + fi + AC_SUBST(SHARED_BUILD) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_THREADS -- +# +# Specify if thread support should be enabled. If "yes" is specified +# as an arg (optional), threads are enabled by default, "no" means +# threads are disabled. "yes" is the default. +# +# TCL_THREADS is checked so that if you are compiling an extension +# against a threaded core, your extension must be compiled threaded +# as well. +# +# Note that it is legal to have a thread enabled extension run in a +# threaded or non-threaded Tcl core, but a non-threaded extension may +# only run in a non-threaded Tcl core. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-threads +# +# Sets the following vars: +# THREADS_LIBS Thread library(s) +# +# Defines the following vars: +# TCL_THREADS +# _REENTRANT +# _THREAD_SAFE +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_THREADS], [ + AC_ARG_ENABLE(threads, + AC_HELP_STRING([--enable-threads], + [build with threads]), + [tcl_ok=$enableval], [tcl_ok=yes]) + + if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then + TCL_THREADS=1 + + if test "${TEA_PLATFORM}" != "windows" ; then + # We are always OK on Windows, so check what this platform wants: + + # USE_THREAD_ALLOC tells us to try the special thread-based + # allocator that significantly reduces lock contention + AC_DEFINE(USE_THREAD_ALLOC, 1, + [Do we want to use the threaded memory allocator?]) + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + if test "`uname -s`" = "SunOS" ; then + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + fi + AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) + AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + if test "$tcl_ok" = "no"; then + # Check a little harder for __pthread_mutex_init in the same + # library, as some systems hide it there until pthread.h is + # defined. We could alternatively do an AC_TRY_COMPILE with + # pthread.h, but that will work with libpthread really doesn't + # exist, like AIX 4.2. [Bug: 4359] + AC_CHECK_LIB(pthread, __pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthread" + else + AC_CHECK_LIB(pthreads, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthreads" + else + AC_CHECK_LIB(c, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "no"; then + AC_CHECK_LIB(c_r, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -pthread" + else + TCL_THREADS=0 + AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled]) + fi + fi + fi + fi + fi + else + TCL_THREADS=0 + fi + # Do checking message here to not mess up interleaved configure output + AC_MSG_CHECKING([for building with threads]) + if test "${TCL_THREADS}" = 1; then + AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) + AC_MSG_RESULT([yes (default)]) + else + AC_MSG_RESULT([no]) + fi + # TCL_THREADS sanity checking. See if our request for building with + # threads is the same as the way Tcl was built. If not, warn the user. + case ${TCL_DEFS} in + *THREADS=1*) + if test "${TCL_THREADS}" = "0"; then + AC_MSG_WARN([ + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads.]) + fi + ;; + *) + if test "${TCL_THREADS}" = "1"; then + AC_MSG_WARN([ + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core.]) + fi + ;; + esac + AC_SUBST(TCL_THREADS) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_SYMBOLS -- +# +# Specify if debugging symbols should be used. +# Memory (TCL_MEM_DEBUG) debugging can also be enabled. +# +# Arguments: +# none +# +# TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives +# the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted. +# Requires the following vars to be set in the Makefile: +# CFLAGS_DEFAULT +# LDFLAGS_DEFAULT +# +# Results: +# +# Adds the following arguments to configure: +# --enable-symbols +# +# Defines the following vars: +# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true +# Sets to $(CFLAGS_OPTIMIZE) if false +# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true +# Sets to $(LDFLAGS_OPTIMIZE) if false +# DBGX Formerly used as debug library extension; +# always blank now. +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_SYMBOLS], [ + dnl TEA specific: Make sure we are initialized + AC_REQUIRE([TEA_CONFIG_CFLAGS]) + AC_MSG_CHECKING([for build with symbols]) + AC_ARG_ENABLE(symbols, + AC_HELP_STRING([--enable-symbols], + [build with debugging symbols (default: off)]), + [tcl_ok=$enableval], [tcl_ok=no]) + DBGX="" + if test "$tcl_ok" = "no"; then + CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" + LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" + AC_MSG_RESULT([no]) + else + CFLAGS_DEFAULT="${CFLAGS_DEBUG}" + LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" + if test "$tcl_ok" = "yes"; then + AC_MSG_RESULT([yes (standard debugging)]) + fi + fi + # TEA specific: + if test "${TEA_PLATFORM}" != "windows" ; then + LDFLAGS_DEFAULT="${LDFLAGS}" + fi + AC_SUBST(CFLAGS_DEFAULT) + AC_SUBST(LDFLAGS_DEFAULT) + AC_SUBST(TCL_DBGX) + + if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then + AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) + fi + + if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then + if test "$tcl_ok" = "all"; then + AC_MSG_RESULT([enabled symbols mem debugging]) + else + AC_MSG_RESULT([enabled $tcl_ok debugging]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_LANGINFO -- +# +# Allows use of modern nl_langinfo check for better l10n. +# This is only relevant for Unix. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-langinfo=yes|no (default is yes) +# +# Defines the following vars: +# HAVE_LANGINFO Triggers use of nl_langinfo if defined. +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_LANGINFO], [ + AC_ARG_ENABLE(langinfo, + AC_HELP_STRING([--enable-langinfo], + [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), + [langinfo_ok=$enableval], [langinfo_ok=yes]) + + HAVE_LANGINFO=0 + if test "$langinfo_ok" = "yes"; then + AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) + fi + AC_MSG_CHECKING([whether to use nl_langinfo]) + if test "$langinfo_ok" = "yes"; then + AC_CACHE_VAL(tcl_cv_langinfo_h, [ + AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);], + [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])]) + AC_MSG_RESULT([$tcl_cv_langinfo_h]) + if test $tcl_cv_langinfo_h = yes; then + AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) + fi + else + AC_MSG_RESULT([$langinfo_ok]) + fi +]) + +#-------------------------------------------------------------------- +# TEA_CONFIG_SYSTEM +# +# Determine what the system is (some things cannot be easily checked +# on a feature-driven basis, alas). This can usually be done via the +# "uname" command, but there are a few systems, like Next, where +# this doesn't work. +# +# Arguments: +# none +# +# Results: +# Defines the following var: +# +# system - System/platform/version identification code. +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_CONFIG_SYSTEM], [ + AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ + # TEA specific: + if test "${TEA_PLATFORM}" = "windows" ; then + tcl_cv_sys_version=windows + elif test -f /usr/lib/NextStep/software_version; then + tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` + else + tcl_cv_sys_version=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + AC_MSG_WARN([can't find uname command]) + tcl_cv_sys_version=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid` + fi + if test "`uname -s`" = "AIX" ; then + tcl_cv_sys_version=AIX-`uname -v`.`uname -r` + fi + fi + fi + ]) + system=$tcl_cv_sys_version +]) + +#-------------------------------------------------------------------- +# TEA_CONFIG_CFLAGS +# +# Try to determine the proper flags to pass to the compiler +# for building shared libraries and other such nonsense. +# +# Arguments: +# none +# +# Results: +# +# Defines and substitutes the following vars: +# +# DL_OBJS - Name of the object file that implements dynamic +# loading for Tcl on this system. +# DL_LIBS - Library file(s) to include in tclsh and other base +# applications in order for the "load" command to work. +# LDFLAGS - Flags to pass to the compiler when linking object +# files into an executable application binary such +# as tclsh. +# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", +# that tell the run-time dynamic linker where to look +# for shared libraries such as libtcl.so. Depends on +# the variable LIB_RUNTIME_DIR in the Makefile. Could +# be the same as CC_SEARCH_FLAGS if ${CC} is used to link. +# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", +# that tell the run-time dynamic linker where to look +# for shared libraries such as libtcl.so. Depends on +# the variable LIB_RUNTIME_DIR in the Makefile. +# SHLIB_CFLAGS - Flags to pass to cc when compiling the components +# of a shared library (may request position-independent +# code, among other things). +# SHLIB_LD - Base command to use for combining object files +# into a shared library. +# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when +# creating shared libraries. This symbol typically +# goes at the end of the "ld" commands that build +# shared libraries. The value of the symbol is +# "${LIBS}" if all of the dependent libraries should +# be specified when creating a shared library. If +# dependent libraries should not be specified (as on +# SunOS 4.x, where they cause the link to fail, or in +# general if Tcl and Tk aren't themselves shared +# libraries), then this symbol has an empty string +# as its value. +# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable +# extensions. An empty string means we don't know how +# to use shared libraries on this platform. +# LIB_SUFFIX - Specifies everything that comes after the "libfoo" +# in a static or shared library name, using the $VERSION variable +# to put the version in the right place. This is used +# by platforms that need non-standard library names. +# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs +# to have a version after the .so, and ${VERSION}.a +# on AIX, since a shared library needs to have +# a .a extension whereas shared objects for loadable +# extensions have a .so extension. Defaults to +# ${VERSION}${SHLIB_SUFFIX}. +# TCL_NEEDS_EXP_FILE - +# 1 means that an export file is needed to link to a +# shared library. +# TCL_EXP_FILE - The name of the installed export / import file which +# should be used to link to the Tcl shared library. +# Empty if Tcl is unshared. +# TCL_BUILD_EXP_FILE - +# The name of the built export / import file which +# should be used to link to the Tcl shared library. +# Empty if Tcl is unshared. +# CFLAGS_DEBUG - +# Flags used when running the compiler in debug mode +# CFLAGS_OPTIMIZE - +# Flags used when running the compiler in optimize mode +# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_CONFIG_CFLAGS], [ + dnl TEA specific: Make sure we are initialized + AC_REQUIRE([TEA_INIT]) + + # Step 0.a: Enable 64 bit support? + + AC_MSG_CHECKING([if 64bit support is requested]) + AC_ARG_ENABLE(64bit, + AC_HELP_STRING([--enable-64bit], + [enable 64bit support (default: off)]), + [do64bit=$enableval], [do64bit=no]) + AC_MSG_RESULT([$do64bit]) + + # Step 0.b: Enable Solaris 64 bit VIS support? + + AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) + AC_ARG_ENABLE(64bit-vis, + AC_HELP_STRING([--enable-64bit-vis], + [enable 64bit Sparc VIS support (default: off)]), + [do64bitVIS=$enableval], [do64bitVIS=no]) + AC_MSG_RESULT([$do64bitVIS]) + # Force 64bit on with VIS + AS_IF([test "$do64bitVIS" = "yes"], [do64bit=yes]) + + # Step 0.c: Check if visibility support is available. Do this here so + # that platform specific alternatives can be used below if this fails. + + AC_CACHE_CHECK([if compiler supports visibility "hidden"], + tcl_cv_cc_visibility_hidden, [ + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" + AC_TRY_LINK([ + extern __attribute__((__visibility__("hidden"))) void f(void); + void f(void) {}], [f();], tcl_cv_cc_visibility_hidden=yes, + tcl_cv_cc_visibility_hidden=no) + CFLAGS=$hold_cflags]) + AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [ + AC_DEFINE(MODULE_SCOPE, + [extern __attribute__((__visibility__("hidden")))], + [Compiler support for module scope symbols]) + ]) + + # Step 0.d: Disable -rpath support? + + AC_MSG_CHECKING([if rpath support is requested]) + AC_ARG_ENABLE(rpath, + AC_HELP_STRING([--disable-rpath], + [disable rpath support (default: on)]), + [doRpath=$enableval], [doRpath=yes]) + AC_MSG_RESULT([$doRpath]) + + # TEA specific: Cross-compiling options for Windows/CE builds? + + AS_IF([test "${TEA_PLATFORM}" = windows], [ + AC_MSG_CHECKING([if Windows/CE build is requested]) + AC_ARG_ENABLE(wince, + AC_HELP_STRING([--enable-wince], + [enable Win/CE support (where applicable)]), + [doWince=$enableval], [doWince=no]) + AC_MSG_RESULT([$doWince]) + ]) + + # Step 1: set the variable "system" to hold the name and version number + # for the system. + + TEA_CONFIG_SYSTEM + + # Step 2: check for existence of -ldl library. This is needed because + # Linux can use either -ldl or -ldld for dynamic loading. + + AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) + + # Require ranlib early so we can override it in special cases below. + + AC_REQUIRE([AC_PROG_RANLIB]) + + # Step 3: set configuration options based on system name and version. + # This is similar to Tcl's unix/tcl.m4 except that we've added a + # "windows" case. + + do64bit_ok=no + LDFLAGS_ORIG="$LDFLAGS" + # When ld needs options to work in 64-bit mode, put them in + # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] + # is disabled by the user. [Bug 1016796] + LDFLAGS_ARCH="" + TCL_EXPORT_FILE_SUFFIX="" + UNSHARED_LIB_SUFFIX="" + # TEA specific: use PACKAGE_VERSION instead of VERSION + TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' + ECHO_VERSION='`echo ${PACKAGE_VERSION}`' + TCL_LIB_VERSIONS_OK=ok + CFLAGS_DEBUG=-g + CFLAGS_OPTIMIZE=-O + AS_IF([test "$GCC" = yes], [ + # TEA specific: + CFLAGS_OPTIMIZE=-O2 + CFLAGS_WARNING="-Wall" + ], [CFLAGS_WARNING=""]) + TCL_NEEDS_EXP_FILE=0 + TCL_BUILD_EXP_FILE="" + TCL_EXP_FILE="" +dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. +dnl AC_CHECK_TOOL(AR, ar) + AC_CHECK_PROG(AR, ar, ar) + STLIB_LD='${AR} cr' + LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" + AS_IF([test "x$SHLIB_VERSION" = x],[SHLIB_VERSION="1.0"]) + case $system in + # TEA specific: + windows) + # This is a 2-stage check to make sure we have the 64-bit SDK + # We have to know where the SDK is installed. + # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs + # MACHINE is IX86 for LINK, but this is used by the manifest, + # which requires x86|amd64|ia64. + MACHINE="X86" + if test "$do64bit" != "no" ; then + if test "x${MSSDK}x" = "xx" ; then + MSSDK="C:/Progra~1/Microsoft Platform SDK" + fi + MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` + PATH64="" + case "$do64bit" in + amd64|x64|yes) + MACHINE="AMD64" ; # default to AMD64 64-bit build + PATH64="${MSSDK}/Bin/Win64/x86/AMD64" + ;; + ia64) + MACHINE="IA64" + PATH64="${MSSDK}/Bin/Win64" + ;; + esac + if test ! -d "${PATH64}" ; then + AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) + AC_MSG_WARN([Ensure latest Platform SDK is installed]) + do64bit="no" + else + AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) + do64bit_ok="yes" + fi + fi + + if test "$doWince" != "no" ; then + if test "$do64bit" != "no" ; then + AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible]) + fi + if test "$GCC" = "yes" ; then + AC_MSG_ERROR([Windows/CE and GCC builds incompatible]) + fi + TEA_PATH_CELIB + # Set defaults for common evc4/PPC2003 setup + # Currently Tcl requires 300+, possibly 420+ for sockets + CEVERSION=420; # could be 211 300 301 400 420 ... + TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... + ARCH=ARM; # could be ARM MIPS X86EM ... + PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" + if test "$doWince" != "yes"; then + # If !yes then the user specified something + # Reset ARCH to allow user to skip specifying it + ARCH= + eval `echo $doWince | awk -F, '{ \ + if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \ + if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ + if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \ + if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \ + if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \ + }'` + if test "x${ARCH}" = "x" ; then + ARCH=$TARGETCPU; + fi + fi + OSVERSION=WCE$CEVERSION; + if test "x${WCEROOT}" = "x" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" + if test ! -d "${WCEROOT}" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded Tools" + fi + fi + if test "x${SDKROOT}" = "x" ; then + SDKROOT="C:/Program Files/Windows CE Tools" + if test ! -d "${SDKROOT}" ; then + SDKROOT="C:/Windows CE Tools" + fi + fi + WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` + SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` + if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ + -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then + AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) + doWince="no" + else + # We could PATH_NOSPACE these, but that's not important, + # as long as we quote them when used. + CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" + if test -d "${CEINCLUDE}/${TARGETCPU}" ; then + CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" + fi + CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" + fi + fi + + if test "$GCC" != "yes" ; then + if test "${SHARED_BUILD}" = "0" ; then + runtime=-MT + else + runtime=-MD + fi + + if test "$do64bit" != "no" ; then + # All this magic is necessary for the Win64 SDK RC1 - hobbs + CC="\"${PATH64}/cl.exe\"" + CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" + RC="\"${MSSDK}/bin/rc.exe\"" + lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + LINKBIN="\"${PATH64}/link.exe\"" + CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + # Avoid 'unresolved external symbol __security_cookie' + # errors, c.f. http://support.microsoft.com/?id=894573 + TEA_ADD_LIBS([bufferoverflowU.lib]) + elif test "$doWince" != "no" ; then + CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" + if test "${TARGETCPU}" = "X86"; then + CC="\"${CEBINROOT}/cl.exe\"" + else + CC="\"${CEBINROOT}/cl${ARCH}.exe\"" + fi + CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" + RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" + arch=`echo ${ARCH} | awk '{print tolower([$]0)}'` + defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" + if test "${SHARED_BUILD}" = "1" ; then + # Static CE builds require static celib as well + defs="${defs} _DLL" + fi + for i in $defs ; do + AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i) + done + AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version]) + AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version]) + CFLAGS_DEBUG="-nologo -Zi -Od" + CFLAGS_OPTIMIZE="-nologo -Ox" + lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` + lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" + LINKBIN="\"${CEBINROOT}/link.exe\"" + AC_SUBST(CELIB_DIR) + else + RC="rc" + lflags="-nologo" + LINKBIN="link" + CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + fi + fi + + if test "$GCC" = "yes"; then + # mingw gcc mode + RC="windres" + CFLAGS_DEBUG="-g" + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + SHLIB_LD="$CC -shared" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" + LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" + else + SHLIB_LD="${LINKBIN} -dll ${lflags}" + # link -lib only works when -lib is the first arg + STLIB_LD="${LINKBIN} -lib ${lflags}" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' + PATHTYPE=-w + # For information on what debugtype is most useful, see: + # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp + # and also + # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx + # This essentially turns it all on. + LDFLAGS_DEBUG="-debug -debugtype:cv" + LDFLAGS_OPTIMIZE="-release" + if test "$doWince" != "no" ; then + LDFLAGS_CONSOLE="-link ${lflags}" + LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} + else + LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" + LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" + fi + fi + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dll" + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' + + TCL_LIB_VERSIONS_OK=nodots + # Bogus to avoid getting this turned off + DL_OBJS="tclLoadNone.obj" + ;; + AIX-*) + AS_IF([test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"], [ + # AIX requires the _r compiler when gcc isn't being used + case "${CC}" in + *_r|*_r\ *) + # ok ... + ;; + *) + # Make sure only first arg gets _r + CC=`echo "$CC" | sed -e 's/^\([[^ ]]*\)/\1_r/'` + ;; + esac + AC_MSG_RESULT([Using $CC for compiling with threads]) + ]) + LIBS="$LIBS -lc" + SHLIB_CFLAGS="" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + DL_OBJS="tclLoadDl.o" + LD_LIBRARY_PATH_VAR="LIBPATH" + + # Check to enable 64-bit flags for compiler/linker on AIX 4+ + AS_IF([test "$do64bit" = yes -a "`uname -v`" -gt 3], [ + AS_IF([test "$GCC" = yes], [ + AC_MSG_WARN([64bit mode not supported with GCC on $system]) + ], [ + do64bit_ok=yes + CFLAGS="$CFLAGS -q64" + LDFLAGS_ARCH="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + ]) + ]) + + AS_IF([test "`uname -m`" = ia64], [ + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + AS_IF([test "$GCC" = yes], [ + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + ], [ + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + ]) + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + ], [ + AS_IF([test "$GCC" = yes], [SHLIB_LD='${CC} -shared'], [ + SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + ]) + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + # TEA specific: use PACKAGE_VERSION instead of VERSION + TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' + ]) + + # AIX v<=4.1 has some different flags than 4.2+ + AS_IF([test "$system" = "AIX-4.1" -o "`uname -v`" -lt 4], [ + AC_LIBOBJ([tclLoadAix]) + DL_LIBS="-lld" + ]) + + # On AIX <=v4 systems, libbsd.a has to be linked in to support + # non-blocking file IO. This library has to be linked in after + # the MATH_LIBS or it breaks the pow() function. The way to + # insure proper sequencing, is to add it to the tail of MATH_LIBS. + # This library also supplies gettimeofday. + # + # AIX does not have a timezone field in struct tm. When the AIX + # bsd library is used, the timezone global and the gettimeofday + # methods are to be avoided for timezone deduction instead, we + # deduce the timezone by comparing the localtime result on a + # known GMT value. + + AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) + AS_IF([test $libbsd = yes], [ + MATH_LIBS="$MATH_LIBS -lbsd" + AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?]) + ]) + ;; + BeOS*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD='${CC} -nostart' + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + + #----------------------------------------------------------- + # Check for inet_ntoa in -lbind, for BeOS (which also needs + # -lsocket, even if the network functions are in -lnet which + # is always linked to, for compatibility. + #----------------------------------------------------------- + AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) + ;; + BSD/OS-2.1*|BSD/OS-3*) + SHLIB_CFLAGS="" + SHLIB_LD="shlicc -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + BSD/OS-4.*) + SHLIB_CFLAGS="-export-dynamic -fPIC" + SHLIB_LD='${CC} -shared' + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + dgux*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + HP-UX-*.11.*) + # Use updated header definitions where possible + AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) + # TEA specific: Needed by Tcl, but not most extensions + #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) + #LIBS="$LIBS -lxnet" # Use the XOPEN network library + + AS_IF([test "`uname -m`" = ia64], [ + SHLIB_SUFFIX=".so" + # Use newer C++ library for C++ extensions + #if test "$GCC" != "yes" ; then + # CPPFLAGS="-AA" + #fi + ], [ + SHLIB_SUFFIX=".sl" + ]) + AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) + AS_IF([test "$tcl_ok" = yes], [ + SHLIB_LD_LIBS='${LIBS}' + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + ]) + AS_IF([test "$GCC" = yes], [ + SHLIB_LD='${CC} -shared' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ], [ + CFLAGS="$CFLAGS -z" + # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc + #CFLAGS="$CFLAGS +DAportable" + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + ]) + + # Check to enable 64-bit flags for compiler/linker + AS_IF([test "$do64bit" = "yes"], [ + AS_IF([test "$GCC" = yes], [ + case `${CC} -dumpmachine` in + hppa64*) + # 64-bit gcc in use. Fix flags for GNU ld. + do64bit_ok=yes + SHLIB_LD='${CC} -shared' + SHLIB_LD_LIBS='${LIBS}' + AS_IF([test $doRpath = yes], [ + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ;; + *) + AC_MSG_WARN([64bit mode not supported with GCC on $system]) + ;; + esac + ], [ + do64bit_ok=yes + CFLAGS="$CFLAGS +DD64" + LDFLAGS_ARCH="+DD64" + ]) + ]) ;; + HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) + SHLIB_SUFFIX=".sl" + AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) + AS_IF([test "$tcl_ok" = yes], [ + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS="" + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + ]) ;; + IRIX-5.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + AS_IF([test $doRpath = yes], [ + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) + ;; + IRIX-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + AS_IF([test $doRpath = yes], [ + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) + AS_IF([test "$GCC" = yes], [ + CFLAGS="$CFLAGS -mabi=n32" + LDFLAGS="$LDFLAGS -mabi=n32" + ], [ + case $system in + IRIX-6.3) + # Use to build 6.2 compatible binaries on 6.3. + CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" + ;; + *) + CFLAGS="$CFLAGS -n32" + ;; + esac + LDFLAGS="$LDFLAGS -n32" + ]) + ;; + IRIX64-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + AS_IF([test $doRpath = yes], [ + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) + + # Check to enable 64-bit flags for compiler/linker + + AS_IF([test "$do64bit" = yes], [ + AS_IF([test "$GCC" = yes], [ + AC_MSG_WARN([64bit mode not supported by gcc]) + ], [ + do64bit_ok=yes + SHLIB_LD="ld -64 -shared -rdata_shared" + CFLAGS="$CFLAGS -64" + LDFLAGS_ARCH="-64" + ]) + ]) + ;; + Linux*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + # TEA specific: + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings + # when you inline the string and math operations. Turn this off to + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS + SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + AS_IF([test $doRpath = yes], [ + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"]) + AS_IF([test $do64bit = yes], [ + AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -m64" + AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no) + CFLAGS=$hold_cflags]) + AS_IF([test $tcl_cv_cc_m64 = yes], [ + CFLAGS="$CFLAGS -m64" + do64bit_ok=yes + ]) + ]) + + # The combo of gcc + glibc has a bug related to inlining of + # functions like strtod(). The -fno-builtin flag should address + # this problem but it does not work. The -fno-inline flag is kind + # of overkill but it works. Disable inlining only when one of the + # files in compat/*.c is being linked in. + + AS_IF([test x"${USE_COMPAT}" != x],[CFLAGS="$CFLAGS -fno-inline"]) + + ;; + GNU*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + SHLIB_LD='${CC} -shared' + DL_OBJS="" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"]) + ;; + Lynx*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + CFLAGS_OPTIMIZE=-02 + SHLIB_LD='${CC} -shared' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-mshared -ldl" + LD_FLAGS="-Wl,--export-dynamic" + AS_IF([test $doRpath = yes], [ + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) + ;; + MP-RAS-02*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + MP-RAS-*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,-Bexport" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + NetBSD-1.*|FreeBSD-[[1-2]].*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + AS_IF([test $doRpath = yes], [ + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) + AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ + AC_EGREP_CPP(yes, [ +#ifdef __ELF__ + yes +#endif + ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) + AS_IF([test $tcl_cv_ld_elf = yes], [ + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + ], [ + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' + ]) + + # Ancient FreeBSD doesn't handle version numbers with dots. + + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + OpenBSD-*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + AS_IF([test $doRpath = yes], [ + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' + AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ + AC_EGREP_CPP(yes, [ +#ifdef __ELF__ + yes +#endif + ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) + AS_IF([test $tcl_cv_ld_elf = yes], [ + LDFLAGS=-Wl,-export-dynamic + ], [LDFLAGS=""]) + + # OpenBSD doesn't do version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + NetBSD-*|FreeBSD-*) + # FreeBSD 3.* and greater have ELF. + # NetBSD 2.* has ELF and can use 'cc -shared' to build shared libs + SHLIB_CFLAGS="-fPIC" + SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS -export-dynamic" + AS_IF([test $doRpath = yes], [ + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + AS_IF([test "${TCL_THREADS}" = "1"], [ + # The -pthread needs to go in the CFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + ]) + case $system in + FreeBSD-3.*) + # FreeBSD-3 doesn't handle version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + TCL_LIB_VERSIONS_OK=nodots + ;; + esac + ;; + Darwin-*) + CFLAGS_OPTIMIZE="-Os" + SHLIB_CFLAGS="-fno-common" + # To avoid discrepancies between what headers configure sees during + # preprocessing tests and compiling tests, move any -isysroot and + # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: + CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" + CFLAGS="`echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" + AS_IF([test $do64bit = yes], [ + case `arch` in + ppc) + AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], + tcl_cv_cc_arch_ppc64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes, + tcl_cv_cc_arch_ppc64=no) + CFLAGS=$hold_cflags]) + AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [ + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + do64bit_ok=yes + ]);; + i386) + AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], + tcl_cv_cc_arch_x86_64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch x86_64" + AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes, + tcl_cv_cc_arch_x86_64=no) + CFLAGS=$hold_cflags]) + AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [ + CFLAGS="$CFLAGS -arch x86_64" + do64bit_ok=yes + ]);; + *) + AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; + esac + ], [ + # Check for combined 32-bit and 64-bit fat build + AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \ + && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [ + fat_32_64=yes]) + ]) + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS + SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' + AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" + AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no) + LDFLAGS=$hold_ldflags]) + AS_IF([test $tcl_cv_ld_single_module = yes], [ + SHLIB_LD="${SHLIB_LD} -Wl,-single_module" + ]) + # TEA specific: link shlib with current and compatiblity version flags + vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([[0-9]]\{1,5\}\)\(\(\.[[0-9]]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d` + SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dylib" + DL_OBJS="tclLoadDyld.o" + DL_LIBS="" + # Don't use -prebind when building for Mac OS X 10.4 or later only: + AS_IF([test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \ + "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4], [ + LDFLAGS="$LDFLAGS -prebind"]) + LDFLAGS="$LDFLAGS -headerpad_max_install_names" + AC_CACHE_CHECK([if ld accepts -search_paths_first flag], + tcl_cv_ld_search_paths_first, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, + tcl_cv_ld_search_paths_first=no) + LDFLAGS=$hold_ldflags]) + AS_IF([test $tcl_cv_ld_search_paths_first = yes], [ + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + ]) + AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [ + AC_DEFINE(MODULE_SCOPE, [__private_extern__], + [Compiler support for module scope symbols]) + ]) + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" + # TEA specific: for combined 32 & 64 bit fat builds of Tk + # extensions, verify that 64-bit build is possible. + AS_IF([test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"], [ + AS_IF([test "${TEA_WINDOWINGSYSTEM}" = x11], [ + AC_CACHE_CHECK([for 64-bit X11], tcl_cv_lib_x11_64, [ + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' + done + CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" + LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" + AC_TRY_LINK([#include ], [XrmInitialize();], + tcl_cv_lib_x11_64=yes, tcl_cv_lib_x11_64=no) + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="$hold_'$v'"' + done]) + ]) + AS_IF([test "${TEA_WINDOWINGSYSTEM}" = aqua], [ + AC_CACHE_CHECK([for 64-bit Tk], tcl_cv_lib_tk_64, [ + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' + done + CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}" + LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}" + AC_TRY_LINK([#include ], [Tk_InitStubs(NULL, "", 0);], + tcl_cv_lib_tk_64=yes, tcl_cv_lib_tk_64=no) + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="$hold_'$v'"' + done]) + ]) + # remove 64-bit arch flags from CFLAGS et al. if configuration + # does not support 64-bit. + AS_IF([test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no], [ + AC_MSG_NOTICE([Removing 64-bit architectures from compiler & linker flags]) + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' + done]) + ]) + ;; + NEXTSTEP-*) + SHLIB_CFLAGS="" + SHLIB_LD='${CC} -nostdlib -r' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadNext.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OS/390-*) + CFLAGS_OPTIMIZE="" # Optimizer is buggy + AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h + [Should OS/390 do the right thing with sockets?]) + ;; + OSF1-1.0|OSF1-1.1|OSF1-1.2) + # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 + SHLIB_CFLAGS="" + # Hack: make package name same as library name + SHLIB_LD='ld -R -export $@:' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadOSF.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-1.*) + # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 + SHLIB_CFLAGS="-fPIC" + AS_IF([test "$SHARED_BUILD" = 1], [SHLIB_LD="ld -shared"], [ + SHLIB_LD="ld -non_shared" + ]) + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-V*) + # Digital OSF/1 + SHLIB_CFLAGS="" + AS_IF([test "$SHARED_BUILD" = 1], [ + SHLIB_LD='ld -shared -expect_unresolved "*"' + ], [ + SHLIB_LD='ld -non_shared -expect_unresolved "*"' + ]) + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + AS_IF([test $doRpath = yes], [ + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) + AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [ + CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"]) + # see pthread_intro(3) for pthread support on osf1, k.furukawa + AS_IF([test "${TCL_THREADS}" = 1], [ + CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" + CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" + LIBS=`echo $LIBS | sed s/-lpthreads//` + AS_IF([test "$GCC" = yes], [ + LIBS="$LIBS -lpthread -lmach -lexc" + ], [ + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + ]) + ]) + ;; + QNX-6*) + # QNX RTP + # This may work for all QNX, but it was only reported for v6. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + # dlopen is in -lc on QNX + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SCO_SV-3.2*) + # Note, dlopen is available only on SCO 3.2.5 and greater. However, + # this test works, since "uname -s" was non-standard in 3.2.4 and + # below. + AS_IF([test "$GCC" = yes], [ + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" + ], [ + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" + ]) + SHLIB_LD="ld -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SINIX*5.4*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SunOS-4*) + SHLIB_CFLAGS="-PIC" + SHLIB_LD="ld" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + + # SunOS can't handle version numbers with dots in them in library + # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it + # requires an extra version number at the end of .so file names. + # So, the library has to have a name like libtcl75.so.1.0 + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + SunOS-5.[[0-6]]) + # Careful to not let 5.10+ fall into this case + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + + SHLIB_CFLAGS="-KPIC" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + AS_IF([test "$GCC" = yes], [ + SHLIB_LD='${CC} -shared' + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ], [ + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ]) + ;; + SunOS-5*) + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + + SHLIB_CFLAGS="-KPIC" + + # Check to enable 64-bit flags for compiler/linker + AS_IF([test "$do64bit" = yes], [ + arch=`isainfo` + AS_IF([test "$arch" = "sparcv9 sparc"], [ + AS_IF([test "$GCC" = yes], [ + AS_IF([test "`${CC} -dumpversion | awk -F. '{print [$]1}'`" -lt 3], [ + AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) + ], [ + do64bit_ok=yes + CFLAGS="$CFLAGS -m64 -mcpu=v9" + LDFLAGS="$LDFLAGS -m64 -mcpu=v9" + SHLIB_CFLAGS="-fPIC" + ]) + ], [ + do64bit_ok=yes + AS_IF([test "$do64bitVIS" = yes], [ + CFLAGS="$CFLAGS -xarch=v9a" + LDFLAGS_ARCH="-xarch=v9a" + ], [ + CFLAGS="$CFLAGS -xarch=v9" + LDFLAGS_ARCH="-xarch=v9" + ]) + # Solaris 64 uses this as well + #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" + ]) + ], [AS_IF([test "$arch" = "amd64 i386"], [ + AS_IF([test "$GCC" = yes], [ + case $system in + SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*) + do64bit_ok=yes + CFLAGS="$CFLAGS -m64" + LDFLAGS="$LDFLAGS -m64";; + *) + AC_MSG_WARN([64bit mode not supported with GCC on $system]);; + esac + ], [ + do64bit_ok=yes + case $system in + SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*) + CFLAGS="$CFLAGS -m64" + LDFLAGS="$LDFLAGS -m64";; + *) + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64";; + esac + ]) + ], [AC_MSG_WARN([64bit mode not supported for $arch])])]) + ]) + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + AS_IF([test "$GCC" = yes], [ + SHLIB_LD='${CC} -shared' + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + AS_IF([test "$do64bit_ok" = yes], [ + AS_IF([test "$arch" = "sparcv9 sparc"], [ + # We need to specify -static-libgcc or we need to + # add the path to the sparv9 libgcc. + # JH: static-libgcc is necessary for core Tcl, but may + # not be necessary for extensions. + SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" + # for finding sparcv9 libgcc, get the regular libgcc + # path, remove so name and append 'sparcv9' + #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." + #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + ], [AS_IF([test "$arch" = "amd64 i386"], [ + # JH: static-libgcc is necessary for core Tcl, but may + # not be necessary for extensions. + SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" + ])]) + ]) + ], [ + case $system in + SunOS-5.[[1-9]][[0-9]]*) + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS + SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';; + *) + SHLIB_LD='/usr/ccs/bin/ld -G -z text';; + esac + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + ]) + ;; + UNIX_SV* | UnixWare-5*) + SHLIB_CFLAGS="-KPIC" + SHLIB_LD='${CC} -G' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers + # that don't grok the -Bexport option. Test that it does. + AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-Bexport" + AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no) + LDFLAGS=$hold_ldflags]) + AS_IF([test $tcl_cv_ld_Bexport = yes], [ + LDFLAGS="$LDFLAGS -Wl,-Bexport" + ]) + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + esac + + AS_IF([test "$do64bit" = yes -a "$do64bit_ok" = no], [ + AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) + ]) + +dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so +dnl # until the end of configure, as configure's compile and link tests use +dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's +dnl # preprocessing tests use only CPPFLAGS. + AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) + + # Step 4: disable dynamic loading if requested via a command-line switch. + + AC_ARG_ENABLE(load, + AC_HELP_STRING([--enable-load], + [allow dynamic loading and "load" command (default: on)]), + [tcl_ok=$enableval], [tcl_ok=yes]) + AS_IF([test "$tcl_ok" = no], [DL_OBJS=""]) + + AS_IF([test "x$DL_OBJS" != x], [BUILD_DLTEST="\$(DLTEST_TARGETS)"], [ + AC_MSG_WARN([Can't figure out how to do dynamic loading or shared libraries on this system.]) + SHLIB_CFLAGS="" + SHLIB_LD="" + SHLIB_SUFFIX="" + DL_OBJS="tclLoadNone.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS_ORIG" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + BUILD_DLTEST="" + ]) + LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" + + # If we're running gcc, then change the C flags for compiling shared + # libraries to the right flags for gcc, instead of those for the + # standard manufacturer compiler. + + AS_IF([test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes], [ + case $system in + AIX-*) ;; + BSD/OS*) ;; + IRIX*) ;; + NetBSD-*|FreeBSD-*) ;; + Darwin-*) ;; + SCO_SV-3.2*) ;; + windows) ;; + *) SHLIB_CFLAGS="-fPIC" ;; + esac]) + + AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [ + # TEA specific: use PACKAGE_VERSION instead of VERSION + SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}']) + AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [ + # TEA specific: use PACKAGE_VERSION instead of VERSION + UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a']) + + AC_SUBST(DL_LIBS) + + AC_SUBST(CFLAGS_DEBUG) + AC_SUBST(CFLAGS_OPTIMIZE) + AC_SUBST(CFLAGS_WARNING) + + AC_SUBST(STLIB_LD) + AC_SUBST(SHLIB_LD) + + AC_SUBST(SHLIB_LD_LIBS) + AC_SUBST(SHLIB_CFLAGS) + + AC_SUBST(LD_LIBRARY_PATH_VAR) + + # These must be called after we do the basic CFLAGS checks and + # verify any possible 64-bit or similar switches are necessary + TEA_TCL_EARLY_FLAGS + TEA_TCL_64BIT_FLAGS +]) + +#-------------------------------------------------------------------- +# TEA_SERIAL_PORT +# +# Determine which interface to use to talk to the serial port. +# Note that #include lines must begin in leftmost column for +# some compilers to recognize them as preprocessor directives, +# and some build environments have stdin not pointing at a +# pseudo-terminal (usually /dev/null instead.) +# +# Arguments: +# none +# +# Results: +# +# Defines only one of the following vars: +# HAVE_SYS_MODEM_H +# USE_TERMIOS +# USE_TERMIO +# USE_SGTTY +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_SERIAL_PORT], [ + AC_CHECK_HEADERS(sys/modem.h) + AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ + AC_TRY_RUN([ +#include + +int main() { + struct termios t; + if (tcgetattr(0, &t) == 0) { + cfsetospeed(&t, 0); + t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include + +int main() { + struct termio t; + if (ioctl(0, TCGETA, &t) == 0) { + t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include + +int main() { + struct sgttyb t; + if (ioctl(0, TIOCGETP, &t) == 0) { + t.sg_ospeed = 0; + t.sg_flags |= ODDP | EVENP | RAW; + return 0; + } + return 1; +}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct termios t; + if (tcgetattr(0, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + cfsetospeed(&t, 0); + t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct termio t; + if (ioctl(0, TCGETA, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; + }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct sgttyb t; + if (ioctl(0, TIOCGETP, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + t.sg_ospeed = 0; + t.sg_flags |= ODDP | EVENP | RAW; + return 0; + } + return 1; +}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) + fi]) + case $tcl_cv_api_serial in + termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; + termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; + sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; + esac +]) + +#-------------------------------------------------------------------- +# TEA_MISSING_POSIX_HEADERS +# +# Supply substitutes for missing POSIX header files. Special +# notes: +# - stdlib.h doesn't define strtol, strtoul, or +# strtod in some versions of SunOS +# - some versions of string.h don't declare procedures such +# as strstr +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# NO_DIRENT_H +# NO_ERRNO_H +# NO_VALUES_H +# HAVE_LIMITS_H or NO_LIMITS_H +# NO_STDLIB_H +# NO_STRING_H +# NO_SYS_WAIT_H +# NO_DLFCN_H +# HAVE_SYS_PARAM_H +# +# HAVE_STRING_H ? +# +# tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and +# CHECK on limits.h +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [ + AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [ + AC_TRY_LINK([#include +#include ], [ +#ifndef _POSIX_SOURCE +# ifdef __Lynx__ + /* + * Generate compilation error to make the test fail: Lynx headers + * are only valid if really in the POSIX environment. + */ + + missing_procedure(); +# endif +#endif +DIR *d; +struct dirent *entryPtr; +char *p; +d = opendir("foobar"); +entryPtr = readdir(d); +p = entryPtr->d_name; +closedir(d); +], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)]) + + if test $tcl_cv_dirent_h = no; then + AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) + fi + + # TEA specific: + AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(limits.h, + [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], + [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) + AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) + AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) + AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) + if test $tcl_ok = 0; then + AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) + fi + AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) + AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) + AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) + + # See also memmove check below for a place where NO_STRING_H can be + # set and why. + + if test $tcl_ok = 0; then + AC_DEFINE(NO_STRING_H, 1, [Do we have ?]) + fi + + AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) + + # OS/390 lacks sys/param.h (and doesn't need it, by chance). + AC_HAVE_HEADERS(sys/param.h) +]) + +#-------------------------------------------------------------------- +# TEA_PATH_X +# +# Locate the X11 header files and the X11 library archive. Try +# the ac_path_x macro first, but if it doesn't find the X stuff +# (e.g. because there's no xmkmf program) then check through +# a list of possible directories. Under some conditions the +# autoconf macro will return an include directory that contains +# no include files, so double-check its result just to be safe. +# +# This should be called after TEA_CONFIG_CFLAGS as setting the +# LIBS line can confuse some configure macro magic. +# +# Arguments: +# none +# +# Results: +# +# Sets the following vars: +# XINCLUDES +# XLIBSW +# PKG_LIBS (appends to) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_PATH_X], [ + if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then + TEA_PATH_UNIX_X + fi +]) + +AC_DEFUN([TEA_PATH_UNIX_X], [ + AC_PATH_X + not_really_there="" + if test "$no_x" = ""; then + if test "$x_includes" = ""; then + AC_TRY_CPP([#include ], , not_really_there="yes") + else + if test ! -r $x_includes/X11/Intrinsic.h; then + not_really_there="yes" + fi + fi + fi + if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then + AC_MSG_CHECKING([for X11 header files]) + found_xincludes="no" + AC_TRY_CPP([#include ], found_xincludes="yes", found_xincludes="no") + if test "$found_xincludes" = "no"; then + dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" + for i in $dirs ; do + if test -r $i/X11/Intrinsic.h; then + AC_MSG_RESULT([$i]) + XINCLUDES=" -I$i" + found_xincludes="yes" + break + fi + done + fi + else + if test "$x_includes" != ""; then + XINCLUDES="-I$x_includes" + found_xincludes="yes" + fi + fi + if test found_xincludes = "no"; then + AC_MSG_RESULT([couldn't find any!]) + fi + + if test "$no_x" = yes; then + AC_MSG_CHECKING([for X11 libraries]) + XLIBSW=nope + dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" + for i in $dirs ; do + if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then + AC_MSG_RESULT([$i]) + XLIBSW="-L$i -lX11" + x_libraries="$i" + break + fi + done + else + if test "$x_libraries" = ""; then + XLIBSW=-lX11 + else + XLIBSW="-L$x_libraries -lX11" + fi + fi + if test "$XLIBSW" = nope ; then + AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) + fi + if test "$XLIBSW" = nope ; then + AC_MSG_RESULT([could not find any! Using -lX11.]) + XLIBSW=-lX11 + fi + # TEA specific: + if test x"${XLIBSW}" != x ; then + PKG_LIBS="${PKG_LIBS} ${XLIBSW}" + fi +]) + +#-------------------------------------------------------------------- +# TEA_BLOCKING_STYLE +# +# The statements below check for systems where POSIX-style +# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. +# On these systems (mostly older ones), use the old BSD-style +# FIONBIO approach instead. +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# HAVE_SYS_IOCTL_H +# HAVE_SYS_FILIO_H +# USE_FIONBIO +# O_NONBLOCK +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_BLOCKING_STYLE], [ + AC_CHECK_HEADERS(sys/ioctl.h) + AC_CHECK_HEADERS(sys/filio.h) + TEA_CONFIG_SYSTEM + AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) + case $system in + # There used to be code here to use FIONBIO under AIX. However, it + # was reported that FIONBIO doesn't work under AIX 3.2.5. Since + # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO + # code (JO, 5/31/97). + + OSF*) + AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) + AC_MSG_RESULT([FIONBIO]) + ;; + SunOS-4*) + AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) + AC_MSG_RESULT([FIONBIO]) + ;; + *) + AC_MSG_RESULT([O_NONBLOCK]) + ;; + esac +]) + +#-------------------------------------------------------------------- +# TEA_TIME_HANDLER +# +# Checks how the system deals with time.h, what time structures +# are used on the system, and what fields the structures have. +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# USE_DELTA_FOR_TZ +# HAVE_TM_GMTOFF +# HAVE_TM_TZADJ +# HAVE_TIMEZONE_VAR +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TIME_HANDLER], [ + AC_CHECK_HEADERS(sys/time.h) + AC_HEADER_TIME + AC_STRUCT_TIMEZONE + + AC_CHECK_FUNCS(gmtime_r localtime_r) + + AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ + AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], + tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)]) + if test $tcl_cv_member_tm_tzadj = yes ; then + AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) + fi + + AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ + AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], + tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)]) + if test $tcl_cv_member_tm_gmtoff = yes ; then + AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) + fi + + # + # Its important to include time.h in this check, as some systems + # (like convex) have timezone functions, etc. + # + AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ + AC_TRY_COMPILE([#include ], + [extern long timezone; + timezone += 1; + exit (0);], + tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)]) + if test $tcl_cv_timezone_long = yes ; then + AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) + else + # + # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. + # + AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ + AC_TRY_COMPILE([#include ], + [extern time_t timezone; + timezone += 1; + exit (0);], + tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)]) + if test $tcl_cv_timezone_time = yes ; then + AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) + fi + fi +]) + +#-------------------------------------------------------------------- +# TEA_BUGGY_STRTOD +# +# Under Solaris 2.4, strtod returns the wrong value for the +# terminating character under some conditions. Check for this +# and if the problem exists use a substitute procedure +# "fixstrtod" (provided by Tcl) that corrects the error. +# Also, on Compaq's Tru64 Unix 5.0, +# strtod(" ") returns 0.0 instead of a failure to convert. +# +# Arguments: +# none +# +# Results: +# +# Might defines some of the following vars: +# strtod (=fixstrtod) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_BUGGY_STRTOD], [ + AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) + if test "$tcl_strtod" = 1; then + AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ + AC_TRY_RUN([ + extern double strtod(); + int main() { + char *infString="Inf", *nanString="NaN", *spaceString=" "; + char *term; + double value; + value = strtod(infString, &term); + if ((term != infString) && (term[-1] == 0)) { + exit(1); + } + value = strtod(nanString, &term); + if ((term != nanString) && (term[-1] == 0)) { + exit(1); + } + value = strtod(spaceString, &term); + if (term == (spaceString+1)) { + exit(1); + } + exit(0); + }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy, + tcl_cv_strtod_buggy=buggy)]) + if test "$tcl_cv_strtod_buggy" = buggy; then + AC_LIBOBJ([fixstrtod]) + USE_COMPAT=1 + AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) + fi + fi +]) + +#-------------------------------------------------------------------- +# TEA_TCL_LINK_LIBS +# +# Search for the libraries needed to link the Tcl shell. +# Things like the math library (-lm) and socket stuff (-lsocket vs. +# -lnsl) are dealt with here. +# +# Arguments: +# Requires the following vars to be set in the Makefile: +# DL_LIBS +# LIBS +# MATH_LIBS +# +# Results: +# +# Subst's the following var: +# TCL_LIBS +# MATH_LIBS +# +# Might append to the following vars: +# LIBS +# +# Might define the following vars: +# HAVE_NET_ERRNO_H +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_LINK_LIBS], [ + #-------------------------------------------------------------------- + # On a few very rare systems, all of the libm.a stuff is + # already in libc.a. Set compiler flags accordingly. + # Also, Linux requires the "ieee" library for math to work + # right (and it must appear before "-lm"). + #-------------------------------------------------------------------- + + AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") + AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) + + #-------------------------------------------------------------------- + # Interactive UNIX requires -linet instead of -lsocket, plus it + # needs net/errno.h to define the socket-related error codes. + #-------------------------------------------------------------------- + + AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) + AC_CHECK_HEADER(net/errno.h, [ + AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) + + #-------------------------------------------------------------------- + # Check for the existence of the -lsocket and -lnsl libraries. + # The order here is important, so that they end up in the right + # order in the command line generated by make. Here are some + # special considerations: + # 1. Use "connect" and "accept" to check for -lsocket, and + # "gethostbyname" to check for -lnsl. + # 2. Use each function name only once: can't redo a check because + # autoconf caches the results of the last check and won't redo it. + # 3. Use -lnsl and -lsocket only if they supply procedures that + # aren't already present in the normal libraries. This is because + # IRIX 5.2 has libraries, but they aren't needed and they're + # bogus: they goof up name resolution if used. + # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. + # To get around this problem, check for both libraries together + # if -lsocket doesn't work by itself. + #-------------------------------------------------------------------- + + tcl_checkBoth=0 + AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) + if test "$tcl_checkSocket" = 1; then + AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, + LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) + fi + if test "$tcl_checkBoth" = 1; then + tk_oldLibs=$LIBS + LIBS="$LIBS -lsocket -lnsl" + AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) + fi + AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, + [LIBS="$LIBS -lnsl"])]) + + # TEA specific: Don't perform the eval of the libraries here because + # DL_LIBS won't be set until we call TEA_CONFIG_CFLAGS + + TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' + AC_SUBST(TCL_LIBS) + AC_SUBST(MATH_LIBS) +]) + +#-------------------------------------------------------------------- +# TEA_TCL_EARLY_FLAGS +# +# Check for what flags are needed to be passed so the correct OS +# features are available. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# _ISOC99_SOURCE +# _LARGEFILE64_SOURCE +# _LARGEFILE_SOURCE64 +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_EARLY_FLAG],[ + AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), + AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, + AC_TRY_COMPILE([[#define ]$1[ 1 +]$2], $3, + [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, + [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) + if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then + AC_DEFINE($1, 1, [Add the ]$1[ flag when building]) + tcl_flags="$tcl_flags $1" + fi +]) + +AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ + AC_MSG_CHECKING([for required early compiler flags]) + tcl_flags="" + TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], + [char *p = (char *)strtoll; char *q = (char *)strtoull;]) + TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], + [struct stat64 buf; int i = stat64("/", &buf);]) + TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include ], + [char *p = (char *)open64;]) + if test "x${tcl_flags}" = "x" ; then + AC_MSG_RESULT([none]) + else + AC_MSG_RESULT([${tcl_flags}]) + fi +]) + +#-------------------------------------------------------------------- +# TEA_TCL_64BIT_FLAGS +# +# Check for what is defined in the way of 64-bit features. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# TCL_WIDE_INT_IS_LONG +# TCL_WIDE_INT_TYPE +# HAVE_STRUCT_DIRENT64 +# HAVE_STRUCT_STAT64 +# HAVE_TYPE_OFF64_T +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ + AC_MSG_CHECKING([for 64-bit integer type]) + AC_CACHE_VAL(tcl_cv_type_64bit,[ + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 + AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], + tcl_type_64bit=__int64, tcl_type_64bit="long long") + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + AC_TRY_COMPILE(,[switch (0) { + case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; + }],tcl_cv_type_64bit=${tcl_type_64bit})]) + if test "${tcl_cv_type_64bit}" = none ; then + AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?]) + AC_MSG_RESULT([using long]) + elif test "${tcl_cv_type_64bit}" = "__int64" \ + -a "${TEA_PLATFORM}" = "windows" ; then + # TEA specific: We actually want to use the default tcl.h checks in + # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* + AC_MSG_RESULT([using Tcl header defaults]) + else + AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, + [What type should be used to define wide integers?]) + AC_MSG_RESULT([${tcl_cv_type_64bit}]) + + # Now check for auxiliary declarations + AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ + AC_TRY_COMPILE([#include +#include ],[struct dirent64 p;], + tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) + if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then + AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) + fi + + AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ + AC_TRY_COMPILE([#include ],[struct stat64 p; +], + tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) + fi + + AC_CHECK_FUNCS(open64 lseek64) + AC_MSG_CHECKING([for off64_t]) + AC_CACHE_VAL(tcl_cv_type_off64_t,[ + AC_TRY_COMPILE([#include ],[off64_t offset; +], + tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) + dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the + dnl functions lseek64 and open64 are defined. + if test "x${tcl_cv_type_off64_t}" = "xyes" && \ + test "x${ac_cv_func_lseek64}" = "xyes" && \ + test "x${ac_cv_func_open64}" = "xyes" ; then + AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + fi +]) + +## +## Here ends the standard Tcl configuration bits and starts the +## TEA specific functions +## + +#------------------------------------------------------------------------ +# TEA_INIT -- +# +# Init various Tcl Extension Architecture (TEA) variables. +# This should be the first called TEA_* macro. +# +# Arguments: +# none +# +# Results: +# +# Defines and substs the following vars: +# CYGPATH +# EXEEXT +# Defines only: +# TEA_VERSION +# TEA_INITED +# TEA_PLATFORM (windows or unix) +# +# "cygpath" is used on windows to generate native path names for include +# files. These variables should only be used with the compiler and linker +# since they generate native path names. +# +# EXEEXT +# Select the executable extension based on the host type. This +# is a lightweight replacement for AC_EXEEXT that doesn't require +# a compiler. +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_INIT], [ + # TEA extensions pass this us the version of TEA they think they + # are compatible with. + TEA_VERSION="3.7" + + AC_MSG_CHECKING([for correct TEA configuration]) + if test x"${PACKAGE_NAME}" = x ; then + AC_MSG_ERROR([ +The PACKAGE_NAME variable must be defined by your TEA configure.in]) + fi + if test x"$1" = x ; then + AC_MSG_ERROR([ +TEA version not specified.]) + elif test "$1" != "${TEA_VERSION}" ; then + AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"]) + else + AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) + fi + case "`uname -s`" in + *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) + AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) + EXEEXT=".exe" + TEA_PLATFORM="windows" + ;; + *) + CYGPATH=echo + EXEEXT="" + TEA_PLATFORM="unix" + ;; + esac + + # Check if exec_prefix is set. If not use fall back to prefix. + # Note when adjusted, so that TEA_PREFIX can correct for this. + # This is needed for recursive configures, since autoconf propagates + # $prefix, but not $exec_prefix (doh!). + if test x$exec_prefix = xNONE ; then + exec_prefix_default=yes + exec_prefix=$prefix + fi + + AC_SUBST(EXEEXT) + AC_SUBST(CYGPATH) + + # This package name must be replaced statically for AC_SUBST to work + AC_SUBST(PKG_LIB_FILE) + # Substitute STUB_LIB_FILE in case package creates a stub library too. + AC_SUBST(PKG_STUB_LIB_FILE) + + # We AC_SUBST these here to ensure they are subst'ed, + # in case the user doesn't call TEA_ADD_... + AC_SUBST(PKG_STUB_SOURCES) + AC_SUBST(PKG_STUB_OBJECTS) + AC_SUBST(PKG_TCL_SOURCES) + AC_SUBST(PKG_HEADERS) + AC_SUBST(PKG_INCLUDES) + AC_SUBST(PKG_LIBS) + AC_SUBST(PKG_CFLAGS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_SOURCES -- +# +# Specify one or more source files. Users should check for +# the right platform before adding to their list. +# It is not important to specify the directory, as long as it is +# in the generic, win or unix subdirectory of $(srcdir). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_SOURCES +# PKG_OBJECTS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_SOURCES], [ + vars="$@" + for i in $vars; do + case $i in + [\$]*) + # allow $-var names + PKG_SOURCES="$PKG_SOURCES $i" + PKG_OBJECTS="$PKG_OBJECTS $i" + ;; + *) + # check for existence - allows for generic/win/unix VPATH + # To add more dirs here (like 'src'), you have to update VPATH + # in Makefile.in as well + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + AC_MSG_ERROR([could not find source file '$i']) + fi + PKG_SOURCES="$PKG_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" + fi + PKG_OBJECTS="$PKG_OBJECTS $j" + ;; + esac + done + AC_SUBST(PKG_SOURCES) + AC_SUBST(PKG_OBJECTS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_STUB_SOURCES -- +# +# Specify one or more source files. Users should check for +# the right platform before adding to their list. +# It is not important to specify the directory, as long as it is +# in the generic, win or unix subdirectory of $(srcdir). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_STUB_SOURCES +# PKG_STUB_OBJECTS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_STUB_SOURCES], [ + vars="$@" + for i in $vars; do + # check for existence - allows for generic/win/unix VPATH + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + AC_MSG_ERROR([could not find stub source file '$i']) + fi + PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" + fi + PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" + done + AC_SUBST(PKG_STUB_SOURCES) + AC_SUBST(PKG_STUB_OBJECTS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_TCL_SOURCES -- +# +# Specify one or more Tcl source files. These should be platform +# independent runtime files. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_TCL_SOURCES +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_TCL_SOURCES], [ + vars="$@" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) + fi + PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" + done + AC_SUBST(PKG_TCL_SOURCES) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_HEADERS -- +# +# Specify one or more source headers. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_HEADERS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_HEADERS], [ + vars="$@" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + AC_MSG_ERROR([could not find header file '${srcdir}/$i']) + fi + PKG_HEADERS="$PKG_HEADERS $i" + done + AC_SUBST(PKG_HEADERS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_INCLUDES -- +# +# Specify one or more include dirs. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_INCLUDES +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_INCLUDES], [ + vars="$@" + for i in $vars; do + PKG_INCLUDES="$PKG_INCLUDES $i" + done + AC_SUBST(PKG_INCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_LIBS -- +# +# Specify one or more libraries. Users should check for +# the right platform before adding to their list. For Windows, +# libraries provided in "foo.lib" format will be converted to +# "-lfoo" when using GCC (mingw). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_LIBS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_LIBS], [ + vars="$@" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + AC_SUBST(PKG_LIBS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_CFLAGS -- +# +# Specify one or more CFLAGS. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_CFLAGS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_CFLAGS], [ + PKG_CFLAGS="$PKG_CFLAGS $@" + AC_SUBST(PKG_CFLAGS) +]) + +#------------------------------------------------------------------------ +# TEA_PREFIX -- +# +# Handle the --prefix=... option by defaulting to what Tcl gave +# +# Arguments: +# none +# +# Results: +# +# If --prefix or --exec-prefix was not specified, $prefix and +# $exec_prefix will be set to the values given to Tcl when it was +# configured. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_PREFIX], [ + if test "${prefix}" = "NONE"; then + prefix_default=yes + if test x"${TCL_PREFIX}" != x; then + AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) + prefix=${TCL_PREFIX} + else + AC_MSG_NOTICE([--prefix defaulting to /usr/local]) + prefix=/usr/local + fi + fi + if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ + -o x"${exec_prefix_default}" = x"yes" ; then + if test x"${TCL_EXEC_PREFIX}" != x; then + AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) + exec_prefix=${TCL_EXEC_PREFIX} + else + AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) + exec_prefix=$prefix + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_SETUP_COMPILER_CC -- +# +# Do compiler checks the way we want. This is just a replacement +# for AC_PROG_CC in TEA configure.in files to make them cleaner. +# +# Arguments: +# none +# +# Results: +# +# Sets up CC var and other standard bits we need to make executables. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_SETUP_COMPILER_CC], [ + # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) + # in this macro, they need to go into TEA_SETUP_COMPILER instead. + + # If the user did not set CFLAGS, set it now to keep + # the AC_PROG_CC macro from adding "-g -O2". + if test "${CFLAGS+set}" != "set" ; then + CFLAGS="" + fi + + AC_PROG_CC + AC_PROG_CPP + + AC_PROG_INSTALL + + #-------------------------------------------------------------------- + # Checks to see if the make program sets the $MAKE variable. + #-------------------------------------------------------------------- + + AC_PROG_MAKE_SET + + #-------------------------------------------------------------------- + # Find ranlib + #-------------------------------------------------------------------- + + AC_PROG_RANLIB + + #-------------------------------------------------------------------- + # Determines the correct binary file extension (.o, .obj, .exe etc.) + #-------------------------------------------------------------------- + + AC_OBJEXT + AC_EXEEXT +]) + +#------------------------------------------------------------------------ +# TEA_SETUP_COMPILER -- +# +# Do compiler checks that use the compiler. This must go after +# TEA_SETUP_COMPILER_CC, which does the actual compiler check. +# +# Arguments: +# none +# +# Results: +# +# Sets up CC var and other standard bits we need to make executables. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_SETUP_COMPILER], [ + # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. + AC_REQUIRE([TEA_SETUP_COMPILER_CC]) + + #------------------------------------------------------------------------ + # If we're using GCC, see if the compiler understands -pipe. If so, use it. + # It makes compiling go faster. (This is only a performance feature.) + #------------------------------------------------------------------------ + + if test -z "$no_pipe" -a -n "$GCC"; then + AC_CACHE_CHECK([if the compiler understands -pipe], + tcl_cv_cc_pipe, [ + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" + AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_pipe = yes; then + CFLAGS="$CFLAGS -pipe" + fi + fi + + #-------------------------------------------------------------------- + # Common compiler flag setup + #-------------------------------------------------------------------- + + AC_C_BIGENDIAN + if test "${TEA_PLATFORM}" = "unix" ; then + TEA_TCL_LINK_LIBS + TEA_MISSING_POSIX_HEADERS + # Let the user call this, because if it triggers, they will + # need a compat/strtod.c that is correct. Users can also + # use Tcl_GetDouble(FromObj) instead. + #TEA_BUGGY_STRTOD + fi +]) + +#------------------------------------------------------------------------ +# TEA_MAKE_LIB -- +# +# Generate a line that can be used to build a shared/unshared library +# in a platform independent manner. +# +# Arguments: +# none +# +# Requires: +# +# Results: +# +# Defines the following vars: +# CFLAGS - Done late here to note disturb other AC macros +# MAKE_LIB - Command to execute to build the Tcl library; +# differs depending on whether or not Tcl is being +# compiled as a shared library. +# MAKE_SHARED_LIB Makefile rule for building a shared library +# MAKE_STATIC_LIB Makefile rule for building a static library +# MAKE_STUB_LIB Makefile rule for building a stub library +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_MAKE_LIB], [ + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then + MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)" + MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)" + else + MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" + MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" + fi + + if test "${SHARED_BUILD}" = "1" ; then + MAKE_LIB="${MAKE_SHARED_LIB} " + else + MAKE_LIB="${MAKE_STATIC_LIB} " + fi + + #-------------------------------------------------------------------- + # Shared libraries and static libraries have different names. + # Use the double eval to make sure any variables in the suffix is + # substituted. (@@@ Might not be necessary anymore) + #-------------------------------------------------------------------- + + if test "${TEA_PLATFORM}" = "windows" ; then + if test "${SHARED_BUILD}" = "1" ; then + # We force the unresolved linking of symbols that are really in + # the private libraries of Tcl and Tk. + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" + fi + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + else + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + if test "$GCC" = "yes"; then + PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} + fi + # These aren't needed on Windows (either MSVC or gcc) + RANLIB=: + RANLIB_STUB=: + else + RANLIB_STUB="${RANLIB}" + if test "${SHARED_BUILD}" = "1" ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" + fi + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + fi + + # These are escaped so that only CFLAGS is picked up at configure time. + # The other values will be substituted at make time. + CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" + if test "${SHARED_BUILD}" = "1" ; then + CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" + fi + + AC_SUBST(MAKE_LIB) + AC_SUBST(MAKE_SHARED_LIB) + AC_SUBST(MAKE_STATIC_LIB) + AC_SUBST(MAKE_STUB_LIB) + AC_SUBST(RANLIB_STUB) +]) + +#------------------------------------------------------------------------ +# TEA_LIB_SPEC -- +# +# Compute the name of an existing object library located in libdir +# from the given base name and produce the appropriate linker flags. +# +# Arguments: +# basename The base name of the library without version +# numbers, extensions, or "lib" prefixes. +# extra_dir Extra directory in which to search for the +# library. This location is used first, then +# $prefix/$exec-prefix, then some defaults. +# +# Requires: +# TEA_INIT and TEA_PREFIX must be called first. +# +# Results: +# +# Defines the following vars: +# ${basename}_LIB_NAME The computed library name. +# ${basename}_LIB_SPEC The computed linker flags. +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LIB_SPEC], [ + AC_MSG_CHECKING([for $1 library]) + + # Look in exec-prefix for the library (defined by TEA_PREFIX). + + tea_lib_name_dir="${exec_prefix}/lib" + + # Or in a user-specified location. + + if test x"$2" != x ; then + tea_extra_lib_dir=$2 + else + tea_extra_lib_dir=NONE + fi + + for i in \ + `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do + if test -f "$i" ; then + tea_lib_name_dir=`dirname $i` + $1_LIB_NAME=`basename $i` + $1_LIB_PATH_NAME=$i + break + fi + done + + if test "${TEA_PLATFORM}" = "windows"; then + $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" + else + # Strip off the leading "lib" and trailing ".a" or ".so" + + tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` + $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" + fi + + if test "x${$1_LIB_NAME}" = x ; then + AC_MSG_ERROR([not found]) + else + AC_MSG_RESULT([${$1_LIB_SPEC}]) + fi +]) + +#------------------------------------------------------------------------ +# TEA_PRIVATE_TCL_HEADERS -- +# +# Locate the private Tcl include files +# +# Arguments: +# +# Requires: +# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has +# already been called. +# +# Results: +# +# Substs the following vars: +# TCL_TOP_DIR_NATIVE +# TCL_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ + # Allow for --with-tclinclude to take effect and define ${ac_cv_c_tclh} + AC_REQUIRE([TEA_PUBLIC_TCL_HEADERS]) + AC_MSG_CHECKING([for Tcl private include files]) + + TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` + TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" + + # Check to see if tclPort.h isn't already with the public headers + # Don't look for tclInt.h because that resides with tcl.h in the core + # sources, but the Port headers are in a different directory + if test "${TEA_PLATFORM}" = "windows" -a \ + -f "${ac_cv_c_tclh}/tclWinPort.h"; then + result="private headers found with public headers" + elif test "${TEA_PLATFORM}" = "unix" -a \ + -f "${ac_cv_c_tclh}/tclUnixPort.h"; then + result="private headers found with public headers" + else + TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" + if test "${TEA_PLATFORM}" = "windows"; then + TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" + else + TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" + fi + # Overwrite the previous TCL_INCLUDES as this should capture both + # public and private headers in the same set. + # We want to ensure these are substituted so as not to require + # any *_NATIVE vars be defined in the Makefile + TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers and PrivateHeaders directories + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -d "${TCL_BIN_DIR}/Headers" -a \ + -d "${TCL_BIN_DIR}/PrivateHeaders"; then + TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}" + else + TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`" + fi + ;; + esac + result="Using ${TCL_INCLUDES}" + else + if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then + AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}]) + fi + result="Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}" + fi + fi + + AC_SUBST(TCL_TOP_DIR_NATIVE) + + AC_SUBST(TCL_INCLUDES) + AC_MSG_RESULT([${result}]) +]) + +#------------------------------------------------------------------------ +# TEA_PUBLIC_TCL_HEADERS -- +# +# Locate the installed public Tcl header files +# +# Arguments: +# None. +# +# Requires: +# CYGPATH must be set +# +# Results: +# +# Adds a --with-tclinclude switch to configure. +# Result is cached. +# +# Substs the following vars: +# TCL_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ + AC_MSG_CHECKING([for Tcl public headers]) + + AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) + + AC_CACHE_VAL(ac_cv_c_tclh, [ + # Use the value from --with-tclinclude, if it was given + + if test x"${with_tclinclude}" != x ; then + if test -f "${with_tclinclude}/tcl.h" ; then + ac_cv_c_tclh=${with_tclinclude} + else + AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) + fi + else + list="" + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers directory + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tcl is not installed, + # and in that situation, look there before installed locations. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + if test x"${TCL_INCLUDE_SPEC}" != x ; then + d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` + list="$list `ls -d ${d} 2>/dev/null`" + fi + fi + for i in $list ; do + if test -f "$i/tcl.h" ; then + ac_cv_c_tclh=$i + break + fi + done + fi + ]) + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tclh}" = x ; then + AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) + else + AC_MSG_RESULT([${ac_cv_c_tclh}]) + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` + + TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + AC_SUBST(TCL_INCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_PRIVATE_TK_HEADERS -- +# +# Locate the private Tk include files +# +# Arguments: +# +# Requires: +# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has +# already been called. +# +# Results: +# +# Substs the following vars: +# TK_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ + # Allow for --with-tkinclude to take effect and define ${ac_cv_c_tkh} + AC_REQUIRE([TEA_PUBLIC_TK_HEADERS]) + AC_MSG_CHECKING([for Tk private include files]) + + TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` + TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" + + # Check to see if tkPort.h isn't already with the public headers + # Don't look for tkInt.h because that resides with tk.h in the core + # sources, but the Port headers are in a different directory + if test "${TEA_PLATFORM}" = "windows" -a \ + -f "${ac_cv_c_tkh}/tkWinPort.h"; then + result="private headers found with public headers" + elif test "${TEA_PLATFORM}" = "unix" -a \ + -f "${ac_cv_c_tkh}/tkUnixPort.h"; then + result="private headers found with public headers" + else + TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" + TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" + if test "${TEA_PLATFORM}" = "windows"; then + TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" + else + TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" + fi + # Overwrite the previous TK_INCLUDES as this should capture both + # public and private headers in the same set. + # We want to ensure these are substituted so as not to require + # any *_NATIVE vars be defined in the Makefile + TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" + # Detect and add ttk subdir + if test -d "${TK_SRC_DIR}/generic/ttk"; then + TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\"" + fi + if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then + TK_INCLUDES="${TK_INCLUDES} -I\"${TK_XLIB_DIR_NATIVE}\"" + fi + if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then + TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/macosx\"" + fi + if test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use + # the framework's Headers and PrivateHeaders directories + case ${TK_DEFS} in + *TK_FRAMEWORK*) + if test -d "${TK_BIN_DIR}/Headers" -a \ + -d "${TK_BIN_DIR}/PrivateHeaders"; then + TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}" + else + TK_INCLUDES="${TK_INCLUDES} ${TK_INCLUDE_SPEC} `echo "${TK_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`" + fi + ;; + esac + result="Using ${TK_INCLUDES}" + else + if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then + AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}]) + fi + result="Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}" + fi + fi + + AC_SUBST(TK_TOP_DIR_NATIVE) + AC_SUBST(TK_XLIB_DIR_NATIVE) + + AC_SUBST(TK_INCLUDES) + AC_MSG_RESULT([${result}]) +]) + +#------------------------------------------------------------------------ +# TEA_PUBLIC_TK_HEADERS -- +# +# Locate the installed public Tk header files +# +# Arguments: +# None. +# +# Requires: +# CYGPATH must be set +# +# Results: +# +# Adds a --with-tkinclude switch to configure. +# Result is cached. +# +# Substs the following vars: +# TK_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ + AC_MSG_CHECKING([for Tk public headers]) + + AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval}) + + AC_CACHE_VAL(ac_cv_c_tkh, [ + # Use the value from --with-tkinclude, if it was given + + if test x"${with_tkinclude}" != x ; then + if test -f "${with_tkinclude}/tk.h" ; then + ac_cv_c_tkh=${with_tkinclude} + else + AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) + fi + else + list="" + if test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use + # the framework's Headers directory. + case ${TK_DEFS} in + *TK_FRAMEWORK*) + list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tk is not installed, + # and in that situation, look there before installed locations. + if test -f "${TK_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tk's --prefix location, + # relative to directory of tkConfig.sh, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TK_PREFIX}/include 2>/dev/null` \ + `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + if test x"${TK_INCLUDE_SPEC}" != x ; then + d=`echo "${TK_INCLUDE_SPEC}" | sed -e 's/^-I//'` + list="$list `ls -d ${d} 2>/dev/null`" + fi + fi + for i in $list ; do + if test -f "$i/tk.h" ; then + ac_cv_c_tkh=$i + break + fi + done + fi + ]) + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tkh}" = x ; then + AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) + else + AC_MSG_RESULT([${ac_cv_c_tkh}]) + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` + + TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + AC_SUBST(TK_INCLUDES) + + if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then + # On Windows and Aqua, we need the X compat headers + AC_MSG_CHECKING([for X11 header files]) + if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then + INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" + TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + AC_SUBST(TK_XINCLUDES) + fi + AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) + fi +]) + +#------------------------------------------------------------------------ +# TEA_PATH_CONFIG -- +# +# Locate the ${1}Config.sh file and perform a sanity check on +# the ${1} compile flags. These are used by packages like +# [incr Tk] that load *Config.sh files from more than Tcl and Tk. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-$1=... +# +# Defines the following vars: +# $1_BIN_DIR Full path to the directory containing +# the $1Config.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_CONFIG], [ + # + # Ok, lets find the $1 configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-$1 + # + + if test x"${no_$1}" = x ; then + # we reset no_$1 in case something fails here + no_$1=true + AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) + AC_MSG_CHECKING([for $1 configuration]) + AC_CACHE_VAL(ac_cv_c_$1config,[ + + # First check to see if --with-$1 was specified. + if test x"${with_$1config}" != x ; then + case ${with_$1config} in + */$1Config.sh ) + if test -f ${with_$1config}; then + AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) + with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` + fi;; + esac + if test -f "${with_$1config}/$1Config.sh" ; then + ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` + else + AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) + fi + fi + + # then check for a private $1 installation + if test x"${ac_cv_c_$1config}" = x ; then + for i in \ + ../$1 \ + `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ../../$1 \ + `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ../../../$1 \ + `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ${srcdir}/../$1 \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ; do + if test -f "$i/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i; pwd)` + break + fi + if test -f "$i/unix/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i/unix; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_$1config}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_$1config}" = x ; then + $1_BIN_DIR="# no $1 configs found" + AC_MSG_WARN([Cannot find $1 configuration definitions]) + exit 0 + else + no_$1= + $1_BIN_DIR=${ac_cv_c_$1config} + AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_CONFIG -- +# +# Load the $1Config.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# $1_BIN_DIR +# +# Results: +# +# Subst the following vars: +# $1_SRC_DIR +# $1_LIB_FILE +# $1_LIB_SPEC +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_CONFIG], [ + AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) + + if test -f "${$1_BIN_DIR}/$1Config.sh" ; then + AC_MSG_RESULT([loading]) + . "${$1_BIN_DIR}/$1Config.sh" + else + AC_MSG_RESULT([file not found]) + fi + + # + # If the $1_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable $1_LIB_SPEC will be set to the value + # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC + # instead of $1_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + # + + if test -f "${$1_BIN_DIR}/Makefile" ; then + AC_MSG_WARN([Found Makefile - using build library specs for $1]) + $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} + $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} + $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} + fi + + AC_SUBST($1_VERSION) + AC_SUBST($1_BIN_DIR) + AC_SUBST($1_SRC_DIR) + + AC_SUBST($1_LIB_FILE) + AC_SUBST($1_LIB_SPEC) + + AC_SUBST($1_STUB_LIB_FILE) + AC_SUBST($1_STUB_LIB_SPEC) + AC_SUBST($1_STUB_LIB_PATH) +]) + +#------------------------------------------------------------------------ +# TEA_PATH_CELIB -- +# +# Locate Keuchel's celib emulation layer for targeting Win/CE +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-celib=... +# +# Defines the following vars: +# CELIB_DIR Full path to the directory containing +# the include and platform lib files +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_CELIB], [ + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-celib + + if test x"${no_celib}" = x ; then + # we reset no_celib in case something fails here + no_celib=true + AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval}) + AC_MSG_CHECKING([for Windows/CE celib directory]) + AC_CACHE_VAL(ac_cv_c_celibconfig,[ + # First check to see if --with-celibconfig was specified. + if test x"${with_celibconfig}" != x ; then + if test -d "${with_celibconfig}/inc" ; then + ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` + else + AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory]) + fi + fi + + # then check for a celib library + if test x"${ac_cv_c_celibconfig}" = x ; then + for i in \ + ../celib-palm-3.0 \ + ../celib \ + ../../celib-palm-3.0 \ + ../../celib \ + `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \ + ${srcdir}/../celib-palm-3.0 \ + ${srcdir}/../celib \ + `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \ + ; do + if test -d "$i/inc" ; then + ac_cv_c_celibconfig=`(cd $i; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_celibconfig}" = x ; then + AC_MSG_ERROR([Cannot find celib support library directory]) + else + no_celib= + CELIB_DIR=${ac_cv_c_celibconfig} + CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` + AC_MSG_RESULT([found $CELIB_DIR]) + fi + fi +]) + + +# Local Variables: +# mode: autoconf +# End: diff --git a/tests/a.tcl b/tests/a.tcl new file mode 100644 index 0000000..c96014f --- /dev/null +++ b/tests/a.tcl @@ -0,0 +1,13 @@ +package require TclCurl + +set curlHandle [curl::init] + +$curlHandle configure -url "http://127.0.0.1" -protocols [list http https ftp] + +$curlHandle cleanup + + + + + + diff --git a/tests/a.tcl~ b/tests/a.tcl~ new file mode 100644 index 0000000..2bc63fb --- /dev/null +++ b/tests/a.tcl~ @@ -0,0 +1,13 @@ +package require TclCurl + +set curlHandle [curl::init] + +$curlHandle configure -url "http://127.0.0.1" -ftpssl 1 -protocols [list http https ftp] + +$curlHandle cleanup + + + + + + diff --git a/tests/basico.tcl b/tests/basico.tcl new file mode 100755 index 0000000..18f4d7e --- /dev/null +++ b/tests/basico.tcl @@ -0,0 +1,8 @@ +package require TclCurl + +curl::transfer -url "127.0.0.1" + + + + + diff --git a/tests/bodyVar.tcl b/tests/bodyVar.tcl new file mode 100755 index 0000000..ef3a9a0 --- /dev/null +++ b/tests/bodyVar.tcl @@ -0,0 +1,36 @@ +package require TclCurl + +# These tests has some urls that don't exists outside my system, +# so IT WON'T WORK FOR YOU unless you change them. + +set curlHandle [curl::init] +$curlHandle configure -url "127.0.0.1" -bodyvar body -noprogress 1 +$curlHandle perform + +$curlHandle configure -url "127.0.0.1/~andres/" -bodyvar newBody +$curlHandle perform + +$curlHandle cleanup + +puts "First page:" +puts $body + +puts "Second page:" +puts $newBody + +# You can also use it for binary transfers + +curl::transfer \ + -url {127.0.0.1/~andres/HomePage/getleft/images/getleft.png} \ + -bodyvar image -noprogress 1 -verbose 1 + +if [catch {open "getleft.png" w} out] { + puts "Could not open $out." + exit +} + +fconfigure $out -translation binary +puts $out $image +close $out + + diff --git a/tests/bufferSize.tcl b/tests/bufferSize.tcl new file mode 100755 index 0000000..1be1cee --- /dev/null +++ b/tests/bufferSize.tcl @@ -0,0 +1,24 @@ +package require TclCurl + +# This is one contrived example, but it works. + +proc writeToFile {readData} { + puts "writeToFile called [incr ::i]" + puts -nonewline $::inFile $readData + + return +} + +set i 0 + +set inFile [open "cosa.tar" w+] +fconfigure $inFile -translation binary + +curl::transfer -url "127.0.0.1/~andres/cosa&co.tar" \ + -writeproc writeToFile -buffersize 250 + +close $inFile + + + + diff --git a/tests/command.tcl b/tests/command.tcl new file mode 100755 index 0000000..6977052 --- /dev/null +++ b/tests/command.tcl @@ -0,0 +1,10 @@ +package require TclCurl + +curl::transfer -url "127.0.0.1" -command "puts \"\nTransfer complete\n\"" + + + + + + + diff --git a/tests/cookie.tcl b/tests/cookie.tcl new file mode 100755 index 0000000..cbc9a63 --- /dev/null +++ b/tests/cookie.tcl @@ -0,0 +1,8 @@ +package require TclCurl + +curl::transfer -url "127.0.0.1" -cookie "name=andres;" -verbose 1 + + + + + diff --git a/tests/cookieFile.tcl b/tests/cookieFile.tcl new file mode 100755 index 0000000..4a993fb --- /dev/null +++ b/tests/cookieFile.tcl @@ -0,0 +1,13 @@ +package require TclCurl + +if {![file exists /home/andres/.getleft/cookies]} { + puts "The given cookie file doesn't exist" +} + +curl::transfer -url 127.0.0.1 \ + -cookiefile "/home/andres/.getleft/cookies" -verbose 1 + + + + + diff --git a/tests/curlConfig.tcl b/tests/curlConfig.tcl new file mode 100755 index 0000000..987d544 --- /dev/null +++ b/tests/curlConfig.tcl @@ -0,0 +1,12 @@ +package require TclCurl + +puts "cURL is installed in: [curl::curlConfig -prefix]" + +set compiledOptions [curl::curlConfig -feature] +regsub -all {\n} $compiledOptions { - } compiledOptions +puts "The compiled options: $compiledOptions" + +puts "The version in hex: [curl::curlConfig -vernum]" + +puts "The built-in path to the CA cert bundle:\n\t[curl::curlConfig -ca]" + diff --git a/tests/debugProc.tcl b/tests/debugProc.tcl new file mode 100755 index 0000000..fd2ebdb --- /dev/null +++ b/tests/debugProc.tcl @@ -0,0 +1,41 @@ +package require TclCurl + +proc DebugProc {infoType data} { + + switch $infoType { + 0 { + set type "text" + } + 1 { + set type "incoming header" + } + 2 { + set type "outgoing header" + } + 3 { + set type "incoming data" + } + 4 { + set type "outgoing data" + } + 5 { + set type "incoming SSL data" + } + 6 { + set type "outgoing SSL data" + } + } + + puts "Type: $type - Data:" + puts "$data" + + return 0 +} + +set curlHandle [curl::init] + +$curlHandle configure -url 127.0.0.1 -verbose 1 \ + -debugproc DebugProc + +$curlHandle perform +$curlHandle cleanup diff --git a/tests/dict.tcl b/tests/dict.tcl new file mode 100755 index 0000000..d32b9f8 --- /dev/null +++ b/tests/dict.tcl @@ -0,0 +1,7 @@ +package require TclCurl + +curl::transfer -url "dict://dict.org/m:curl" + + + + diff --git a/tests/dupHandle.tcl b/tests/dupHandle.tcl new file mode 100755 index 0000000..3fc73a5 --- /dev/null +++ b/tests/dupHandle.tcl @@ -0,0 +1,16 @@ +package require TclCurl + +set curlHandle1 [curl::init] + +$curlHandle1 configure -url 127.0.0.1 + +set curlHandle2 [$curlHandle1 duphandle] + +$curlHandle1 configure -url 127.0.0.1/~andres/ + +$curlHandle2 perform + + +$curlHandle1 cleanup +$curlHandle2 cleanup + diff --git a/tests/encoding.tcl b/tests/encoding.tcl new file mode 100755 index 0000000..4f6e842 --- /dev/null +++ b/tests/encoding.tcl @@ -0,0 +1,9 @@ +package require TclCurl + +curl::transfer -url "http://127.0.0.1" -encoding deflated -verbose 1 + +curl::transfer -url "http://127.0.0.1" -encoding all -verbose 1 + + + + diff --git a/tests/errorBuffer.tcl b/tests/errorBuffer.tcl new file mode 100755 index 0000000..e90896c --- /dev/null +++ b/tests/errorBuffer.tcl @@ -0,0 +1,23 @@ +package require TclCurl + +set curlHandle [curl::init] +$curlHandle configure -url "Shire.Asturias.com" -errorbuffer errorMsg + +if {[catch {$curlHandle perform}]} { + puts "The error message: $errorMsg" +} + +$curlHandle configure -url "Shire.Asturias.com" -errorbuffer error(msg) + +if {[catch {$curlHandle perform}]} { + puts "The error message: $error(msg)" +} + +$curlHandle cleanup + +unset error +catch {curl::transfer -url "Shire.Asturias.com" -errorbuffer error(msg)} + +puts "Error: $error(msg)" + + diff --git a/tests/escape.tcl b/tests/escape.tcl new file mode 100755 index 0000000..b4bb6d4 --- /dev/null +++ b/tests/escape.tcl @@ -0,0 +1,6 @@ +package require TclCurl + + +set escaped [curl::escape {What about this?}] +puts "String to escape: What about this? - $escaped" +puts "And the reverse: [curl::unescape $escaped]" diff --git a/tests/failOnError.tcl b/tests/failOnError.tcl new file mode 100755 index 0000000..ed2ea67 --- /dev/null +++ b/tests/failOnError.tcl @@ -0,0 +1,17 @@ +package require TclCurl + +set curlHandle [curl::init] +$curlHandle configure -url "127.0.0.1/cosa.html" + +$curlHandle configure -failonerror 0 ; # This is the default +puts "With failonerror==0:" +catch {$curlHandle perform} +puts "\n\n\n\n\n" +puts "With failonerror==1:" +$curlHandle configure -failonerror 1 +catch {$curlHandle perform} + +$curlHandle cleanup + + + diff --git a/tests/file.tcl b/tests/file.tcl new file mode 100755 index 0000000..6643a12 --- /dev/null +++ b/tests/file.tcl @@ -0,0 +1,17 @@ +package require TclCurl + +set curlHandle [curl::init] +$curlHandle configure -url "127.0.0.1" -file "index.html" +$curlHandle perform + +puts "First transfer finished\n" + +$curlHandle configure -header 1 -file cosa.html +$curlHandle perform + +$curlHandle cleanup + + + + + diff --git a/tests/fileNoFile.tcl b/tests/fileNoFile.tcl new file mode 100755 index 0000000..27dae9f --- /dev/null +++ b/tests/fileNoFile.tcl @@ -0,0 +1,20 @@ +package require TclCurl + +set curlHandle [curl::init] + +puts "First we save in 'index.html'" + +$curlHandle configure -noprogress 1 -url "127.0.0.1" -file "index.html" +$curlHandle perform + +puts "And now in stdout" + +$curlHandle configure -file "" +$curlHandle perform + +$curlHandle cleanup + + + + + diff --git a/tests/formGet.tcl b/tests/formGet.tcl new file mode 100755 index 0000000..9b74b02 --- /dev/null +++ b/tests/formGet.tcl @@ -0,0 +1,13 @@ +package require TclCurl + +curl::transfer -url "http://www.google.com/search?q=TclCurl&hl=en&btnG=Google+Search+&lr=" \ + -file tclcurl.html -cookiejar [file join [file dirname [info script]] cookieJar.txt] +puts "Transfer saved in 'tclcurl.html'" +puts "Cookies en el fichero: [file join [file dirname [info script]] cookieJar.txt]" + + + + + + + diff --git a/tests/ftp.tcl b/tests/ftp.tcl new file mode 100755 index 0000000..e3f0533 --- /dev/null +++ b/tests/ftp.tcl @@ -0,0 +1,22 @@ +package require TclCurl + +puts "nobody==1 --- header==1" +curl::transfer -url "ftp://127.0.0.1/pub/indust2.gif" -nobody 1 -header 1 + +puts "nobody==0 --- header ignored" +curl::transfer -url "ftp://127.0.0.1/pub/indust2.gif" -nobody 0 \ + -file cosa.gif + +puts "nobody==1 --- HEADERS==0" +curl::transfer -url "ftp://127.0.0.1/pub/indust2.gif" -nobody 1 \ + -header 0 -postquote [list "mkdir nada"] + + + + + + + + + + diff --git a/tests/ftpList.tcl b/tests/ftpList.tcl new file mode 100755 index 0000000..04f2904 --- /dev/null +++ b/tests/ftpList.tcl @@ -0,0 +1,9 @@ +package require TclCurl + +curl::transfer -url "ftp://127.0.0.1/pub/" -ftplistonly 1 + + + + + + diff --git a/tests/ftpUpload.tcl b/tests/ftpUpload.tcl new file mode 100755 index 0000000..b30f338 --- /dev/null +++ b/tests/ftpUpload.tcl @@ -0,0 +1,25 @@ +package require TclCurl + +set buffer "" +if {[catch {curl::transfer -url ftp://127.0.0.1/Test/cosa.tcl \ + -userpwd "user:pwd" -verbose 1 \ + -infile ftpUpload.tcl -upload 1 -errorbuffer buffer \ + -quote [list "mkd Test"] \ + -postquote [list "rnfr cosa.tcl" "rnto script.tcl"] \ + } buffer]} { + puts "Error: $buffer" +} else { + puts "Upload complete" +} + + + + + + + + + + + + diff --git a/tests/getInfo.tcl b/tests/getInfo.tcl new file mode 100755 index 0000000..f19cf24 --- /dev/null +++ b/tests/getInfo.tcl @@ -0,0 +1,52 @@ +package require TclCurl + +set curlHandle [curl::init] +$curlHandle configure -url "127.0.0.1" -filetime 1 -verbose 1 \ + -cookielist "127.0.0.1\tFALSE\t/\tFALSE\t1262307600\tad_browser_id\t 18864635" +$curlHandle perform + +puts "Url: [$curlHandle getinfo effectiveurl]" +puts "Primary IP: [$curlHandle getinfo primaryip]" +puts "Redirect url: [$curlHandle getinfo redirecturl]" +puts "Http-code: [$curlHandle getinfo responsecode]" +puts "Proxy response code: [$curlHandle getinfo httpconnectcode]" +set fileTime [$curlHandle getinfo filetime] +puts "Filetime: $fileTime - [clock format $fileTime]" +puts "Total time: [$curlHandle getinfo totaltime]" +puts "Name lookup time: [$curlHandle getinfo namelookuptime]" +puts "Name connect time: [$curlHandle getinfo connecttime]" +puts "Name pretransfer time: [$curlHandle getinfo pretransfertime]" +puts "Name start transfer time: [$curlHandle getinfo starttransfertime]" +puts "Name app connect time: [$curlHandle getinfo appconnecttime]" +puts "Name size upload: [$curlHandle getinfo sizeupload]" +puts "Name size download: [$curlHandle getinfo sizedownload]" +puts "Name speed download: [$curlHandle getinfo speeddownload]" +puts "Name speed upload: [$curlHandle getinfo speedupload]" +puts "Name header size: [$curlHandle getinfo headersize]" +puts "Name request size: [$curlHandle getinfo requestsize]" +puts "Name ssl verifyresult: [$curlHandle getinfo sslverifyresult]" +puts "SSL engines: [$curlHandle getinfo sslengines]" +puts "Name length download: [$curlHandle getinfo contentlengthdownload]" +puts "Name length upload: [$curlHandle getinfo contentlengthupload]" +puts "Content-Type: [$curlHandle getinfo contenttype]" +puts "Redirect time: [$curlHandle getinfo redirecttime]" +puts "Redirect count: [$curlHandle getinfo redirectcount]" +puts "Authentication methods available: [$curlHandle getinfo httpauthavail]" +puts "Authentication methods at the proxy: [$curlHandle getinfo proxyauthavail]" +puts "Operating System error number: [$curlHandle getinfo oserrno]" +puts "Number of successful connects: [$curlHandle getinfo numconnects]" +puts "Known cookies: [$curlHandle getinfo cookielist]" +set certList [$curlHandle getinfo certinfo] +set certNum [lindex $certList 0] +puts "Nº de certificados: $certNum" +for {set i 1} {$i<=$certNum} {incr i} { + puts [lindex $certList $i] +} + +$curlHandle cleanup + + + + + + diff --git a/tests/headNoHead.tcl b/tests/headNoHead.tcl new file mode 100755 index 0000000..7947152 --- /dev/null +++ b/tests/headNoHead.tcl @@ -0,0 +1,21 @@ +package require TclCurl + +set curlHandle [curl::init] + +puts "First we save the headers in 'header.txt'" + +$curlHandle configure -noprogress 1 -nobody 1 -url "127.0.0.1" \ + -writeheader header.txt +$curlHandle perform + +puts "And now we dump them to the console" + +$curlHandle configure -writeheader "" +$curlHandle perform + +$curlHandle cleanup + + + + + diff --git a/tests/header.tcl b/tests/header.tcl new file mode 100755 index 0000000..d33b982 --- /dev/null +++ b/tests/header.tcl @@ -0,0 +1,8 @@ +package require TclCurl + +curl::transfer -url "127.0.0.1" -header 1 -nobody 1 + + + + + diff --git a/tests/headerVar.tcl b/tests/headerVar.tcl new file mode 100755 index 0000000..2c42660 --- /dev/null +++ b/tests/headerVar.tcl @@ -0,0 +1,13 @@ +package require TclCurl + +curl::transfer -url 127.0.0.1 -header 1 -nobody 1 -headervar headers + +puts "The received headers" +foreach {key content} [array get headers] { + puts "headers($key): $content" +} + + + + + diff --git a/tests/http200Aliases.tcl b/tests/http200Aliases.tcl new file mode 100755 index 0000000..07260fb --- /dev/null +++ b/tests/http200Aliases.tcl @@ -0,0 +1,12 @@ +package require TclCurl + +curl::transfer -url "127.0.0.1" -verbose 1 -nobody 1 -header 1 \ + -http200aliases [list "yummy/4.5 200 OK" "great/1.3 350 WRONG"] + + + + + + + + diff --git a/tests/httpBufferPost.tcl b/tests/httpBufferPost.tcl new file mode 100755 index 0000000..b046a26 --- /dev/null +++ b/tests/httpBufferPost.tcl @@ -0,0 +1,14 @@ +package require TclCurl + + +set fileContent "This is what we will send as if it was the content of a file" + +curl::transfer -url 127.0.0.1/cgi-bin/post1.tcl -verbose 1 -post 1 \ + -httppost [list name "firstName" contents "Andres" contenttype "text/plain" contentheader [list "adios: goodbye"]] \ + -httppost [list name "lastName" contents "Garcia"] \ + -httppost [list name "nombre" bufferName noFile.txt buffer $fileContent contenttype "text/html"] \ + -httppost [list name "submit" contents "send"] -verbose 1 + + + + diff --git a/tests/httpHeader.tcl b/tests/httpHeader.tcl new file mode 100755 index 0000000..b4a2533 --- /dev/null +++ b/tests/httpHeader.tcl @@ -0,0 +1,12 @@ +package require TclCurl + +curl::transfer -url "127.0.0.1" -verbose 1 -nobody 1 \ + -httpheader [list "hola: hello" "adios: goodbye"] + + + + + + + + diff --git a/tests/httpPost.tcl b/tests/httpPost.tcl new file mode 100755 index 0000000..ac2f882 --- /dev/null +++ b/tests/httpPost.tcl @@ -0,0 +1,14 @@ +package require TclCurl + + +curl::transfer -url 127.0.0.1/cgi-bin/post1.tcl -verbose 1 -post 1 \ + -httppost [list name "firstName" contents "Andres" contenttype "text/plain" contentheader [list "adios: goodbye"]] \ + -httppost [list name "lastName" contents "Garcia"] \ + -httppost [list name "file" file "httpPost.tcl" file "basico.tcl" contenttype text/plain filename "c:\\basico.tcl"] \ + -httppost [list name "AnotherFile" filecontent "httpBufferPost.tcl"] \ + -httppost [list name "submit" contents "send"] -verbose 1 + + + + + diff --git a/tests/httpVersion.tcl b/tests/httpVersion.tcl new file mode 100755 index 0000000..963a2ba --- /dev/null +++ b/tests/httpVersion.tcl @@ -0,0 +1,13 @@ +package require TclCurl + +curl::transfer -url "127.0.0.1" -httpversion none -verbose 1 -nobody 1 + +curl::transfer -url "127.0.0.1" -httpversion 1.0 -verbose 1 -nobody 1 + +curl::transfer -url "127.0.0.1" -httpversion 1.1 -verbose 1 -nobody 1 + + + + + + diff --git a/tests/https.tcl b/tests/https.tcl new file mode 100755 index 0000000..c9e85d4 --- /dev/null +++ b/tests/https.tcl @@ -0,0 +1,13 @@ +package require TclCurl + +if {$tcl_platform(platform)=="windows"} { + set certFile [file join $env(windir) curl-ca-bundle.crt] +} else { + set certFile /usr/local/share/curl/curl-ca-bundle.crt +} + +::curl::transfer -url https://www.paypal.com/ -cainfo $certFile \ + -file paypal.html + + +puts "https://www.paypal.com/ saved in 'paypal.html'" diff --git a/tests/interface.tcl b/tests/interface.tcl new file mode 100755 index 0000000..81eede4 --- /dev/null +++ b/tests/interface.tcl @@ -0,0 +1,11 @@ +package require TclCurl + +curl::transfer -url 127.0.0.1 -verbose 1 -interface 127.0.0.1 -nobody 1 + + + + + + + + diff --git a/tests/ipresolve.tcl b/tests/ipresolve.tcl new file mode 100755 index 0000000..68570fe --- /dev/null +++ b/tests/ipresolve.tcl @@ -0,0 +1,14 @@ +package require TclCurl + +set curlHandle [curl::init] +$curlHandle configure -url "http://127.0.0.1" -filetime 1 -ipresolve v4 \ + -verbose 1 -nobody 1 +$curlHandle perform + +$curlHandle cleanup + + + + + + diff --git a/tests/multi/auto.tcl b/tests/multi/auto.tcl new file mode 100755 index 0000000..7c69cd8 --- /dev/null +++ b/tests/multi/auto.tcl @@ -0,0 +1,31 @@ +#!/usr/local/bin/wish8.4 + +package require TclCurl + +#wm withdraw . + +proc CleanUp {multiHandle easyHandle} { + puts "\n\nCleaning up\n\n" + + $::multiHandle removehandle $::easyHandle + $::multiHandle cleanup + $::easyHandle cleanup + + puts "\n\nAll done\n\n" + + exit +} + +set multiHandle [curl::multiinit] +set easyHandle [curl::init] + +$easyHandle configure -url http://127.0.0.1/~andres/HomePage.tar.gz -file home.tar.gz + +$multiHandle addhandle $easyHandle + +puts "Starting transfer..." + +$multiHandle auto -command "CleanUp $multiHandle $easyHandle" + + + diff --git a/tests/multi/autoGUI.tcl b/tests/multi/autoGUI.tcl new file mode 100755 index 0000000..ace2423 --- /dev/null +++ b/tests/multi/autoGUI.tcl @@ -0,0 +1,31 @@ +#!/usr/local/bin/wish8.4 + +package require TclCurl + +proc CleanUp {multiHandle easyHandle} { + puts "\n\nCleaning up $multiHandle - $easyHandle\n\n" + + $multiHandle removehandle $easyHandle + $multiHandle cleanup + $easyHandle cleanup + + puts "\n\nAll done\n\n" + + exit +} + +proc StartTransfer {} { + set multiHandle [curl::multiinit] + set easyHandle [curl::init] + + $easyHandle configure -url http://127.0.0.1/~andres/HomePage.tar.gz -file home.tar.gz + + $multiHandle addhandle $easyHandle + + $multiHandle auto -command "CleanUp $multiHandle $easyHandle" +} + +set start [button .start -text Start -command StartTransfer] +set stop [button .stop -text Stop -command StopTransfer] + +pack $start $stop -side left -padx 10 -pady 10 diff --git a/tests/multi/cancelTrans.tcl b/tests/multi/cancelTrans.tcl new file mode 100755 index 0000000..6dad215 --- /dev/null +++ b/tests/multi/cancelTrans.tcl @@ -0,0 +1,80 @@ +#!/usr/local/bin/wish8.4 + +package require TclCurl + +proc ProgressCallback {dltotal dlnow ultotal ulnow} { + + set dltotal [expr round($dltotal)] + set dlnow [expr round($dlnow)] + set ultotal [expr round($ultotal)] + set ulnow [expr round($ulnow)] + + puts "Progress callback: $dltotal - $dlnow - $ultotal - $ulnow" + + return +} + +proc Perform {multiHandle} { + if {[catch {$multiHandle active} activeTransfers]} { + puts "Error checking active transfers: $activeTransfers" + return -1 + } + + if {[catch {$multiHandle perform} running]} { + puts "Error: $running" + return -1 + } + return $running +} + +proc Transfer {multiHandle easyHandle} { + global eventId + set runningTransfers [Perform $multiHandle] + if {$runningTransfers>0} { + set eventId [after 200 "Transfer $multiHandle $easyHandle"] + } else { + puts "Were are done, cleaning up..." + $multiHandle removehandle $easyHandle + $easyHandle cleanup + $multiHandle cleanup + puts "All done" + } + return +} + +proc StartTransfer {} { + + set curlEasyHandle [curl::init] + + $curlEasyHandle configure -url "127.0.0.1/~andres/cosa&co.tar" \ + -canceltransvarname cancel -progressproc ProgressCallback\ + -file cosa.tar -noprogress 0 + + set curlMultiHandle [curl::multiinit] + $curlMultiHandle addhandle $curlEasyHandle + + after 100 "Transfer $curlMultiHandle $curlEasyHandle" + + return +} + +proc StopTransfer {} { + global cancel eventId + + puts "The download has been cancelled" + + set cancel 1 + + return +} + +set start [button .start -text Start -command StartTransfer] +set stop [button .stop -text Stop -command StopTransfer] + +pack $start $stop -side left -padx 10 -pady 10 + + + + + + diff --git a/tests/multi/double.tcl b/tests/multi/double.tcl new file mode 100755 index 0000000..614782f --- /dev/null +++ b/tests/multi/double.tcl @@ -0,0 +1,57 @@ +package require TclCurl + + +proc Perform {multiHandle} { + if {[catch {$multiHandle active} activeTransfers]} { + puts "Error checking active transfers: $activeTransfers" + return -1 + } + if {[catch {$multiHandle perform} running]} { + puts "Error: $running" + return 1 + } + return $running +} + +proc StartTransfer {multiHandle} { + while {1==1} { + set runningTransfers [Perform $multiHandle] + if {$runningTransfers>0} { + after 500 + } else { + break + } + } +} + +puts "We create and configure the easy handles" + +set curlEasyHandle1 [curl::init] +set curlEasyHandle2 [curl::init] + +$curlEasyHandle1 configure -url http://127.0.0.1/~andres/ -file index.html +$curlEasyHandle2 configure -url http://127.0.0.1/ -file index2.html + +puts "Creating the multi handle" + +set curlMultiHandle [curl::multiinit] + +puts "Adding easy handles to the multi one" + +$curlMultiHandle addhandle $curlEasyHandle1 +$curlMultiHandle addhandle $curlEasyHandle2 + +puts "We start the transfer" + +StartTransfer $curlMultiHandle + +puts "Transfer done, cleanning up" + +$curlMultiHandle removehandle $curlEasyHandle1 +$curlMultiHandle removehandle $curlEasyHandle2 + +$curlMultiHandle cleanup +$curlEasyHandle1 cleanup +$curlEasyHandle2 cleanup + + diff --git a/tests/multi/single.tcl b/tests/multi/single.tcl new file mode 100755 index 0000000..c07564f --- /dev/null +++ b/tests/multi/single.tcl @@ -0,0 +1,52 @@ +package require TclCurl + +proc Perform {multiHandle} { + if {[catch {$multiHandle active} activeTransfers]} { + puts "Error checking active transfers: $activeTransfers" + return -1 + } + + if {[catch {$multiHandle perform} running]} { + puts "Error: $running" + return 1 + } + return $running +} + +proc StartTransfer {multiHandle} { + while {1==1} { + set runningTransfers [Perform $multiHandle] + if {$runningTransfers>0} { + after 500 + } else { + break + } + } +} + +set curlEasyHandle [curl::init] + +$curlEasyHandle configure -url http://127.0.0.1/ -file index.html + +if {[catch {curl::multiinit} curlMultiHandle]} { + puts "Error with multi handle init" +} + +puts "The multi handle: $curlMultiHandle" + +puts -nonewline "We add the easy handle: " +puts [$curlMultiHandle addhandle $curlEasyHandle] + +StartTransfer $curlMultiHandle + +puts "Calling getinfo [$curlMultiHandle getinfo]" + +puts -nonewline "Removing the easy handle: " +puts [$curlMultiHandle removehandle $curlEasyHandle] + +puts -nonewline "Cleanup the multi handle handle: " +puts [$curlMultiHandle cleanup] + +$curlEasyHandle cleanup + + diff --git a/tests/netrcfile.tcl b/tests/netrcfile.tcl new file mode 100755 index 0000000..1f1529c --- /dev/null +++ b/tests/netrcfile.tcl @@ -0,0 +1,10 @@ +package require TclCurl + +curl::transfer -url "ftp://Strider.Asturias.es" -verbose 1 \ + -netrc required -netrcfile "/home/andres/testnetrc" + + + + + + diff --git a/tests/noProgress.tcl b/tests/noProgress.tcl new file mode 100755 index 0000000..f89d687 --- /dev/null +++ b/tests/noProgress.tcl @@ -0,0 +1,12 @@ +package require TclCurl + +# The default is not to show the progress meter. + +curl::transfer -url 127.0.0.1 -noprogress 1 + + + + + + + diff --git a/tests/nobody.tcl b/tests/nobody.tcl new file mode 100755 index 0000000..108d50c --- /dev/null +++ b/tests/nobody.tcl @@ -0,0 +1,8 @@ +package require TclCurl + +curl::transfer -url 127.0.0.1 -header 1 -nobody 1 + + + + + diff --git a/tests/ntlm.tcl b/tests/ntlm.tcl new file mode 100755 index 0000000..22eee78 --- /dev/null +++ b/tests/ntlm.tcl @@ -0,0 +1,16 @@ +# Contributed by Jos Decoster + +set curlHandle [curl::init] + +$curlHandle configure \ + -verbose 1 -failonerror 1 -errorbuffer ::errorBuffer \ + -url $::url -file $::file \ + -proxy $::proxy_host -proxyport $::proxy_port \ + -proxyauth ntlm \ + -proxyuserpwd $::proxy_user:$::proxy_password + +if { [catch {$curlHandle perform} r] } { + return -code error "$r $::errorBuffer" +} + +$curlHandle cleanup diff --git a/tests/progressProc.tcl b/tests/progressProc.tcl new file mode 100755 index 0000000..e81d108 --- /dev/null +++ b/tests/progressProc.tcl @@ -0,0 +1,27 @@ +package require TclCurl + +proc ProgressCallback {dltotal dlnow ultotal ulnow} { + + set dltotal [expr int($dltotal)] + set dlnow [expr int($dlnow)] + set ultotal [expr int($ultotal)] + set ulnow [expr int($ulnow)] + + puts "Progress callback: $dltotal - $dlnow - $ultotal - $ulnow" + + return +} + + +set curlHandle [curl::init] + +$curlHandle configure -url "127.0.0.1/~andres/cosa&co.tar" \ + -progressproc ProgressCallback -file cosa.tar -noprogress 0 +$curlHandle perform + +$curlHandle cleanup + + + + + diff --git a/tests/progressProcPause.tcl b/tests/progressProcPause.tcl new file mode 100755 index 0000000..327c3b0 --- /dev/null +++ b/tests/progressProcPause.tcl @@ -0,0 +1,39 @@ +package require TclCurl + +# Another one of my contrived but working examples. + +proc ProgressCallback {dltotal dlnow ultotal ulnow} { + global i curlHandle + + set dltotal [expr int($dltotal)] + set dlnow [expr int($dlnow)] + set ultotal [expr int($ultotal)] + set ulnow [expr int($ulnow)] + + puts "$i Progress callback: $dlnow of $dltotal downloaded" + + if {$i==10} { + $curlHandle pause + } elseif {$i==30} { + $curlHandle resume + } + incr i + + return +} + + +set i 0 + +set curlHandle [curl::init] + +$curlHandle configure -url "127.0.0.1/~andres/cosa&co.tar" \ + -progressproc ProgressCallback -file cosa.tar -noprogress 0 +$curlHandle perform + +$curlHandle cleanup + + + + + diff --git a/tests/proxy.tcl b/tests/proxy.tcl new file mode 100755 index 0000000..c05b3cc --- /dev/null +++ b/tests/proxy.tcl @@ -0,0 +1,11 @@ +package require TclCurl + +curl::transfer -url http://curl.haxx.se -verbose 1 -proxy "192.168.0.0" + + + + + + + + diff --git a/tests/proxyPort.tcl b/tests/proxyPort.tcl new file mode 100755 index 0000000..c777c95 --- /dev/null +++ b/tests/proxyPort.tcl @@ -0,0 +1,12 @@ +package require TclCurl + +curl::transfer -url http://curl.haxx.com -verbose 1 \ + -proxy 192.168.0.0 -proxyport 8080 + + + + + + + + diff --git a/tests/proxyTunnel.tcl b/tests/proxyTunnel.tcl new file mode 100755 index 0000000..eca8742 --- /dev/null +++ b/tests/proxyTunnel.tcl @@ -0,0 +1,11 @@ +package require TclCurl + +curl::transfer -url http://curl.haxx.se -verbose 1 \ + -proxy "192.168.0.0:8080" -httpproxytunnel 1 + + + + + + + diff --git a/tests/range.tcl b/tests/range.tcl new file mode 100755 index 0000000..f40e239 --- /dev/null +++ b/tests/range.tcl @@ -0,0 +1,8 @@ +package require TclCurl + +curl::transfer -url 127.0.0.1 -range "100-500" + + + + + diff --git a/tests/readProc.tcl b/tests/readProc.tcl new file mode 100755 index 0000000..f517e8f --- /dev/null +++ b/tests/readProc.tcl @@ -0,0 +1,23 @@ +package require TclCurl + +# As an example this is very contrived, but it works. + +proc readFile {size} { + + set chunk [read $::inFile $size] + + return $chunk +} + +set inFile [open "cosa.tar" r] +fconfigure $inFile -translation binary + +curl::transfer -url "ftp://127.0.0.1/cosa.tar" -verbose 1 \ + -username user -password pass -readproc readFile -upload 1 + +close $inFile + + + + + diff --git a/tests/referer.tcl b/tests/referer.tcl new file mode 100755 index 0000000..a87ca05 --- /dev/null +++ b/tests/referer.tcl @@ -0,0 +1,9 @@ +package require TclCurl + +curl::transfer -url 127.0.0.1 -referer "127.0.0.1/cosa.html" \ + -verbose 1 -nobody 1 + + + + + diff --git a/tests/reset.tcl b/tests/reset.tcl new file mode 100755 index 0000000..101c201 --- /dev/null +++ b/tests/reset.tcl @@ -0,0 +1,21 @@ +package require TclCurl + +set curlHandle [curl::init] + +puts "First we save in 'index.html'" + +$curlHandle configure -noprogress 1 -url "127.0.0.1" -file "index.html" +$curlHandle perform + +puts "And now in stdout" + +$curlHandle reset +$curlHandle configure -url "http://127.0.0.1/" +$curlHandle perform + +$curlHandle cleanup + + + + + diff --git a/tests/resume.tcl b/tests/resume.tcl new file mode 100755 index 0000000..50db6b4 --- /dev/null +++ b/tests/resume.tcl @@ -0,0 +1,8 @@ +package require TclCurl + +curl::transfer -url 127.0.0.1 -resumefrom 500 + + + + + diff --git a/tests/share.tcl b/tests/share.tcl new file mode 100755 index 0000000..d46b32f --- /dev/null +++ b/tests/share.tcl @@ -0,0 +1,23 @@ +# The share interface support is not yet completely done, since +# you can't use it with the multi interface. + +package require TclCurl + +set sHandle [curl::shareinit] +$sHandle share dns + +set easyHandle1 [curl::init] +set easyHandle2 [curl::init] + +$easyHandle1 configure -url http://127.0.0.1/ -share $sHandle +$easyHandle2 configure -url http://127.0.0.1/~andres/ -share $sHandle + +$easyHandle1 perform +$easyHandle2 perform + +$easyHandle1 cleanup +$easyHandle2 cleanup + +$sHandle unshare dns +$sHandle cleanup + diff --git a/tests/stderrNoStderr.tcl b/tests/stderrNoStderr.tcl new file mode 100755 index 0000000..1a3cee7 --- /dev/null +++ b/tests/stderrNoStderr.tcl @@ -0,0 +1,22 @@ +package require TclCurl + +set curlHandle [curl::init] + +puts "First it goes into error.txt" +$curlHandle configure -url 127.0.0.1/~andres/cosa&co.tar -stderr error.txt \ + -noprogress 0 -file cosa.tar + +catch {$curlHandle perform} + + +puts "And then to stderr:" +$curlHandle configure -stderr "" + +catch {$curlHandle perform} + +$curlHandle cleanup + + + + + diff --git a/tests/strerror.tcl b/tests/strerror.tcl new file mode 100755 index 0000000..2cfb41d --- /dev/null +++ b/tests/strerror.tcl @@ -0,0 +1,14 @@ +package require TclCurl + +puts "The error string for code 6 is '[curl::easystrerror 6]'" + +puts "If the number is too big: '[curl::easystrerror 2000]'" + +puts "It works the same way for the multi interface: '[curl::multistrerror 1]'" +puts "And the share interface: '[curl::sharestrerror 1]'" + +catch {curl::easystrerror frelled} errorMsg +puts "And if we use a nonsensical code: '$errorMsg'" + +catch {curl::sharestrerror} errorMsg +puts "And if we forget the error code:\n '$errorMsg'" diff --git a/tests/timeout.tcl b/tests/timeout.tcl new file mode 100755 index 0000000..10f55f2 --- /dev/null +++ b/tests/timeout.tcl @@ -0,0 +1,8 @@ +package require TclCurl + +curl::transfer -timeout 0 -url 127.0.0.1 + + + + + diff --git a/tests/transfer.tcl b/tests/transfer.tcl new file mode 100755 index 0000000..3a63b69 --- /dev/null +++ b/tests/transfer.tcl @@ -0,0 +1,47 @@ +package require TclCurl + +curl::transfer -url "127.0.0.1" -filetime 1 \ + -infoeffectiveurl effectiveUrl -inforesponsecode httpCode \ + -infofiletime fileTime -infototaltime totalTime \ + -infonamelookuptime nameLookUpTime \ + -infoconnecttime connectTime -infopretransfertime preTime \ + -infostarttransfertime startTransferTime \ + -infosizeupload sizeUpload -infosizedownload sizeDownload \ + -infospeeddownload speedDownload -infospeedupload speedUpload \ + -infoheadersize headerSize -inforequestsize requestSize \ + -infosslverifyresult sslVerifyResult \ + -infocontentlengthupload contentLengthUpload \ + -infocontentlengthdownload contentLengthDownload \ + -infocontenttype contentType \ + -inforedirecttime redirectTime \ + -inforedirectcount redirectCount + + +puts "Url: $effectiveUrl" +puts "Response code: $httpCode" +puts "Filetime: $fileTime - [clock format $fileTime]" +puts "Total time: $totalTime" +puts "Name lookup time: $nameLookUpTime" +puts "Name connect time: $connectTime" +puts "Name pretransfer time: $preTime" +puts "Name start transfer time: $startTransferTime" +puts "Name size upload: $sizeUpload" +puts "Name size download: $sizeDownload" +puts "Name speed download: $speedDownload" +puts "Name speed upload: $speedUpload" +puts "Name header size: $headerSize" +puts "Name request size: $requestSize" +puts "Name ssl verifyresult: $sslVerifyResult" +puts "Name length download: $contentLengthDownload" +puts "Name length upload: $contentLengthUpload" +puts "Content-Type: $contentType" +puts "Redirect time: $redirectTime" +puts "Redirect count: $redirectCount" + + + + + + + + diff --git a/tests/upload.tcl b/tests/upload.tcl new file mode 100755 index 0000000..eebc2f0 --- /dev/null +++ b/tests/upload.tcl @@ -0,0 +1,8 @@ +package require TclCurl + + +curl::transfer -url ftp://andres:ciclope4@127.0.01/cosa.tcl \ + -infilesize [file size writeProc.tcl] -infile writeProc.tcl -upload 1 \ + -verbose 1 + + diff --git a/tests/userAgent.tcl b/tests/userAgent.tcl new file mode 100755 index 0000000..43f0a29 --- /dev/null +++ b/tests/userAgent.tcl @@ -0,0 +1,11 @@ +package require TclCurl + +curl::transfer -url "127.0.0.1" -verbose 1 -nobody 1 \ + -useragent "Mozilla 4.0 (compatible; Getleft 0.10.4)" + + + + + + + diff --git a/tests/verbose.tcl b/tests/verbose.tcl new file mode 100755 index 0000000..ab81457 --- /dev/null +++ b/tests/verbose.tcl @@ -0,0 +1,23 @@ +package require TclCurl + +set curlHandle [curl::init] + +$curlHandle configure -url 127.0.0.1 -verbose 1 -nobody 1 + + +puts "First one is verbose" +$curlHandle perform + +puts "The second isn't" +$curlHandle configure -verbose 0 +$curlHandle perform + + +$curlHandle cleanup + + + + + + + diff --git a/tests/version.tcl b/tests/version.tcl new file mode 100755 index 0000000..91f0826 --- /dev/null +++ b/tests/version.tcl @@ -0,0 +1,9 @@ +package require TclCurl + +puts "[curl::version]" + + + + + + diff --git a/tests/versionInfo.tcl b/tests/versionInfo.tcl new file mode 100755 index 0000000..547392b --- /dev/null +++ b/tests/versionInfo.tcl @@ -0,0 +1,13 @@ +package require TclCurl + + +puts "Version [curl::versioninfo -version]" +puts "Version (num): [curl::versioninfo -versionnum]" +puts "Host: [curl::versioninfo -host]" +puts "Features: [curl::versioninfo -features]" +puts "SSL version: [curl::versioninfo -sslversion]" +puts "SSL version (num): [curl::versioninfo -sslversionnum]" +puts "libz version: [curl::versioninfo -libzversion]" +puts "Protocols [curl::versioninfo -protocols]" + + diff --git a/tests/writeHeader.tcl b/tests/writeHeader.tcl new file mode 100755 index 0000000..8de4dcc --- /dev/null +++ b/tests/writeHeader.tcl @@ -0,0 +1,9 @@ +package require TclCurl + +curl::transfer -url 127.0.0.1 -header 1 -nobody 1 \ + -writeheader header.txt + + + + + diff --git a/tests/writeProc.tcl b/tests/writeProc.tcl new file mode 100755 index 0000000..da6fb82 --- /dev/null +++ b/tests/writeProc.tcl @@ -0,0 +1,23 @@ +package require TclCurl + +# This is one contrived example, but it works. + +proc writeToFile {readData} { + puts "writeToFile called [incr ::i]" + puts -nonewline $::inFile $readData + + return +} + +set i 0 + +set inFile [open "cosa.tar" w+] +fconfigure $inFile -translation binary + +curl::transfer -url "127.0.0.1/~andres/cosa&co.tar" -writeproc writeToFile + +close $inFile + + + +