blob: c6c2d2c63acd7cbfca2b8471f10fc4309355ac79 [file] [log] [blame]
Austin Schuh86110712022-09-16 15:40:54 -07001# This is based on:
2# https://github.com/googleapis/google-cloud-cpp/blob/v1.26.1/bazel/curl.BUILD
3# which is based on:
4# https://github.com/tensorflow/tensorflow/blob/51d480498b07346b8b6e2ee3fbd3dc486f60ed96/third_party/curl.BUILD
5# Description:
6# curl is a tool for talking to web servers.
7
8licenses(["notice"]) # MIT/X derivative license
9
10exports_files(["COPYING"])
11
12config_setting(
13 name = "windows",
14 values = {"cpu": "x64_windows"},
15 visibility = ["//visibility:public"],
16)
17
18config_setting(
19 name = "linux_x86_64",
20 constraint_values = [
21 "@platforms//cpu:x86_64",
22 "@platforms//os:linux",
23 ],
24)
25
26config_setting(
27 name = "linux_arm64",
28 constraint_values = [
29 "@platforms//cpu:arm64",
30 "@platforms//os:linux",
31 ],
32)
33
34config_setting(
35 name = "linux_armv7",
36 constraint_values = [
37 "@platforms//cpu:armv7",
38 "@platforms//os:linux",
39 ],
40)
41
42config_setting(
43 name = "macos",
44 values = {"cpu": "darwin"},
45 visibility = ["//visibility:public"],
46)
47
48# On Linux, libcurl needs to know, at compile time, the location for the
49# Certificate Authority (CA) bundle file. By default we dynamically guess the
50# location for most common Linux distribution, but this guessing makes the build
51# not cacheable.
52#
53# In our CI builds we define the CA bundle location using a --define option.
54# This makes the CI results more amenable to caching, at the cost of "some"
55# complexity in this BUILD file.
56#
57# Note that builds issued by developers in the command-line should continue to
58# work, it is just that the build results are less cacheable than they make
59# wish.
60
61# First convert the --define ca_bundle_style=... option into a config_setting
62# rule:
63config_setting(
64 name = "ca_bundle_style_is_redhat",
65 define_values = {
66 "ca_bundle_style": "redhat",
67 },
68)
69
70config_setting(
71 name = "ca_bundle_style_is_debian",
72 define_values = {
73 "ca_bundle_style": "debian",
74 },
75)
76
77# This just generates a header file with the right value for the CURL_CA_BUNDLE
78# macro. The file is included by curl_config.h if the macro is *not* provided
79# in the build line using -DCURL_CA_BUNDLE=<some-path>:
80genrule(
81 name = "gen-ca-bundle-linux",
82 outs = ["include/curl_ca_bundle_location.h"],
83 cmd = """
84 if [ -f /etc/fedora-release ]; then
85 echo '#define CURL_CA_BUNDLE "/etc/pki/tls/certs/ca-bundle.crt"'
86 elif [ -f /etc/redhat-release ]; then
87 echo '#define CURL_CA_BUNDLE "/etc/pki/tls/certs/ca-bundle.crt"'
88 elif [ -f /etc/debian_version ]; then
89 echo '#define CURL_CA_BUNDLE "/etc/ssl/certs/ca-certificates.crt"'
90 elif [ -f /etc/arch-release ]; then
91 echo '#define CURL_CA_BUNDLE "/etc/ssl/certs/ca-certificates.crt"'
92 else
93 >&2 echo "Unknown platform, cannot guess location of CA bundle"
94 exit 1
95 fi >$@
96 """,
97)
98
99# This is the default depending to define CURL_CA_BUNDLE on Linux, it is tagged
100# as `no-cache` because the output on one host cannot be used in another host.
101cc_library(
102 name = "define-ca-bundle-location-guess",
103 hdrs = ["include/curl_ca_bundle_location.h"],
104 tags = ["no-cache"],
105)
106
107# This library is used on redhat-like hosts (RHEL, CentOS, and Fedora for
108# example), because all such hosts use the same value, we can cache this
109# library.
110cc_library(
111 name = "define-ca-bundle-location-redhat",
112 hdrs = [],
113 defines = ["""CURL_CA_BUNDLE='"/etc/pki/tls/certs/ca-bundle.crt"'"""],
114 tags = [],
115)
116
117# This library is used on debian-like hosts (Debian, and Ubuntu for example),
118# because all such hosts use the same value, we can cache this library.
119cc_library(
120 name = "define-ca-bundle-location-debian",
121 hdrs = [],
122 defines = ["""CURL_CA_BUNDLE='"/etc/ssl/certs/ca-certificates.crt"'"""],
123 tags = [],
124)
125
126# This library uses the `ca_bundle_style*` config setting to branch the
127# dependency
128cc_library(
129 name = "define-ca-bundle-location-linux",
130 deps = select({
131 ":ca_bundle_style_is_redhat": [":define-ca-bundle-location-redhat"],
132 ":ca_bundle_style_is_debian": [":define-ca-bundle-location-debian"],
133 "//conditions:default": [":define-ca-bundle-location-guess"],
134 }),
135)
136
137# Finally, on Windows and macOS we do not need to define CURL_CA_BUNDLE at all,
138# so on those platforms we skip the branch of the dependencies altogether.
139cc_library(
140 name = "define-ca-bundle-location",
141 deps = select({
142 ":windows": [],
143 ":macos": [],
144 "//conditions:default": [":define-ca-bundle-location-linux"],
145 }),
146)
147
148CURL_WIN_COPTS = [
149 "/Iexternal/com_github_curl_curl/lib",
150 "/DBUILDING_LIBCURL",
151 "/DHAVE_CONFIG_H",
152 "/DCURL_DISABLE_FTP",
153 "/DCURL_DISABLE_NTLM",
154 "/DCURL_DISABLE_PROXY",
155 "/DHAVE_LIBZ",
156 "/DHAVE_ZLIB_H",
157 # Defining _USING_V110_SDK71_ is hackery to defeat curl's incorrect
158 # detection of what OS releases we can build on with VC 2012. This
159 # may not be needed (or may have to change) if the WINVER setting
160 # changes in //third_party/msvc/vc_12_0/CROSSTOOL.
161 "/D_USING_V110_SDK71_",
162]
163
164CURL_WIN_SRCS = [
165 "lib/asyn-thread.c",
166 "lib/inet_ntop.c",
167 "lib/system_win32.c",
168 "lib/x509asn1.c",
169 "lib/vtls/schannel.c",
170 "lib/vtls/schannel_verify.c",
171 "lib/idn_win32.c",
172]
173
174cc_library(
175 name = "curl",
176 srcs = [
177 "include/curl_config.h",
Alexei Strotsb8bb99b2023-09-25 12:52:06 -0700178 "lib/altsvc.c",
179 "lib/altsvc.h",
Austin Schuh86110712022-09-16 15:40:54 -0700180 "lib/amigaos.h",
181 "lib/arpa_telnet.h",
182 "lib/asyn.h",
183 "lib/asyn-ares.c",
184 "lib/base64.c",
185 "lib/config-win32.h",
186 "lib/conncache.c",
187 "lib/conncache.h",
188 "lib/connect.c",
189 "lib/connect.h",
190 "lib/content_encoding.c",
191 "lib/content_encoding.h",
192 "lib/cookie.c",
193 "lib/cookie.h",
194 "lib/curl_addrinfo.c",
195 "lib/curl_addrinfo.h",
196 "lib/curl_base64.h",
197 "lib/curl_ctype.c",
198 "lib/curl_ctype.h",
199 "lib/curl_des.h",
200 "lib/curl_endian.h",
201 "lib/curl_fnmatch.c",
202 "lib/curl_fnmatch.h",
Alexei Strotsb8bb99b2023-09-25 12:52:06 -0700203 "lib/curl_get_line.c",
204 "lib/curl_get_line.h",
Austin Schuh86110712022-09-16 15:40:54 -0700205 "lib/curl_gethostname.c",
206 "lib/curl_gethostname.h",
207 "lib/curl_gssapi.h",
208 "lib/curl_hmac.h",
209 "lib/curl_ldap.h",
210 "lib/curl_md4.h",
211 "lib/curl_md5.h",
212 "lib/curl_memory.h",
213 "lib/curl_memrchr.c",
214 "lib/curl_memrchr.h",
215 "lib/curl_multibyte.c",
216 "lib/curl_multibyte.h",
217 "lib/curl_ntlm_core.h",
218 "lib/curl_ntlm_wb.h",
219 "lib/curl_printf.h",
220 "lib/curl_rtmp.c",
221 "lib/curl_rtmp.h",
222 "lib/curl_sasl.c",
223 "lib/curl_sasl.h",
224 "lib/curl_sec.h",
225 "lib/curl_setup.h",
226 "lib/curl_setup_once.h",
227 "lib/curl_sha256.h",
228 "lib/curl_sspi.c",
229 "lib/curl_sspi.h",
230 "lib/curl_threads.c",
231 "lib/curl_threads.h",
232 "lib/curlx.h",
233 "lib/dict.h",
Alexei Strotsb8bb99b2023-09-25 12:52:06 -0700234 "lib/doh.c",
235 "lib/doh.h",
Austin Schuh86110712022-09-16 15:40:54 -0700236 "lib/dotdot.c",
237 "lib/dotdot.h",
238 "lib/easy.c",
239 "lib/easyif.h",
240 "lib/escape.c",
241 "lib/escape.h",
242 "lib/file.h",
243 "lib/fileinfo.c",
244 "lib/fileinfo.h",
245 "lib/formdata.c",
246 "lib/formdata.h",
247 "lib/ftp.h",
248 "lib/ftplistparser.h",
249 "lib/getenv.c",
250 "lib/getinfo.c",
251 "lib/getinfo.h",
252 "lib/gopher.h",
253 "lib/hash.c",
254 "lib/hash.h",
255 "lib/hmac.c",
256 "lib/hostasyn.c",
257 "lib/hostcheck.c",
258 "lib/hostcheck.h",
259 "lib/hostip.c",
260 "lib/hostip.h",
261 "lib/hostip4.c",
262 "lib/hostip6.c",
263 "lib/hostsyn.c",
264 "lib/http.c",
265 "lib/http.h",
266 "lib/http2.c",
267 "lib/http2.h",
268 "lib/http_chunks.c",
269 "lib/http_chunks.h",
270 "lib/http_digest.c",
271 "lib/http_digest.h",
272 "lib/http_negotiate.h",
273 "lib/http_ntlm.h",
274 "lib/http_proxy.c",
275 "lib/http_proxy.h",
276 "lib/if2ip.c",
277 "lib/if2ip.h",
278 "lib/imap.h",
279 "lib/inet_ntop.h",
280 "lib/inet_pton.c",
281 "lib/inet_pton.h",
282 "lib/krb5.c",
283 "lib/llist.c",
284 "lib/llist.h",
285 "lib/md4.c",
286 "lib/md5.c",
287 "lib/memdebug.c",
288 "lib/memdebug.h",
289 "lib/mime.c",
290 "lib/mime.h",
291 "lib/mprintf.c",
292 "lib/multi.c",
293 "lib/multihandle.h",
294 "lib/multiif.h",
295 "lib/netrc.c",
296 "lib/netrc.h",
297 "lib/non-ascii.h",
298 "lib/nonblock.c",
299 "lib/nonblock.h",
300 "lib/nwlib.c",
301 "lib/nwos.c",
302 "lib/parsedate.c",
303 "lib/parsedate.h",
Austin Schuh86110712022-09-16 15:40:54 -0700304 "lib/pingpong.c",
Alexei Strotsb8bb99b2023-09-25 12:52:06 -0700305 "lib/pingpong.h",
Austin Schuh86110712022-09-16 15:40:54 -0700306 "lib/pop3.h",
307 "lib/progress.c",
308 "lib/progress.h",
Alexei Strotsb8bb99b2023-09-25 12:52:06 -0700309 "lib/psl.c",
310 "lib/psl.h",
Austin Schuh86110712022-09-16 15:40:54 -0700311 "lib/quic.h",
312 "lib/rand.c",
313 "lib/rand.h",
Austin Schuh86110712022-09-16 15:40:54 -0700314 "lib/rename.c",
Alexei Strotsb8bb99b2023-09-25 12:52:06 -0700315 "lib/rename.h",
Austin Schuh86110712022-09-16 15:40:54 -0700316 "lib/rtsp.c",
317 "lib/rtsp.h",
318 "lib/security.c",
319 "lib/select.c",
320 "lib/select.h",
321 "lib/sendf.c",
322 "lib/sendf.h",
323 "lib/setopt.c",
324 "lib/setopt.h",
325 "lib/setup-os400.h",
326 "lib/setup-vms.h",
327 "lib/sha256.c",
328 "lib/share.c",
329 "lib/share.h",
330 "lib/sigpipe.h",
331 "lib/slist.c",
332 "lib/slist.h",
333 "lib/smb.h",
334 "lib/smtp.h",
335 "lib/sockaddr.h",
Austin Schuh86110712022-09-16 15:40:54 -0700336 "lib/socketpair.c",
Alexei Strotsb8bb99b2023-09-25 12:52:06 -0700337 "lib/socketpair.h",
Austin Schuh86110712022-09-16 15:40:54 -0700338 "lib/socks.c",
339 "lib/socks.h",
340 "lib/speedcheck.c",
341 "lib/speedcheck.h",
342 "lib/splay.c",
343 "lib/splay.h",
344 "lib/strcase.c",
345 "lib/strcase.h",
346 "lib/strdup.c",
347 "lib/strdup.h",
348 "lib/strerror.c",
349 "lib/strerror.h",
350 "lib/strtok.c",
351 "lib/strtok.h",
352 "lib/strtoofft.c",
353 "lib/strtoofft.h",
354 "lib/system_win32.h",
355 "lib/telnet.h",
356 "lib/tftp.h",
357 "lib/timeval.c",
358 "lib/timeval.h",
359 "lib/transfer.c",
360 "lib/transfer.h",
361 "lib/url.c",
362 "lib/url.h",
Alexei Strotsb8bb99b2023-09-25 12:52:06 -0700363 "lib/urlapi.c",
364 "lib/urlapi-int.h",
Austin Schuh86110712022-09-16 15:40:54 -0700365 "lib/urldata.h",
366 "lib/vauth/cleartext.c",
367 "lib/vauth/cram.c",
368 "lib/vauth/digest.c",
369 "lib/vauth/digest.h",
370 "lib/vauth/ntlm.h",
371 "lib/vauth/oauth2.c",
372 "lib/vauth/vauth.c",
373 "lib/vauth/vauth.h",
374 "lib/version.c",
375 "lib/vssh/ssh.h",
376 "lib/vtls/bearssl.h",
377 "lib/vtls/gskit.h",
378 "lib/vtls/gtls.h",
379 "lib/vtls/mbedtls.h",
Alexei Strotsb8bb99b2023-09-25 12:52:06 -0700380 "lib/vtls/mesalink.c",
381 "lib/vtls/mesalink.h",
Austin Schuh86110712022-09-16 15:40:54 -0700382 "lib/vtls/nssg.h",
383 "lib/vtls/openssl.h",
384 "lib/vtls/schannel.h",
Alexei Strotsb8bb99b2023-09-25 12:52:06 -0700385 "lib/vtls/sectransp.h",
Austin Schuh86110712022-09-16 15:40:54 -0700386 "lib/vtls/vtls.c",
387 "lib/vtls/vtls.h",
388 "lib/vtls/wolfssl.h",
389 "lib/warnless.c",
390 "lib/warnless.h",
391 "lib/wildcard.c",
392 "lib/wildcard.h",
393 "lib/x509asn1.h",
Austin Schuh86110712022-09-16 15:40:54 -0700394 ] + select({
395 ":macos": [
396 "lib/vtls/sectransp.c",
397 ],
398 ":windows": CURL_WIN_SRCS,
399 "//conditions:default": [
400 "lib/vtls/openssl.c",
401 ],
402 }),
403 hdrs = [
404 "include/curl/curl.h",
405 "include/curl/curlver.h",
406 "include/curl/easy.h",
407 "include/curl/mprintf.h",
408 "include/curl/multi.h",
409 "include/curl/stdcheaders.h",
410 "include/curl/system.h",
411 "include/curl/typecheck-gcc.h",
412 "include/curl/urlapi.h",
413 ],
414 copts = select({
415 ":windows": CURL_WIN_COPTS,
416 "//conditions:default": [
417 "-Iexternal/com_github_curl_curl/lib",
418 "-D_GNU_SOURCE",
419 "-DBUILDING_LIBCURL",
420 "-DHAVE_CONFIG_H",
421 "-DCURL_DISABLE_FTP",
422 "-DCURL_DISABLE_NTLM", # turning it off in configure is not enough
423 "-DHAVE_LIBZ",
424 "-DHAVE_ZLIB_H",
425 "-Wno-string-plus-int",
426 "-Wno-cast-qual",
427 "-Wno-format-nonliteral",
428 "-Wno-tautological-type-limit-compare",
429 ],
430 }) + select({
431 ":macos": [
432 "-fno-constant-cfstrings",
433 ],
434 "//conditions:default": [],
435 }),
436 defines = ["CURL_STATICLIB"] + select({
437 ":windows": [
438 # See curl.h for discussion of write size and Windows
439 "CURL_MAX_WRITE_SIZE=16384",
440 ],
441 "//conditions:default": [
442 "CURL_MAX_WRITE_SIZE=65536",
443 ],
444 }),
445 includes = ["include"],
446 linkopts = select({
447 ":macos": [
448 "-Wl,-framework",
449 "-Wl,CoreFoundation",
450 "-Wl,-framework",
451 "-Wl,Security",
452 ],
453 ":windows": [
454 "-DEFAULTLIB:ws2_32.lib",
455 "-DEFAULTLIB:advapi32.lib",
456 "-DEFAULTLIB:crypt32.lib",
457 "-DEFAULTLIB:Normaliz.lib",
458 ],
459 "//conditions:default": [
460 "-lrt",
461 ],
462 }),
463 visibility = ["//visibility:public"],
464 deps = [
465 # Use the same version of zlib that gRPC does.
Alexei Strotsb8bb99b2023-09-25 12:52:06 -0700466 "@zlib",
Austin Schuh86110712022-09-16 15:40:54 -0700467 ":define-ca-bundle-location",
468 ] + select({
469 ":windows": [],
470 "//conditions:default": [
471 "@boringssl//:ssl",
472 ],
473 }),
474)
475
476genrule(
477 name = "configure",
478 outs = ["include/curl_config.h"],
479 cmd = "\n".join([
480 "cat <<'EOF' >$@",
481 "#ifndef EXTERNAL_CURL_INCLUDE_CURL_CONFIG_H_",
482 "#define EXTERNAL_CURL_INCLUDE_CURL_CONFIG_H_",
483 "",
484 "#if !defined(_WIN32) && !defined(__APPLE__)",
485 "# include <openssl/opensslv.h>",
486 "# if defined(OPENSSL_IS_BORINGSSL)",
487 "# define HAVE_BORINGSSL 1",
488 "# endif",
489 "#endif",
490 "",
491 "#if defined(_WIN32)",
492 "# include \"lib/config-win32.h\"",
493 "# define BUILDING_LIBCURL 1",
494 "# define CURL_DISABLE_CRYPTO_AUTH 1",
495 "# define CURL_DISABLE_DICT 1",
496 "# define CURL_DISABLE_FILE 1",
497 "# define CURL_DISABLE_GOPHER 1",
498 "# define CURL_DISABLE_IMAP 1",
499 "# define CURL_DISABLE_LDAP 1",
500 "# define CURL_DISABLE_LDAPS 1",
501 "# define CURL_DISABLE_POP3 1",
502 "# define CURL_PULL_WS2TCPIP_H 1",
503 "# define CURL_DISABLE_SMTP 1",
504 "# define CURL_DISABLE_TELNET 1",
505 "# define CURL_DISABLE_TFTP 1",
506 "# define CURL_PULL_WS2TCPIP_H 1",
507 "# define USE_WINDOWS_SSPI 1",
508 "# define USE_WIN32_IDN 1",
509 "# define USE_SCHANNEL 1",
510 "# define WANT_IDN_PROTOTYPES 1",
511 "#elif defined(__APPLE__)",
512 "# define HAVE_FSETXATTR_6 1",
513 "# define HAVE_SETMODE 1",
514 "# define HAVE_SYS_FILIO_H 1",
515 "# define HAVE_SYS_SOCKIO_H 1",
516 "# define OS \"x86_64-apple-darwin15.5.0\"",
517 "# define USE_SECTRANSP 1",
518 "#else",
519 "# if !defined(CURL_CA_BUNDLE)",
520 "# include \"include/curl_ca_bundle_location.h\"",
521 "# endif // CURL_CA_BUNDLE",
522 "# define GETSERVBYPORT_R_ARGS 6",
523 "# define GETSERVBYPORT_R_BUFSIZE 4096",
524 "# define HAVE_BORINGSSL 1",
525 "# define HAVE_CLOCK_GETTIME_MONOTONIC 1",
526 "# define HAVE_CONNECT 1",
527 "# define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1",
528 "# define HAVE_FSETXATTR_5 1",
529 "# define HAVE_GETHOSTBYADDR_R 1",
530 "# define HAVE_GETHOSTBYADDR_R_8 1",
531 "# define HAVE_GETHOSTBYNAME_R 1",
532 "# define HAVE_GETHOSTBYNAME_R_6 1",
533 "# define HAVE_GETSERVBYPORT_R 1",
534 "# define HAVE_LIBSSL 1",
535 "# define HAVE_MALLOC_H 1",
536 "# define HAVE_MSG_NOSIGNAL 1",
537 "# define HAVE_OPENSSL_CRYPTO_H 1",
538 "# define HAVE_OPENSSL_ERR_H 1",
539 "# define HAVE_OPENSSL_PEM_H 1",
540 "# define HAVE_OPENSSL_PKCS12_H 1",
541 "# define HAVE_OPENSSL_RSA_H 1",
542 "# define HAVE_OPENSSL_SSL_H 1",
543 "# define HAVE_OPENSSL_X509_H 1",
544 "# define HAVE_RAND_EGD 1",
545 "# define HAVE_RAND_STATUS 1",
546 "# define HAVE_SSL_GET_SHUTDOWN 1",
547 "# define HAVE_TERMIOS_H 1",
548 "# define OS \"x86_64-pc-linux-gnu\"",
549 "# define RANDOM_FILE \"/dev/urandom\"",
550 "# define USE_OPENSSL 1",
551 "#endif",
552 "",
553 "#if !defined(_WIN32)",
554 "# define CURL_DISABLE_DICT 1",
555 "# define CURL_DISABLE_FILE 1",
556 "# define CURL_DISABLE_GOPHER 1",
557 "# define CURL_DISABLE_IMAP 1",
558 "# define CURL_DISABLE_LDAP 1",
559 "# define CURL_DISABLE_LDAPS 1",
560 "# define CURL_DISABLE_POP3 1",
561 "# define CURL_DISABLE_SMTP 1",
562 "# define CURL_DISABLE_TELNET 1",
563 "# define CURL_DISABLE_TFTP 1",
564 "# define CURL_EXTERN_SYMBOL __attribute__ ((__visibility__ (\"default\")))",
565 "# define ENABLE_IPV6 1",
566 "# define GETHOSTNAME_TYPE_ARG2 size_t",
567 "# define GETNAMEINFO_QUAL_ARG1 const",
568 "# define GETNAMEINFO_TYPE_ARG1 struct sockaddr *",
569 "# define GETNAMEINFO_TYPE_ARG2 socklen_t",
570 "# define GETNAMEINFO_TYPE_ARG46 socklen_t",
571 "# define GETNAMEINFO_TYPE_ARG7 int",
572 "# define HAVE_ALARM 1",
573 "# define HAVE_ALLOCA_H 1",
574 "# define HAVE_ARPA_INET_H 1",
575 "# define HAVE_ARPA_TFTP_H 1",
576 "# define HAVE_ASSERT_H 1",
577 "# define HAVE_BASENAME 1",
578 "# define HAVE_BOOL_T 1",
579 "# define HAVE_CONNECT 1",
580 "# define HAVE_DLFCN_H 1",
581 "# define HAVE_ERRNO_H 1",
582 "# define HAVE_FCNTL 1",
583 "# define HAVE_FCNTL_H 1",
584 "# define HAVE_FCNTL_O_NONBLOCK 1",
585 "# define HAVE_FDOPEN 1",
586 "# define HAVE_FORK 1",
587 "# define HAVE_FREEADDRINFO 1",
588 "# define HAVE_FREEIFADDRS 1",
589 "# if !defined(__ANDROID__)",
590 "# define HAVE_FSETXATTR 1",
591 "# endif",
592 "# define HAVE_FTRUNCATE 1",
593 "# define HAVE_GAI_STRERROR 1",
594 "# define HAVE_GETADDRINFO 1",
595 "# define HAVE_GETADDRINFO_THREADSAFE 1",
596 "# define HAVE_GETEUID 1",
597 "# define HAVE_GETHOSTBYADDR 1",
598 "# define HAVE_GETHOSTBYNAME 1",
599 "# define HAVE_GETHOSTNAME 1",
600 "# if !defined(__ANDROID__)",
601 "# define HAVE_GETIFADDRS 1",
602 "# endif",
603 "# define HAVE_GETNAMEINFO 1",
604 "# define HAVE_GETPEERNAME 1",
605 "# define HAVE_GETPPID 1",
606 "# define HAVE_GETPROTOBYNAME 1",
607 "# define HAVE_GETPWUID 1",
608 "# if !defined(__ANDROID__)",
609 "# define HAVE_GETPWUID_R 1",
610 "# endif",
611 "# define HAVE_GETRLIMIT 1",
612 "# define HAVE_GETSOCKNAME 1",
613 "# define HAVE_GETTIMEOFDAY 1",
614 "# define HAVE_GMTIME_R 1",
615 "# if !defined(__ANDROID__)",
616 "# define HAVE_IFADDRS_H 1",
617 "# endif",
618 "# define HAVE_IF_NAMETOINDEX 1",
619 "# define HAVE_INET_ADDR 1",
620 "# define HAVE_INET_NTOP 1",
621 "# define HAVE_INET_PTON 1",
622 "# define HAVE_INTTYPES_H 1",
623 "# define HAVE_IOCTL 1",
624 "# define HAVE_IOCTL_FIONBIO 1",
625 "# define HAVE_IOCTL_SIOCGIFADDR 1",
626 "# define HAVE_LIBGEN_H 1",
627 "# define HAVE_LIBZ 1",
628 "# define HAVE_LIMITS_H 1",
629 "# define HAVE_LL 1",
630 "# define HAVE_LOCALE_H 1",
631 "# define HAVE_LOCALTIME_R 1",
632 "# define HAVE_LONGLONG 1",
633 "# define HAVE_MEMORY_H 1",
634 "# define HAVE_NETDB_H 1",
635 "# define HAVE_NETINET_IN_H 1",
636 "# define HAVE_NETINET_TCP_H 1",
637 "# define HAVE_NET_IF_H 1",
638 "# define HAVE_PERROR 1",
639 "# define HAVE_PIPE 1",
640 "# define HAVE_POLL 1",
641 "# define HAVE_POLL_FINE 1",
642 "# define HAVE_POLL_H 1",
643 "# define HAVE_POSIX_STRERROR_R 1",
644 "# define HAVE_PWD_H 1",
645 "# define HAVE_RECV 1",
646 "# define HAVE_SELECT 1",
647 "# define HAVE_SEND 1",
648 "# define HAVE_SETJMP_H 1",
649 "# define HAVE_SETLOCALE 1",
650 "# define HAVE_SETRLIMIT 1",
651 "# define HAVE_SETSOCKOPT 1",
652 "# define HAVE_SGTTY_H 1",
653 "# define HAVE_SIGACTION 1",
654 "# define HAVE_SIGINTERRUPT 1",
655 "# define HAVE_SIGNAL 1",
656 "# define HAVE_SIGNAL_H 1",
657 "# define HAVE_SIGSETJMP 1",
658 "# define HAVE_SIG_ATOMIC_T 1",
659 "# define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1",
660 "# define HAVE_SOCKET 1",
661 "# define HAVE_SOCKETPAIR 1",
662 "# define HAVE_STDBOOL_H 1",
663 "# define HAVE_STDINT_H 1",
664 "# define HAVE_STDIO_H 1",
665 "# define HAVE_STDLIB_H 1",
666 "# define HAVE_STRCASECMP 1",
667 "# define HAVE_STRDUP 1",
668 "# define HAVE_STRERROR_R 1",
669 "# define HAVE_STRINGS_H 1",
670 "# define HAVE_STRING_H 1",
671 "# define HAVE_STRNCASECMP 1",
672 "# define HAVE_STRSTR 1",
673 "# define HAVE_STRTOK_R 1",
674 "# define HAVE_STRTOLL 1",
675 "# define HAVE_STRUCT_SOCKADDR_STORAGE 1",
676 "# define HAVE_STRUCT_TIMEVAL 1",
677 "# define HAVE_SYS_IOCTL_H 1",
678 "# define HAVE_SYS_PARAM_H 1",
679 "# define HAVE_SYS_POLL_H 1",
680 "# define HAVE_SYS_RESOURCE_H 1",
681 "# define HAVE_SYS_SELECT_H 1",
682 "# define HAVE_SYS_SOCKET_H 1",
683 "# define HAVE_SYS_STAT_H 1",
684 "# define HAVE_SYS_TIME_H 1",
685 "# define HAVE_SYS_TYPES_H 1",
686 "# define HAVE_SYS_UIO_H 1",
687 "# define HAVE_SYS_UN_H 1",
688 "# define HAVE_SYS_WAIT_H 1",
689 "# define HAVE_SYS_XATTR_H 1",
690 "# define HAVE_TIME_H 1",
691 "# define HAVE_UNAME 1",
692 "# define HAVE_UNISTD_H 1",
693 "# define HAVE_UTIME 1",
694 "# define HAVE_UTIME_H 1",
695 "# define HAVE_VARIADIC_MACROS_C99 1",
696 "# define HAVE_VARIADIC_MACROS_GCC 1",
697 "# define HAVE_WRITABLE_ARGV 1",
698 "# define HAVE_WRITEV 1",
699 "# define HAVE_ZLIB_H 1",
700 "# define LT_OBJDIR \".libs/\"",
701 "# define PACKAGE \"curl\"",
702 "# define PACKAGE_BUGREPORT \"a suitable curl mailing list: https://curl.haxx.se/mail/\"",
703 "# define PACKAGE_NAME \"curl\"",
704 "# define PACKAGE_STRING \"curl -\"",
705 "# define PACKAGE_TARNAME \"curl\"",
706 "# define PACKAGE_URL \"\"",
707 "# define PACKAGE_VERSION \"-\"",
708 "# define RECV_TYPE_ARG1 int",
709 "# define RECV_TYPE_ARG2 void *",
710 "# define RECV_TYPE_ARG3 size_t",
711 "# define RECV_TYPE_ARG4 int",
712 "# define RECV_TYPE_RETV ssize_t",
713 "# define RETSIGTYPE void",
714 "# define SELECT_QUAL_ARG5",
715 "# define SELECT_TYPE_ARG1 int",
716 "# define SELECT_TYPE_ARG234 fd_set *",
717 "# define SELECT_TYPE_ARG5 struct timeval *",
718 "# define SELECT_TYPE_RETV int",
719 "# define SEND_QUAL_ARG2 const",
720 "# define SEND_TYPE_ARG1 int",
721 "# define SEND_TYPE_ARG2 void *",
722 "# define SEND_TYPE_ARG3 size_t",
723 "# define SEND_TYPE_ARG4 int",
724 "# define SEND_TYPE_RETV ssize_t",
725 "# define SIZEOF_INT 4",
726 "# define SIZEOF_SHORT 2",
727 "# define STDC_HEADERS 1",
728 "# define STRERROR_R_TYPE_ARG3 size_t",
729 "# define TIME_WITH_SYS_TIME 1",
730 "# define VERSION \"-\"",
731 "# ifndef _DARWIN_USE_64_BIT_INODE",
732 "# define _DARWIN_USE_64_BIT_INODE 1",
733 "# endif",
734 "#endif",
735 "",
736 "#endif // EXTERNAL_CURL_INCLUDE_CURL_CONFIG_H_",
737 ]) + "\n" + select({
738 ":linux_x86_64": "\n".join([
739 "# define SIZEOF_LONG 8",
740 "# define SIZEOF_OFF_T 8",
741 "# define SIZEOF_CURL_OFF_T 8",
742 "# define SIZEOF_SIZE_T 8",
743 "# define SIZEOF_TIME_T 8",
744 "# define SIZEOF_VOIDP 8",
745 ]),
746 ":linux_arm64": "\n".join([
747 "# define SIZEOF_LONG 8",
748 "# define SIZEOF_OFF_T 8",
749 "# define SIZEOF_CURL_OFF_T 8",
750 "# define SIZEOF_SIZE_T 8",
751 "# define SIZEOF_TIME_T 8",
752 "# define SIZEOF_VOIDP 8",
753 ]),
754 ":linux_armv7": "\n".join(
755 [
756 "# define SIZEOF_LONG 4",
757 "# define SIZEOF_OFF_T 4",
758 "# define SIZEOF_CURL_OFF_T 4",
759 "# define SIZEOF_SIZE_T 4",
760 "# define SIZEOF_TIME_T 4",
761 "# define SIZEOF_VOIDP 4",
762 ],
763 ),
764 "//conditions:default": "",
765 }) + "\nEOF",
766)