dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
+#serial 12
+
+dnl By default, many hosts won't let programs access large files;
+dnl one must use special compiler options to get large-file access to work.
+dnl For more details about this brain damage please see:
+dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
+
+dnl Written by Paul Eggert <eggert@twinsun.com>.
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_TEST_INCLUDES
+AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES,
+ [[#include <sys/types.h>
+ int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
+ ]])
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLUDES, FUNCTION-BODY)
+AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
+ [AC_CACHE_CHECK([for $1 value needed for large files], $3,
+ [$3=no
+ AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES
+$5
+ ,
+ [$6],
+ ,
+ [AC_TRY_COMPILE([#define $1 $2]
+AC_SYS_LARGEFILE_TEST_INCLUDES
+$5
+ ,
+ [$6],
+ [$3=$2])])])
+ if test "[$]$3" != no; then
+ AC_DEFINE_UNQUOTED([$1], [$]$3, [$4])
+ fi])
+
+AC_DEFUN(AC_SYS_LARGEFILE,
+ [AC_ARG_ENABLE(largefile,
+ [ --disable-largefile omit support for large files])
+ if test "$enable_largefile" != no; then
+
+ AC_CACHE_CHECK([for special C compiler options needed for large files],
+ ac_cv_sys_largefile_CC,
+ [ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , ,
+ [ac_save_CC="$CC"
+ CC="$CC -n32"
+ AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, ,
+ ac_cv_sys_largefile_CC=' -n32')
+ CC="$ac_save_CC"])
+ fi])
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC="$CC$ac_cv_sys_largefile_CC"
+ fi
+
+ AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
+ ac_cv_sys_file_offset_bits,
+ [Number of bits in a file offset, on hosts where this is settable.])
+ AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
+ ac_cv_sys_largefile_source,
+ [Define to make ftello visible on some hosts (e.g. HP-UX 10.20).],
+ [#include <stdio.h>], [return !ftello;])
+ AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
+ ac_cv_sys_large_files,
+ [Define for large files, on AIX-style hosts.])
+dnl lftp does not need ftello, and _XOPEN_SOURCE=500 makes resolv.h fail.
+dnl AC_SYS_LARGEFILE_MACRO_VALUE(_XOPEN_SOURCE, 500,
+dnl ac_cv_sys_xopen_source,
+dnl [Define to make ftello visible on some hosts (e.g. glibc 2.1.3).],
+dnl [#include <stdio.h>], [return !ftello;])
+ fi
+ ])
+
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
" -d/--data <data>\n"
" (HTTP) Sends the specified data in a POST request to\n"
" the HTTP server. Note that the data is sent exactly as\n"
-" specified with no extra processing. The data is\n"
-" expected to be \"url-encoded\". This will cause curl to\n"
-" pass the data to the server using the content-type\n"
-" application/x-www-form-urlencoded. Compare to -F.\n"
-"\n"
-" If you start the data with the letter @, the rest\n"
-" should be a file name to read the data from, or - if\n"
-" you want curl to read the data from stdin. The con\n"
+" specified with no extra processing (with all newlines\n"
+" cut off). The data is expected to be \"url-encoded\".\n"
+" This will cause curl to pass the data to the server\n"
+" using the content-type application/x-www-form-urlen\n"
+" coded. Compare to -F.\n"
+"\n"
+" If you start the data with the letter @, the rest\n"
+" should be a file name to read the data from, or - if\n"
+" you want curl to read the data from stdin. The con\n"
" tents of the file must already be url-encoded.\n"
"\n"
+" To post data purely binary, you should instead use the\n"
+" --data-binary option.\n"
+"\n"
+" -d/--data is the same as --data-ascii.\n"
+"\n"
+" --data-ascii <data>\n"
+" (HTTP) This is an alias for the -d/--data option.\n"
+"\n"
+" --data-binary <data>\n"
+" (HTTP) This posts data in a similar manner as --data-\n"
+" ascii does, although when using this option the entire\n"
+" context of the posted data is kept as-is. If you want\n"
+" to post a binary file without the strip-newlines fea\n"
+" ture of the --data-ascii option, this is for you.\n"
+"\n"
" -D/--dump-header <file>\n"
" (HTTP/FTP) Write the HTTP headers to this file. Write\n"
" the FTP file info to this file if -I/--head is used.\n"
" (HTTP) Include the HTTP-header in the output. The HTTP-\n"
" header includes things like server-name, date of the\n"
" document, HTTP-version and more...\n"
-"\n"
" -I/--head\n"
" (HTTP/FTP) Fetch the HTTP-header only! HTTP-servers\n"
" feature the command HEAD which this uses to get nothing\n"
" arguments can be written which then will be used as if\n"
" they were written on the actual command line. If the\n"
" first column of a config line is a '#' character, the\n"
+);
+ puts(
" rest of the line will be treated as a comment.\n"
"\n"
" Specify the filename as '-' to make curl read the file\n"
" from stdin.\n"
+"\n"
" -l/--list-only\n"
" (FTP) When listing an FTP directory, this switch forces\n"
" a name-only view. Especially useful if you want to\n"
" (HTTP/HTTPS) If the server reports that the requested\n"
" page has a different location (indicated with the\n"
" header line Location:) this flag will let curl attempt\n"
-);
- puts(
" to reattempt the get on the new place. If used together\n"
" with -i or -I, headers from all requested pages will be\n"
" shown. If this flag is used when making a HTTP POST,\n"
"\n"
" - (any single-letter string) to make it pick\n"
" the machine's default\n"
-"\n"
" -q If used as the first parameter on the command line, the\n"
" $HOME/.curlrc file will not be read and used as a con\n"
" fig file.\n"
" to be run before and after the transfer. If the server\n"
" returns failure for one of the commands, the entire\n"
" operation will be aborted.\n"
+"\n"
" -r/--range <range>\n"
" (HTTP/FTP) Retrieve a byte range (i.e a partial docu\n"
" ment) from a HTTP/1.1 or FTP server. Ranges can be\n"
" -s/--silent\n"
" Silent mode. Don't show progress meter or error mes\n"
" sages. Makes Curl mute.\n"
-"\n"
" -S/--show-error\n"
" When used with -s it makes curl show error message if\n"
" it fails.\n"
" particular file you specify it \"@filename\" and to tell\n"
" curl to read the format from stdin you write \"@-\".\n"
"\n"
-" The variables present in the output format will be sub\n"
-" stituted by the value or text that curl thinks fit, as\n"
-" described below. All variables are specified like\n"
+" The variables present in the output format will be\n"
+" substituted by the value or text that curl thinks fit,\n"
+" as described below. All variables are specified like\n"
" %{variable_name} and to output a normal % you just\n"
" write them like %%. You can output a newline by using\n"
" \\n, a carrige return with \\r and a tab space with \\t.\n"
" url_effective The URL that was fetched last. This is\n"
" mostly meaningful if you've told curl to\n"
" follow location: headers.\n"
+"\n"
" http_code The numerical code that was found in the\n"
" last retrieved HTTP(S) page.\n"
"\n"
" transfer commands and negotiations that\n"
" are specific to the particular proto\n"
" col(s) involved.\n"
+);
+ puts(
"\n"
" size_download The total amount of bytes that were\n"
" downloaded.\n"
"\n"
" speed_upload The average upload speed that curl mea\n"
" sured for the complete download.\n"
-"\n"
" -x/--proxy <proxyhost[:port]>\n"
" Use specified proxy. If the port number is not speci\n"
" fied, it is assumed at port 1080.\n"
"\n"
" -X/--request <command>\n"
" (HTTP) Specifies a custom request to use when communi\n"
-);
- puts(
" cating with the HTTP server. The specified request\n"
" will be used instead of the standard GET. Read the HTTP\n"
" 1.1 specification for details and explanations.\n"
"ENVIRONMENT\n"
" HTTP_PROXY [protocol://]<host>[:port]\n"
" Sets proxy server to use for HTTP.\n"
+"\n"
" HTTPS_PROXY [protocol://]<host>[:port]\n"
" Sets proxy server to use for HTTPS.\n"
"\n"
"\n"
" 4 URL user malformatted. The user-part of the URL syntax\n"
" was not correct.\n"
-"\n"
" 5 Couldn't resolve proxy. The given proxy host could not\n"
" be resolved.\n"
"\n"
"\n"
" 10 FTP user/password incorrect. Either one or both were\n"
" not accepted by the server.\n"
+"\n"
" 11 FTP weird PASS reply. Curl couldn't parse the reply\n"
" sent to the PASS request.\n"
"\n"
"\n"
" 23 Write error. Curl couldn't write data to a local\n"
" filesystem or similar.\n"
-"\n"
" 24 Malformat user. User name badly specified.\n"
"\n"
" 25 FTP couldn't STOR file. The server denied the STOR\n"
"\n"
" 29 FTP couldn't set ASCII. The server returned an unknown\n"
" reply.\n"
+"\n"
" 30 FTP PORT failed. The PORT command failed.\n"
"\n"
" 31 FTP couldn't use REST. The REST command failed.\n"
"BUGS\n"
" If you do find any (or have other suggestions), mail Daniel\n"
" Stenberg <Daniel.Stenberg@haxx.se>.\n"
-"\n"
"AUTHORS / CONTRIBUTORS\n"
" - Daniel Stenberg <Daniel.Stenberg@haxx.se>\n"
" - Rafael Sagula <sagula@inf.ufrgs.br>\n"
" - Kristian Köhntopp <kris@koehntopp.de>\n"
" - Fred Noz <FNoz@siac.com>\n"
" - Caolan McNamara <caolan@csn.ul.ie>\n"
-"\n"
+" - Albert Chin-A-Young <china@thewrittenword.com>\n"
"WWW\n"
" http://curl.haxx.se\n"
"\n"
" Get a gopher document from funet's gopher server:\n"
"\n"
" curl gopher://gopher.funet.fi\n"
+);
+ puts(
"\n"
" Get a web page from a server using port 8000:\n"
"\n"
" To ftp files using name+passwd, include them in the URL like:\n"
"\n"
" curl ftp://name:passwd@machine.domain:port/full/path/to/file\n"
-);
- puts(
"\n"
" or specify them with the -u flag like\n"
"\n"
" headers that looks like 'Set-Cookie: <data>' where the data part then\n"
" typically contains a set of NAME=VALUE pairs (separated by semicolons ';'\n"
" like \"NAME1=VALUE1; NAME2=VALUE2;\"). The server can also specify for what\n"
+);
+ puts(
" path the \"cookie\" should be used for (by specifying \"path=value\"), when the\n"
" cookie should expire (\"expire=DATE\"), for what domain to use it\n"
" (\"domain=NAME\") and if it should be used on secure connections only\n"
" Curl also has the ability to use previously received cookies in following\n"
" sessions. If you get cookies from a server and store them in a file in a\n"
" manner similar to:\n"
-);
- puts(
"\n"
" curl --dump-header headers www.example.com\n"
"\n"
"TIME CONDITIONS\n"
"\n"
" HTTP allows a client to specify a time condition for the document it\n"
+);
+ puts(
" requests. It is If-Modified-Since or If-Unmodified-Since. Curl allow you to\n"
" specify them with the -z/--time-cond flag.\n"
"\n"
" curl -z yesterday http://remote.server.com/remote.html\n"
"\n"
" Curl will then accept a wide range of date formats. You always make the date\n"
-);
- puts(
" check the other way around by prepending it with a dash '-'.\n"
"\n"
"DICT\n"