1 .PHONY: all install clean
\r
4 if $(CheckProg ocamlc)
\r
7 if $(CheckProg ocamlc.opt)
\r
10 if $(CheckProg ocamlopt)
\r
11 NATIVE_ENABLED = true
\r
13 if $(CheckProg ocamlopt.opt)
\r
14 NATIVE_ENABLED = true
\r
17 CFLAGS += -DHAVE_CONFIG_H $(shell curl-config --cflags)
\r
19 OCamlLibrary(curl, curl)
\r
20 StaticCLibrary(libcurl-helper, curl-helper)
\r
22 .DEFAULT: curl.cma curl.cmxa libcurl-helper.a examples
\r
26 public.CheckCHeaderDeclSrc(decl, headers) =
\r
28 #pragma warning( disable : 4100 )
\r
29 $(add-wrapper $'#include <', >$(nl),$(headers))
\r
30 int main(int argc, char **argv) {
\r
38 public.CheckCHeaderDecl(decl, headers) =
\r
39 return $(TryLinkC $(CheckCHeaderDeclSrc $(decl), $(headers)))
\r
42 ## Simplistic function that works for the current names tested
\r
45 public.HaveDeclName(decl) =
\r
46 return $"""HAVE_DECL_$(uppercase $(decl))"""
\r
48 public.HaveDecls(decls, headers) =
\r
49 f = $(fopen config.h, w)
\r
50 fprintln($(f), $"#ifndef OCURL_CONFIG_H")
\r
51 fprintln($(f), $"#define OCURL_CONFIG_H")
\r
52 foreach(decl, $(decls))
\r
53 ConfMsgChecking($(decl))
\r
54 if $(CheckCHeaderDecl $(decl), $(headers))
\r
55 fprintln($(f), "#define $(HaveDeclName $(decl)) 1")
\r
58 fprintln($(f), "#undef $(HaveDeclName $(decl))")
\r
60 fprintln($(f), $"#endif /* OCURL_CONFIG_H */")
\r
65 CURLOPT_FILE CURLOPT_URL CURLOPT_PORT CURLOPT_PROXY CURLOPT_USERPWD \
\r
66 CURLOPT_PROXYUSERPWD CURLOPT_RANGE CURLOPT_INFILE CURLOPT_ERRORBUFFER \
\r
67 CURLOPT_WRITEFUNCTION CURLOPT_READFUNCTION CURLOPT_TIMEOUT \
\r
68 CURLOPT_INFILESIZE CURLOPT_POSTFIELDS CURLOPT_REFERER CURLOPT_FTPPORT \
\r
69 CURLOPT_USERAGENT CURLOPT_LOW_SPEED_LIMIT CURLOPT_LOW_SPEED_TIME \
\r
70 CURLOPT_RESUME_FROM CURLOPT_COOKIE CURLOPT_HTTPHEADER \
\r
71 CURLOPT_HTTPPOST CURLOPT_SSLCERT CURLOPT_SSLCERTPASSWD CURLOPT_SSLKEYPASSWD \
\r
72 CURLOPT_CRLF CURLOPT_QUOTE CURLOPT_WRITEHEADER CURLOPT_COOKIEFILE \
\r
73 CURLOPT_SSLVERSION CURLOPT_TIMECONDITION CURLOPT_TIMEVALUE \
\r
74 CURLOPT_CUSTOMREQUEST CURLOPT_STDERR CURLOPT_POSTQUOTE CURLOPT_WRITEINFO \
\r
75 CURLOPT_VERBOSE CURLOPT_HEADER CURLOPT_NOPROGRESS CURLOPT_NOBODY \
\r
76 CURLOPT_FAILONERROR CURLOPT_UPLOAD CURLOPT_POST CURLOPT_FTPLISTONLY \
\r
77 CURLOPT_FTPAPPEND CURLOPT_NETRC CURLOPT_FOLLOWLOCATION \
\r
78 CURLOPT_TRANSFERTEXT CURLOPT_PUT CURLOPT_PROGRESSFUNCTION \
\r
79 CURLOPT_PROGRESSDATA CURLOPT_AUTOREFERER CURLOPT_PROXYPORT \
\r
80 CURLOPT_POSTFIELDSIZE CURLOPT_HTTPPROXYTUNNEL CURLOPT_INTERFACE \
\r
81 CURLOPT_KRB4LEVEL CURLOPT_SSL_VERIFYPEER CURLOPT_CAINFO \
\r
82 CURLOPT_MAXREDIRS CURLOPT_FILETIME CURLOPT_TELNETOPTIONS \
\r
83 CURLOPT_MAXCONNECTS CURLOPT_CLOSEPOLICY CURLOPT_FRESH_CONNECT \
\r
84 CURLOPT_FORBID_REUSE CURLOPT_RANDOM_FILE CURLOPT_EGDSOCKET \
\r
85 CURLOPT_CONNECTTIMEOUT CURLOPT_HEADERFUNCTION CURLOPT_HTTPGET \
\r
86 CURLOPT_SSL_VERIFYHOST CURLOPT_COOKIEJAR CURLOPT_SSL_CIPHER_LIST \
\r
87 CURLOPT_HTTP_VERSION CURLOPT_FTP_USE_EPSV CURLOPT_SSLCERTTYPE \
\r
88 CURLOPT_SSLKEY CURLOPT_SSLKEYTYPE CURLOPT_SSLENGINE \
\r
89 CURLOPT_SSLENGINE_DEFAULT CURLOPT_DNS_USE_GLOBAL_CACHE \
\r
90 CURLOPT_DNS_CACHE_TIMEOUT CURLOPT_PREQUOTE CURLOPT_DEBUGFUNCTION \
\r
91 CURLOPT_DEBUGDATA CURLOPT_COOKIESESSION CURLOPT_CAPATH \
\r
92 CURLOPT_BUFFERSIZE CURLOPT_NOSIGNAL CURLOPT_SHARE \
\r
93 CURLOPT_PROXYTYPE CURLOPT_ENCODING CURLOPT_PRIVATE CURLOPT_HTTP200ALIASES \
\r
94 CURLOPT_UNRESTRICTED_AUTH CURLOPT_FTP_USE_EPRT CURLOPT_HTTPAUTH \
\r
95 CURLOPT_FTP_CREATE_MISSING_DIRS CURLOPT_PROXYAUTH \
\r
96 CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_IPRESOLVE CURLOPT_MAXFILESIZE \
\r
97 CURLOPT_INFILESIZE_LARGE CURLOPT_RESUME_FROM_LARGE \
\r
98 CURLOPT_MAXFILESIZE_LARGE CURLOPT_NETRC_FILE CURLOPT_FTP_SSL \
\r
99 CURLOPT_POSTFIELDSIZE_LARGE CURLOPT_TCP_NODELAY CURLOPT_FTPSSLAUTH \
\r
100 CURLOPT_IOCTLFUNCTION CURLOPT_FTP_ACCOUNT CURLOPT_COOKIELIST \
\r
101 CURLOPT_IGNORE_CONTENT_LENGTH CURLOPT_FTP_SKIP_PASV_IP \
\r
102 CURLOPT_FTP_FILEMETHOD CURLOPT_LOCALPORT CURLOPT_LOCALPORTRANGE \
\r
103 CURLOPT_CONNECT_ONLY CURLOPT_MAX_SEND_SPEED_LARGE \
\r
104 CURLOPT_MAX_RECV_SPEED_LARGE CURLOPT_FTP_ALTERNATIVE_TO_USER \
\r
105 CURLOPT_SSL_SESSIONID_CACHE CURLOPT_SSH_AUTH_TYPES \
\r
106 CURLOPT_SSH_PUBLIC_KEYFILE CURLOPT_SSH_PRIVATE_KEYFILE \
\r
107 CURLOPT_FTP_SSL_CCC CURLOPT_TIMEOUT_MS CURLOPT_CONNECTTIMEOUT_MS \
\r
108 CURLOPT_HTTP_TRANSFER_DECODING CURLOPT_HTTP_CONTENT_DECODING \
\r
109 CURLOPT_NEW_FILE_PERMS CURLOPT_NEW_DIRECTORY_PERMS CURLOPT_POST301 \
\r
110 CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 CURLOPT_COPYPOSTFIELDS \
\r
111 CURLOPT_PROXY_TRANSFER_MODE CURLOPT_SEEKFUNCTION \
\r
113 CURLINFO_EFFECTIVE_URL CURLINFO_RESPONSE_CODE CURLINFO_TOTAL_TIME \
\r
114 CURLINFO_NAMELOOKUP_TIME CURLINFO_CONNECT_TIME CURLINFO_PRETRANSFER_TIME \
\r
115 CURLINFO_SIZE_UPLOAD CURLINFO_SIZE_DOWNLOAD CURLINFO_SPEED_DOWNLOAD \
\r
116 CURLINFO_SPEED_UPLOAD CURLINFO_HEADER_SIZE CURLINFO_REQUEST_SIZE \
\r
117 CURLINFO_SSL_VERIFYRESULT CURLINFO_FILETIME CURLINFO_CONTENT_LENGTH_DOWNLOAD \
\r
118 CURLINFO_CONTENT_LENGTH_UPLOAD CURLINFO_STARTTRANSFER_TIME \
\r
119 CURLINFO_CONTENT_TYPE CURLINFO_REDIRECT_TIME CURLINFO_REDIRECT_COUNT \
\r
120 CURLINFO_PRIVATE CURLINFO_HTTP_CONNECTCODE CURLINFO_HTTPAUTH_AVAIL \
\r
121 CURLINFO_PROXYAUTH_AVAIL CURLINFO_OS_ERRNO CURLINFO_NUM_CONNECTS \
\r
122 CURLINFO_SSL_ENGINES CURLINFO_COOKIELIST CURLINFO_LASTSOCKET \
\r
123 CURLINFO_FTP_ENTRY_PATH \
\r
125 CURLE_UNSUPPORTED_PROTOCOL CURLE_FAILED_INIT CURLE_URL_MALFORMAT \
\r
126 CURLE_URL_MALFORMAT_USER CURLE_COULDNT_RESOLVE_PROXY \
\r
127 CURLE_COULDNT_RESOLVE_HOST CURLE_COULDNT_CONNECT \
\r
128 CURLE_FTP_WEIRD_SERVER_REPLY CURLE_FTP_ACCESS_DENIED \
\r
129 CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_FTP_WEIRD_PASS_REPLY \
\r
130 CURLE_FTP_WEIRD_USER_REPLY CURLE_FTP_WEIRD_PASV_REPLY \
\r
131 CURLE_FTP_WEIRD_227_FORMAT CURLE_FTP_CANT_GET_HOST CURLE_FTP_CANT_RECONNECT \
\r
132 CURLE_FTP_COULDNT_SET_BINARY CURLE_PARTIAL_FILE CURLE_FTP_COULDNT_RETR_FILE \
\r
133 CURLE_FTP_WRITE_ERROR CURLE_FTP_QUOTE_ERROR CURLE_HTTP_RETURNED_ERROR \
\r
134 CURLE_WRITE_ERROR CURLE_MALFORMAT_USER CURLE_FTP_COULDNT_STOR_FILE \
\r
135 CURLE_READ_ERROR CURLE_OUT_OF_MEMORY CURLE_OPERATION_TIMEOUTED \
\r
136 CURLE_FTP_COULDNT_SET_ASCII CURLE_FTP_PORT_FAILED CURLE_FTP_COULDNT_USE_REST \
\r
137 CURLE_FTP_COULDNT_GET_SIZE CURLE_HTTP_RANGE_ERROR CURLE_HTTP_POST_ERROR \
\r
138 CURLE_SSL_CONNECT_ERROR CURLE_BAD_DOWNLOAD_RESUME \
\r
139 CURLE_FILE_COULDNT_READ_FILE CURLE_LDAP_CANNOT_BIND CURLE_LDAP_SEARCH_FAILED \
\r
140 CURLE_LIBRARY_NOT_FOUND CURLE_FUNCTION_NOT_FOUND CURLE_ABORTED_BY_CALLBACK \
\r
141 CURLE_BAD_FUNCTION_ARGUMENT CURLE_BAD_CALLING_ORDER CURLE_INTERFACE_FAILED \
\r
142 CURLE_BAD_PASSWORD_ENTERED CURLE_TOO_MANY_REDIRECTS \
\r
143 CURLE_UNKNOWN_TELNET_OPTION CURLE_TELNET_OPTION_SYNTAX \
\r
144 CURLE_SSL_PEER_CERTIFICATE CURLE_GOT_NOTHING CURLE_SSL_ENGINE_NOTFOUND \
\r
145 CURLE_SSL_ENGINE_SETFAILED CURLE_SEND_ERROR CURLE_RECV_ERROR \
\r
146 CURLE_SHARE_IN_USE CURLE_SSL_CERTPROBLEM CURLE_SSL_CIPHER CURLE_SSL_CACERT \
\r
147 CURLE_BAD_CONTENT_ENCODING CURLE_LDAP_INVALID_URL CURLE_FILESIZE_EXCEEDED \
\r
148 CURLE_FTP_SSL_FAILED CURLE_SEND_FAIL_REWIND CURLE_SSL_ENGINE_INITFAILED \
\r
149 CURLE_LOGIN_DENIED CURLE_TFTP_NOTFOUND CURLE_TFTP_PERM \
\r
150 CURLE_REMOTE_DISK_FULL CURLE_TFTP_ILLEGAL CURLE_TFTP_UNKNOWNID \
\r
151 CURLE_REMOTE_FILE_EXISTS CURLE_TFTP_NOSUCHUSER CURLE_CONV_FAILED \
\r
152 CURLE_CONV_REQD CURLE_SSL_CACERT_BADFILE CURLE_REMOTE_FILE_NOT_FOUND \
\r
153 CURLE_SSH CURLE_SSL_SHUTDOWN_FAILED CURLE_AGAIN, \
\r
157 rm -f *~ *.cm* *.o *.a core
\r