Austin Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 1 | # 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 | |
| 8 | licenses(["notice"]) # MIT/X derivative license |
| 9 | |
| 10 | exports_files(["COPYING"]) |
| 11 | |
| 12 | config_setting( |
| 13 | name = "windows", |
| 14 | values = {"cpu": "x64_windows"}, |
| 15 | visibility = ["//visibility:public"], |
| 16 | ) |
| 17 | |
| 18 | config_setting( |
| 19 | name = "linux_x86_64", |
| 20 | constraint_values = [ |
| 21 | "@platforms//cpu:x86_64", |
| 22 | "@platforms//os:linux", |
| 23 | ], |
| 24 | ) |
| 25 | |
| 26 | config_setting( |
| 27 | name = "linux_arm64", |
| 28 | constraint_values = [ |
| 29 | "@platforms//cpu:arm64", |
| 30 | "@platforms//os:linux", |
| 31 | ], |
| 32 | ) |
| 33 | |
| 34 | config_setting( |
| 35 | name = "linux_armv7", |
| 36 | constraint_values = [ |
| 37 | "@platforms//cpu:armv7", |
| 38 | "@platforms//os:linux", |
| 39 | ], |
| 40 | ) |
| 41 | |
| 42 | config_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: |
| 63 | config_setting( |
| 64 | name = "ca_bundle_style_is_redhat", |
| 65 | define_values = { |
| 66 | "ca_bundle_style": "redhat", |
| 67 | }, |
| 68 | ) |
| 69 | |
| 70 | config_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>: |
| 80 | genrule( |
| 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. |
| 101 | cc_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. |
| 110 | cc_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. |
| 119 | cc_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 |
| 128 | cc_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. |
| 139 | cc_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 | |
| 148 | CURL_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 | |
| 164 | CURL_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 | |
| 174 | cc_library( |
| 175 | name = "curl", |
| 176 | srcs = [ |
| 177 | "include/curl_config.h", |
Alexei Strots | b8bb99b | 2023-09-25 12:52:06 -0700 | [diff] [blame] | 178 | "lib/altsvc.c", |
| 179 | "lib/altsvc.h", |
Austin Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 180 | "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 Strots | b8bb99b | 2023-09-25 12:52:06 -0700 | [diff] [blame] | 203 | "lib/curl_get_line.c", |
| 204 | "lib/curl_get_line.h", |
Austin Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 205 | "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 Strots | b8bb99b | 2023-09-25 12:52:06 -0700 | [diff] [blame] | 234 | "lib/doh.c", |
| 235 | "lib/doh.h", |
Austin Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 236 | "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 Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 304 | "lib/pingpong.c", |
Alexei Strots | b8bb99b | 2023-09-25 12:52:06 -0700 | [diff] [blame] | 305 | "lib/pingpong.h", |
Austin Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 306 | "lib/pop3.h", |
| 307 | "lib/progress.c", |
| 308 | "lib/progress.h", |
Alexei Strots | b8bb99b | 2023-09-25 12:52:06 -0700 | [diff] [blame] | 309 | "lib/psl.c", |
| 310 | "lib/psl.h", |
Austin Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 311 | "lib/quic.h", |
| 312 | "lib/rand.c", |
| 313 | "lib/rand.h", |
Austin Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 314 | "lib/rename.c", |
Alexei Strots | b8bb99b | 2023-09-25 12:52:06 -0700 | [diff] [blame] | 315 | "lib/rename.h", |
Austin Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 316 | "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 Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 336 | "lib/socketpair.c", |
Alexei Strots | b8bb99b | 2023-09-25 12:52:06 -0700 | [diff] [blame] | 337 | "lib/socketpair.h", |
Austin Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 338 | "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 Strots | b8bb99b | 2023-09-25 12:52:06 -0700 | [diff] [blame] | 363 | "lib/urlapi.c", |
| 364 | "lib/urlapi-int.h", |
Austin Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 365 | "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 Strots | b8bb99b | 2023-09-25 12:52:06 -0700 | [diff] [blame] | 380 | "lib/vtls/mesalink.c", |
| 381 | "lib/vtls/mesalink.h", |
Austin Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 382 | "lib/vtls/nssg.h", |
| 383 | "lib/vtls/openssl.h", |
| 384 | "lib/vtls/schannel.h", |
Alexei Strots | b8bb99b | 2023-09-25 12:52:06 -0700 | [diff] [blame] | 385 | "lib/vtls/sectransp.h", |
Austin Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 386 | "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 Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 394 | ] + 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", |
Austin Schuh | 50e3dca | 2023-07-23 14:34:27 -0700 | [diff] [blame^] | 429 | "-Wno-unused-but-set-variable", |
Austin Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 430 | ], |
| 431 | }) + select({ |
| 432 | ":macos": [ |
| 433 | "-fno-constant-cfstrings", |
| 434 | ], |
| 435 | "//conditions:default": [], |
| 436 | }), |
| 437 | defines = ["CURL_STATICLIB"] + select({ |
| 438 | ":windows": [ |
| 439 | # See curl.h for discussion of write size and Windows |
| 440 | "CURL_MAX_WRITE_SIZE=16384", |
| 441 | ], |
| 442 | "//conditions:default": [ |
| 443 | "CURL_MAX_WRITE_SIZE=65536", |
| 444 | ], |
| 445 | }), |
| 446 | includes = ["include"], |
| 447 | linkopts = select({ |
| 448 | ":macos": [ |
| 449 | "-Wl,-framework", |
| 450 | "-Wl,CoreFoundation", |
| 451 | "-Wl,-framework", |
| 452 | "-Wl,Security", |
| 453 | ], |
| 454 | ":windows": [ |
| 455 | "-DEFAULTLIB:ws2_32.lib", |
| 456 | "-DEFAULTLIB:advapi32.lib", |
| 457 | "-DEFAULTLIB:crypt32.lib", |
| 458 | "-DEFAULTLIB:Normaliz.lib", |
| 459 | ], |
| 460 | "//conditions:default": [ |
| 461 | "-lrt", |
| 462 | ], |
| 463 | }), |
| 464 | visibility = ["//visibility:public"], |
| 465 | deps = [ |
| 466 | # Use the same version of zlib that gRPC does. |
Alexei Strots | b8bb99b | 2023-09-25 12:52:06 -0700 | [diff] [blame] | 467 | "@zlib", |
Austin Schuh | 8611071 | 2022-09-16 15:40:54 -0700 | [diff] [blame] | 468 | ":define-ca-bundle-location", |
| 469 | ] + select({ |
| 470 | ":windows": [], |
| 471 | "//conditions:default": [ |
| 472 | "@boringssl//:ssl", |
| 473 | ], |
| 474 | }), |
| 475 | ) |
| 476 | |
| 477 | genrule( |
| 478 | name = "configure", |
| 479 | outs = ["include/curl_config.h"], |
| 480 | cmd = "\n".join([ |
| 481 | "cat <<'EOF' >$@", |
| 482 | "#ifndef EXTERNAL_CURL_INCLUDE_CURL_CONFIG_H_", |
| 483 | "#define EXTERNAL_CURL_INCLUDE_CURL_CONFIG_H_", |
| 484 | "", |
| 485 | "#if !defined(_WIN32) && !defined(__APPLE__)", |
| 486 | "# include <openssl/opensslv.h>", |
| 487 | "# if defined(OPENSSL_IS_BORINGSSL)", |
| 488 | "# define HAVE_BORINGSSL 1", |
| 489 | "# endif", |
| 490 | "#endif", |
| 491 | "", |
| 492 | "#if defined(_WIN32)", |
| 493 | "# include \"lib/config-win32.h\"", |
| 494 | "# define BUILDING_LIBCURL 1", |
| 495 | "# define CURL_DISABLE_CRYPTO_AUTH 1", |
| 496 | "# define CURL_DISABLE_DICT 1", |
| 497 | "# define CURL_DISABLE_FILE 1", |
| 498 | "# define CURL_DISABLE_GOPHER 1", |
| 499 | "# define CURL_DISABLE_IMAP 1", |
| 500 | "# define CURL_DISABLE_LDAP 1", |
| 501 | "# define CURL_DISABLE_LDAPS 1", |
| 502 | "# define CURL_DISABLE_POP3 1", |
| 503 | "# define CURL_PULL_WS2TCPIP_H 1", |
| 504 | "# define CURL_DISABLE_SMTP 1", |
| 505 | "# define CURL_DISABLE_TELNET 1", |
| 506 | "# define CURL_DISABLE_TFTP 1", |
| 507 | "# define CURL_PULL_WS2TCPIP_H 1", |
| 508 | "# define USE_WINDOWS_SSPI 1", |
| 509 | "# define USE_WIN32_IDN 1", |
| 510 | "# define USE_SCHANNEL 1", |
| 511 | "# define WANT_IDN_PROTOTYPES 1", |
| 512 | "#elif defined(__APPLE__)", |
| 513 | "# define HAVE_FSETXATTR_6 1", |
| 514 | "# define HAVE_SETMODE 1", |
| 515 | "# define HAVE_SYS_FILIO_H 1", |
| 516 | "# define HAVE_SYS_SOCKIO_H 1", |
| 517 | "# define OS \"x86_64-apple-darwin15.5.0\"", |
| 518 | "# define USE_SECTRANSP 1", |
| 519 | "#else", |
| 520 | "# if !defined(CURL_CA_BUNDLE)", |
| 521 | "# include \"include/curl_ca_bundle_location.h\"", |
| 522 | "# endif // CURL_CA_BUNDLE", |
| 523 | "# define GETSERVBYPORT_R_ARGS 6", |
| 524 | "# define GETSERVBYPORT_R_BUFSIZE 4096", |
| 525 | "# define HAVE_BORINGSSL 1", |
| 526 | "# define HAVE_CLOCK_GETTIME_MONOTONIC 1", |
| 527 | "# define HAVE_CONNECT 1", |
| 528 | "# define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1", |
| 529 | "# define HAVE_FSETXATTR_5 1", |
| 530 | "# define HAVE_GETHOSTBYADDR_R 1", |
| 531 | "# define HAVE_GETHOSTBYADDR_R_8 1", |
| 532 | "# define HAVE_GETHOSTBYNAME_R 1", |
| 533 | "# define HAVE_GETHOSTBYNAME_R_6 1", |
| 534 | "# define HAVE_GETSERVBYPORT_R 1", |
| 535 | "# define HAVE_LIBSSL 1", |
| 536 | "# define HAVE_MALLOC_H 1", |
| 537 | "# define HAVE_MSG_NOSIGNAL 1", |
| 538 | "# define HAVE_OPENSSL_CRYPTO_H 1", |
| 539 | "# define HAVE_OPENSSL_ERR_H 1", |
| 540 | "# define HAVE_OPENSSL_PEM_H 1", |
| 541 | "# define HAVE_OPENSSL_PKCS12_H 1", |
| 542 | "# define HAVE_OPENSSL_RSA_H 1", |
| 543 | "# define HAVE_OPENSSL_SSL_H 1", |
| 544 | "# define HAVE_OPENSSL_X509_H 1", |
| 545 | "# define HAVE_RAND_EGD 1", |
| 546 | "# define HAVE_RAND_STATUS 1", |
| 547 | "# define HAVE_SSL_GET_SHUTDOWN 1", |
| 548 | "# define HAVE_TERMIOS_H 1", |
| 549 | "# define OS \"x86_64-pc-linux-gnu\"", |
| 550 | "# define RANDOM_FILE \"/dev/urandom\"", |
| 551 | "# define USE_OPENSSL 1", |
| 552 | "#endif", |
| 553 | "", |
| 554 | "#if !defined(_WIN32)", |
| 555 | "# define CURL_DISABLE_DICT 1", |
| 556 | "# define CURL_DISABLE_FILE 1", |
| 557 | "# define CURL_DISABLE_GOPHER 1", |
| 558 | "# define CURL_DISABLE_IMAP 1", |
| 559 | "# define CURL_DISABLE_LDAP 1", |
| 560 | "# define CURL_DISABLE_LDAPS 1", |
| 561 | "# define CURL_DISABLE_POP3 1", |
| 562 | "# define CURL_DISABLE_SMTP 1", |
| 563 | "# define CURL_DISABLE_TELNET 1", |
| 564 | "# define CURL_DISABLE_TFTP 1", |
| 565 | "# define CURL_EXTERN_SYMBOL __attribute__ ((__visibility__ (\"default\")))", |
| 566 | "# define ENABLE_IPV6 1", |
| 567 | "# define GETHOSTNAME_TYPE_ARG2 size_t", |
| 568 | "# define GETNAMEINFO_QUAL_ARG1 const", |
| 569 | "# define GETNAMEINFO_TYPE_ARG1 struct sockaddr *", |
| 570 | "# define GETNAMEINFO_TYPE_ARG2 socklen_t", |
| 571 | "# define GETNAMEINFO_TYPE_ARG46 socklen_t", |
| 572 | "# define GETNAMEINFO_TYPE_ARG7 int", |
| 573 | "# define HAVE_ALARM 1", |
| 574 | "# define HAVE_ALLOCA_H 1", |
| 575 | "# define HAVE_ARPA_INET_H 1", |
| 576 | "# define HAVE_ARPA_TFTP_H 1", |
| 577 | "# define HAVE_ASSERT_H 1", |
| 578 | "# define HAVE_BASENAME 1", |
| 579 | "# define HAVE_BOOL_T 1", |
| 580 | "# define HAVE_CONNECT 1", |
| 581 | "# define HAVE_DLFCN_H 1", |
| 582 | "# define HAVE_ERRNO_H 1", |
| 583 | "# define HAVE_FCNTL 1", |
| 584 | "# define HAVE_FCNTL_H 1", |
| 585 | "# define HAVE_FCNTL_O_NONBLOCK 1", |
| 586 | "# define HAVE_FDOPEN 1", |
| 587 | "# define HAVE_FORK 1", |
| 588 | "# define HAVE_FREEADDRINFO 1", |
| 589 | "# define HAVE_FREEIFADDRS 1", |
| 590 | "# if !defined(__ANDROID__)", |
| 591 | "# define HAVE_FSETXATTR 1", |
| 592 | "# endif", |
| 593 | "# define HAVE_FTRUNCATE 1", |
| 594 | "# define HAVE_GAI_STRERROR 1", |
| 595 | "# define HAVE_GETADDRINFO 1", |
| 596 | "# define HAVE_GETADDRINFO_THREADSAFE 1", |
| 597 | "# define HAVE_GETEUID 1", |
| 598 | "# define HAVE_GETHOSTBYADDR 1", |
| 599 | "# define HAVE_GETHOSTBYNAME 1", |
| 600 | "# define HAVE_GETHOSTNAME 1", |
| 601 | "# if !defined(__ANDROID__)", |
| 602 | "# define HAVE_GETIFADDRS 1", |
| 603 | "# endif", |
| 604 | "# define HAVE_GETNAMEINFO 1", |
| 605 | "# define HAVE_GETPEERNAME 1", |
| 606 | "# define HAVE_GETPPID 1", |
| 607 | "# define HAVE_GETPROTOBYNAME 1", |
| 608 | "# define HAVE_GETPWUID 1", |
| 609 | "# if !defined(__ANDROID__)", |
| 610 | "# define HAVE_GETPWUID_R 1", |
| 611 | "# endif", |
| 612 | "# define HAVE_GETRLIMIT 1", |
| 613 | "# define HAVE_GETSOCKNAME 1", |
| 614 | "# define HAVE_GETTIMEOFDAY 1", |
| 615 | "# define HAVE_GMTIME_R 1", |
| 616 | "# if !defined(__ANDROID__)", |
| 617 | "# define HAVE_IFADDRS_H 1", |
| 618 | "# endif", |
| 619 | "# define HAVE_IF_NAMETOINDEX 1", |
| 620 | "# define HAVE_INET_ADDR 1", |
| 621 | "# define HAVE_INET_NTOP 1", |
| 622 | "# define HAVE_INET_PTON 1", |
| 623 | "# define HAVE_INTTYPES_H 1", |
| 624 | "# define HAVE_IOCTL 1", |
| 625 | "# define HAVE_IOCTL_FIONBIO 1", |
| 626 | "# define HAVE_IOCTL_SIOCGIFADDR 1", |
| 627 | "# define HAVE_LIBGEN_H 1", |
| 628 | "# define HAVE_LIBZ 1", |
| 629 | "# define HAVE_LIMITS_H 1", |
| 630 | "# define HAVE_LL 1", |
| 631 | "# define HAVE_LOCALE_H 1", |
| 632 | "# define HAVE_LOCALTIME_R 1", |
| 633 | "# define HAVE_LONGLONG 1", |
| 634 | "# define HAVE_MEMORY_H 1", |
| 635 | "# define HAVE_NETDB_H 1", |
| 636 | "# define HAVE_NETINET_IN_H 1", |
| 637 | "# define HAVE_NETINET_TCP_H 1", |
| 638 | "# define HAVE_NET_IF_H 1", |
| 639 | "# define HAVE_PERROR 1", |
| 640 | "# define HAVE_PIPE 1", |
| 641 | "# define HAVE_POLL 1", |
| 642 | "# define HAVE_POLL_FINE 1", |
| 643 | "# define HAVE_POLL_H 1", |
| 644 | "# define HAVE_POSIX_STRERROR_R 1", |
| 645 | "# define HAVE_PWD_H 1", |
| 646 | "# define HAVE_RECV 1", |
| 647 | "# define HAVE_SELECT 1", |
| 648 | "# define HAVE_SEND 1", |
| 649 | "# define HAVE_SETJMP_H 1", |
| 650 | "# define HAVE_SETLOCALE 1", |
| 651 | "# define HAVE_SETRLIMIT 1", |
| 652 | "# define HAVE_SETSOCKOPT 1", |
| 653 | "# define HAVE_SGTTY_H 1", |
| 654 | "# define HAVE_SIGACTION 1", |
| 655 | "# define HAVE_SIGINTERRUPT 1", |
| 656 | "# define HAVE_SIGNAL 1", |
| 657 | "# define HAVE_SIGNAL_H 1", |
| 658 | "# define HAVE_SIGSETJMP 1", |
| 659 | "# define HAVE_SIG_ATOMIC_T 1", |
| 660 | "# define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1", |
| 661 | "# define HAVE_SOCKET 1", |
| 662 | "# define HAVE_SOCKETPAIR 1", |
| 663 | "# define HAVE_STDBOOL_H 1", |
| 664 | "# define HAVE_STDINT_H 1", |
| 665 | "# define HAVE_STDIO_H 1", |
| 666 | "# define HAVE_STDLIB_H 1", |
| 667 | "# define HAVE_STRCASECMP 1", |
| 668 | "# define HAVE_STRDUP 1", |
| 669 | "# define HAVE_STRERROR_R 1", |
| 670 | "# define HAVE_STRINGS_H 1", |
| 671 | "# define HAVE_STRING_H 1", |
| 672 | "# define HAVE_STRNCASECMP 1", |
| 673 | "# define HAVE_STRSTR 1", |
| 674 | "# define HAVE_STRTOK_R 1", |
| 675 | "# define HAVE_STRTOLL 1", |
| 676 | "# define HAVE_STRUCT_SOCKADDR_STORAGE 1", |
| 677 | "# define HAVE_STRUCT_TIMEVAL 1", |
| 678 | "# define HAVE_SYS_IOCTL_H 1", |
| 679 | "# define HAVE_SYS_PARAM_H 1", |
| 680 | "# define HAVE_SYS_POLL_H 1", |
| 681 | "# define HAVE_SYS_RESOURCE_H 1", |
| 682 | "# define HAVE_SYS_SELECT_H 1", |
| 683 | "# define HAVE_SYS_SOCKET_H 1", |
| 684 | "# define HAVE_SYS_STAT_H 1", |
| 685 | "# define HAVE_SYS_TIME_H 1", |
| 686 | "# define HAVE_SYS_TYPES_H 1", |
| 687 | "# define HAVE_SYS_UIO_H 1", |
| 688 | "# define HAVE_SYS_UN_H 1", |
| 689 | "# define HAVE_SYS_WAIT_H 1", |
| 690 | "# define HAVE_SYS_XATTR_H 1", |
| 691 | "# define HAVE_TIME_H 1", |
| 692 | "# define HAVE_UNAME 1", |
| 693 | "# define HAVE_UNISTD_H 1", |
| 694 | "# define HAVE_UTIME 1", |
| 695 | "# define HAVE_UTIME_H 1", |
| 696 | "# define HAVE_VARIADIC_MACROS_C99 1", |
| 697 | "# define HAVE_VARIADIC_MACROS_GCC 1", |
| 698 | "# define HAVE_WRITABLE_ARGV 1", |
| 699 | "# define HAVE_WRITEV 1", |
| 700 | "# define HAVE_ZLIB_H 1", |
| 701 | "# define LT_OBJDIR \".libs/\"", |
| 702 | "# define PACKAGE \"curl\"", |
| 703 | "# define PACKAGE_BUGREPORT \"a suitable curl mailing list: https://curl.haxx.se/mail/\"", |
| 704 | "# define PACKAGE_NAME \"curl\"", |
| 705 | "# define PACKAGE_STRING \"curl -\"", |
| 706 | "# define PACKAGE_TARNAME \"curl\"", |
| 707 | "# define PACKAGE_URL \"\"", |
| 708 | "# define PACKAGE_VERSION \"-\"", |
| 709 | "# define RECV_TYPE_ARG1 int", |
| 710 | "# define RECV_TYPE_ARG2 void *", |
| 711 | "# define RECV_TYPE_ARG3 size_t", |
| 712 | "# define RECV_TYPE_ARG4 int", |
| 713 | "# define RECV_TYPE_RETV ssize_t", |
| 714 | "# define RETSIGTYPE void", |
| 715 | "# define SELECT_QUAL_ARG5", |
| 716 | "# define SELECT_TYPE_ARG1 int", |
| 717 | "# define SELECT_TYPE_ARG234 fd_set *", |
| 718 | "# define SELECT_TYPE_ARG5 struct timeval *", |
| 719 | "# define SELECT_TYPE_RETV int", |
| 720 | "# define SEND_QUAL_ARG2 const", |
| 721 | "# define SEND_TYPE_ARG1 int", |
| 722 | "# define SEND_TYPE_ARG2 void *", |
| 723 | "# define SEND_TYPE_ARG3 size_t", |
| 724 | "# define SEND_TYPE_ARG4 int", |
| 725 | "# define SEND_TYPE_RETV ssize_t", |
| 726 | "# define SIZEOF_INT 4", |
| 727 | "# define SIZEOF_SHORT 2", |
| 728 | "# define STDC_HEADERS 1", |
| 729 | "# define STRERROR_R_TYPE_ARG3 size_t", |
| 730 | "# define TIME_WITH_SYS_TIME 1", |
| 731 | "# define VERSION \"-\"", |
| 732 | "# ifndef _DARWIN_USE_64_BIT_INODE", |
| 733 | "# define _DARWIN_USE_64_BIT_INODE 1", |
| 734 | "# endif", |
| 735 | "#endif", |
| 736 | "", |
| 737 | "#endif // EXTERNAL_CURL_INCLUDE_CURL_CONFIG_H_", |
| 738 | ]) + "\n" + select({ |
| 739 | ":linux_x86_64": "\n".join([ |
| 740 | "# define SIZEOF_LONG 8", |
| 741 | "# define SIZEOF_OFF_T 8", |
| 742 | "# define SIZEOF_CURL_OFF_T 8", |
| 743 | "# define SIZEOF_SIZE_T 8", |
| 744 | "# define SIZEOF_TIME_T 8", |
| 745 | "# define SIZEOF_VOIDP 8", |
| 746 | ]), |
| 747 | ":linux_arm64": "\n".join([ |
| 748 | "# define SIZEOF_LONG 8", |
| 749 | "# define SIZEOF_OFF_T 8", |
| 750 | "# define SIZEOF_CURL_OFF_T 8", |
| 751 | "# define SIZEOF_SIZE_T 8", |
| 752 | "# define SIZEOF_TIME_T 8", |
| 753 | "# define SIZEOF_VOIDP 8", |
| 754 | ]), |
| 755 | ":linux_armv7": "\n".join( |
| 756 | [ |
| 757 | "# define SIZEOF_LONG 4", |
| 758 | "# define SIZEOF_OFF_T 4", |
| 759 | "# define SIZEOF_CURL_OFF_T 4", |
| 760 | "# define SIZEOF_SIZE_T 4", |
| 761 | "# define SIZEOF_TIME_T 4", |
| 762 | "# define SIZEOF_VOIDP 4", |
| 763 | ], |
| 764 | ), |
| 765 | "//conditions:default": "", |
| 766 | }) + "\nEOF", |
| 767 | ) |