• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package {
2    default_applicable_licenses: ["external_curl_license"],
3}
4
5// Added automatically by a large-scale-change that took the approach of
6// 'apply every license found to every target'. While this makes sure we respect
7// every license restriction, it may not be entirely correct.
8//
9// e.g. GPL in an MIT project might only apply to the contrib/ directory.
10//
11// Please consider splitting the single license below into multiple licenses,
12// taking care not to lose any license_kind information, and overriding the
13// default license using the 'licenses: [...]' property on targets as needed.
14//
15// For unused files, consider creating a 'fileGroup' with "//visibility:private"
16// to attach the license to, and including a comment whether the files may be
17// used in the current project.
18//
19// large-scale-change filtered out the below license kinds as false-positives:
20//   SPDX-license-identifier-GPL
21// See: http://go/android-license-faq
22license {
23    name: "external_curl_license",
24    visibility: [":__subpackages__"],
25    license_kinds: [
26        "SPDX-license-identifier-BSD",
27        "SPDX-license-identifier-ISC",
28        "SPDX-license-identifier-MIT",
29        "SPDX-license-identifier-OpenSSL",
30        "legacy_notice",
31        "legacy_unencumbered",
32    ],
33    license_text: [
34        "COPYING",
35    ],
36}
37
38cc_defaults {
39    name: "curl_common_defaults",
40    cflags: [
41        "-DHAVE_CONFIG_H",
42        "-Wdeclaration-after-statement",
43        "-Wendif-labels",
44        "-Werror",
45        // Bug: http://b/29823425 Disable -Wvarargs for Clang update to r271374
46        "-Wfloat-equal",
47        "-Winline",
48        "-Wmissing-declarations",
49        "-Wmissing-prototypes",
50        "-Wnested-externs",
51        "-Wno-format-nonliteral",
52        "-Wno-long-long",
53        "-Wno-multichar",
54        "-Wno-sign-compare",
55        "-Wno-system-headers",
56        "-Wno-varargs",
57        "-Wpointer-arith",
58        "-Wstrict-prototypes",
59        "-Wunused",
60        "-Wwrite-strings",
61    ],
62    local_include_dirs: [
63        "include",
64        "lib",
65    ],
66    multilib: {
67        lib32: {
68            cflags: [
69                "-DSIZEOF_LONG=4",
70                "-DSIZEOF_LONG_LONG=8",
71                "-DSIZEOF_SIZE_T=4",
72                "-DSIZEOF_TIME_T=4",
73            ],
74        },
75        lib64: {
76            cflags: [
77                "-DSIZEOF_LONG=8",
78                "-DSIZEOF_LONG_LONG=8",
79                "-DSIZEOF_SIZE_T=8",
80                "-DSIZEOF_TIME_T=8",
81            ],
82        },
83    },
84}
85
86cc_library {
87    name: "libcurl",
88    vendor_available: true,
89    product_available: true,
90    defaults: ["curl_common_defaults"],
91    export_include_dirs: ["include"],
92    host_supported: true,
93    cflags: [
94        "-DBUILDING_LIBCURL",
95        "-Wformat-security",
96        "-Wno-format",
97    ],
98    srcs: [
99        "lib/**/*.c",
100    ],
101    shared_libs: [
102        "libcrypto",
103        "libssl",
104        "libz",
105    ],
106    target: {
107        host: {
108            cflags: ["-D_GNU_SOURCE=1"],
109        },
110        darwin: {
111            enabled: false,
112        },
113    },
114    unique_host_soname: true,
115}
116
117cc_binary {
118    name: "curl",
119    defaults: ["curl_common_defaults"],
120    srcs: [
121        "lib/base64.c",
122        "lib/curl_get_line.c",
123        "lib/dynbuf.c",
124        "src/*.c",
125    ],
126    exclude_srcs: ["src/tool_hugehelp.c"],
127    shared_libs: [
128        "libcrypto",
129        "libssl",
130        "libz",
131    ],
132    static_libs: ["libcurl"],
133}
134