1cc_defaults {
2    name: "curl_common_defaults",
3    cflags: [
4        "-Wpointer-arith",
5        "-Wwrite-strings",
6        "-Wunused",
7        "-Winline",
8        "-Wnested-externs",
9        "-Wmissing-declarations",
10        "-Wmissing-prototypes",
11        "-Wno-long-long",
12        "-Wfloat-equal",
13        "-Wno-multichar",
14        "-Wno-sign-compare",
15        "-Wno-format-nonliteral",
16        "-Wendif-labels",
17        "-Wstrict-prototypes",
18        "-Wdeclaration-after-statement",
19        "-Wno-system-headers",
20        "-DHAVE_CONFIG_H",
21        // TODO(avakulenko): Android.mk had this for OS version string:
22        // "Android $(PLATFORM_VERSION) $(TARGET_ARCH_VARIANT)"
23        // but Soong doesn't have access to those config variables yet.
24        "-DOS=\"Android\"",
25        "-Werror",
26        // Bug: http://b/29823425 Disable -Wvarargs for Clang update to r271374
27        "-Wno-varargs",
28    ],
29    local_include_dirs: ["include", "lib"],
30    multilib: {
31        lib32: {
32            cflags: [
33                "-DSIZEOF_LONG=4",
34                "-DSIZEOF_LONG_LONG=8",
35                "-DSIZEOF_SIZE_T=4",
36                "-DSIZEOF_TIME_T=4",
37            ],
38        },
39        lib64: {
40            cflags: [
41                "-DSIZEOF_LONG=8",
42                "-DSIZEOF_LONG_LONG=8",
43                "-DSIZEOF_SIZE_T=8",
44                "-DSIZEOF_TIME_T=8",
45            ],
46        },
47    },
48}
49
50cc_library {
51    name: "libcurl",
52    vendor_available: true,
53    vndk: {
54        enabled: true,
55    },
56    defaults: ["curl_common_defaults"],
57    export_include_dirs: ["include"],
58    host_supported: true,
59    cflags: [
60        "-DBUILDING_LIBCURL",
61    ],
62    srcs:[
63        "lib/rand.c",
64        "lib/file.c",
65        "lib/timeval.c",
66        "lib/base64.c",
67        "lib/hostip.c",
68        "lib/progress.c",
69        "lib/formdata.c",
70        "lib/cookie.c",
71        "lib/http.c",
72        "lib/sendf.c",
73        "lib/ftp.c",
74        "lib/url.c",
75        "lib/dict.c",
76        "lib/if2ip.c",
77        "lib/speedcheck.c",
78        "lib/ldap.c",
79        "lib/version.c",
80        "lib/getenv.c",
81        "lib/escape.c",
82        "lib/mprintf.c",
83        "lib/telnet.c",
84        "lib/netrc.c",
85        "lib/getinfo.c",
86        "lib/transfer.c",
87        "lib/easy.c",
88        "lib/security.c",
89        "lib/curl_fnmatch.c",
90        "lib/fileinfo.c",
91        "lib/ftplistparser.c",
92        "lib/wildcard.c",
93        "lib/krb5.c",
94        "lib/memdebug.c",
95        "lib/http_chunks.c",
96        "lib/strtok.c",
97        "lib/connect.c",
98        "lib/llist.c",
99        "lib/hash.c",
100        "lib/multi.c",
101        "lib/content_encoding.c",
102        "lib/share.c",
103        "lib/http_digest.c",
104        "lib/md4.c",
105        "lib/md5.c",
106        "lib/http_negotiate.c",
107        "lib/inet_pton.c",
108        "lib/strtoofft.c",
109        "lib/strerror.c",
110        "lib/amigaos.c",
111        "lib/hostasyn.c",
112        "lib/hostip4.c",
113        "lib/hostip6.c",
114        "lib/hostsyn.c",
115        "lib/inet_ntop.c",
116        "lib/parsedate.c",
117        "lib/select.c",
118        "lib/tftp.c",
119        "lib/splay.c",
120        "lib/strcase.c",
121        "lib/strdup.c",
122        "lib/socks.c",
123        "lib/ssh.c",
124        "lib/curl_addrinfo.c",
125        "lib/socks_gssapi.c",
126        "lib/socks_sspi.c",
127        "lib/curl_sspi.c",
128        "lib/slist.c",
129        "lib/nonblock.c",
130        "lib/curl_memrchr.c",
131        "lib/imap.c",
132        "lib/pop3.c",
133        "lib/smtp.c",
134        "lib/pingpong.c",
135        "lib/rtsp.c",
136        "lib/curl_threads.c",
137        "lib/warnless.c",
138        "lib/hmac.c",
139        "lib/curl_rtmp.c",
140        "lib/openldap.c",
141        "lib/curl_gethostname.c",
142        "lib/gopher.c",
143        "lib/idn_win32.c",
144        "lib/http_proxy.c",
145        "lib/non-ascii.c",
146        "lib/asyn-ares.c",
147        "lib/asyn-thread.c",
148        "lib/curl_gssapi.c",
149        "lib/http_ntlm.c",
150        "lib/curl_ntlm_wb.c",
151        "lib/curl_ntlm_core.c",
152        "lib/curl_sasl.c",
153        "lib/curl_multibyte.c",
154        "lib/hostcheck.c",
155        "lib/conncache.c",
156        "lib/pipeline.c",
157        "lib/dotdot.c",
158        "lib/x509asn1.c",
159        "lib/http2.c",
160        "lib/smb.c",
161        "lib/curl_endian.c",
162        "lib/curl_des.c",
163        "lib/system_win32.c",
164        "lib/mime.c",
165        "lib/sha256.c",
166        "lib/setopt.c",
167        "lib/vauth/vauth.c",
168        "lib/vauth/cleartext.c",
169        "lib/vauth/cram.c",
170        "lib/vauth/digest.c",
171        "lib/vauth/digest_sspi.c",
172        "lib/vauth/krb5_gssapi.c",
173        "lib/vauth/krb5_sspi.c",
174        "lib/vauth/ntlm.c",
175        "lib/vauth/ntlm_sspi.c",
176        "lib/vauth/oauth2.c",
177        "lib/vauth/spnego_gssapi.c",
178        "lib/vauth/spnego_sspi.c",
179        "lib/vtls/openssl.c",
180        "lib/vtls/gtls.c",
181        "lib/vtls/vtls.c",
182        "lib/vtls/nss.c",
183        "lib/vtls/polarssl.c",
184        "lib/vtls/polarssl_threadlock.c",
185        "lib/vtls/axtls.c",
186        "lib/vtls/cyassl.c",
187        "lib/vtls/schannel.c",
188        "lib/vtls/darwinssl.c",
189        "lib/vtls/gskit.c",
190        "lib/vtls/mbedtls.c",
191    ],
192    shared_libs: [
193        "libcrypto",
194        "libssl",
195        "libz",
196    ],
197    target: {
198        host: {
199            cflags: ["-D_GNU_SOURCE=1"],
200        },
201        darwin: {
202            enabled: false,
203        },
204    },
205    unique_host_soname: true,
206}
207
208cc_binary {
209    name: "curl",
210    defaults: ["curl_common_defaults"],
211    srcs: [
212        "src/slist_wc.c",
213        "src/tool_binmode.c",
214        "src/tool_bname.c",
215        "src/tool_cb_dbg.c",
216        "src/tool_cb_hdr.c",
217        "src/tool_cb_prg.c",
218        "src/tool_cb_rea.c",
219        "src/tool_cb_see.c",
220        "src/tool_cb_wrt.c",
221        "src/tool_cfgable.c",
222        "src/tool_convert.c",
223        "src/tool_dirhie.c",
224        "src/tool_doswin.c",
225        "src/tool_easysrc.c",
226        "src/tool_formparse.c",
227        "src/tool_getparam.c",
228        "src/tool_getpass.c",
229        "src/tool_help.c",
230        "src/tool_helpers.c",
231        "src/tool_homedir.c",
232        "src/tool_hugehelp.c",
233        "src/tool_libinfo.c",
234        "src/tool_main.c",
235        "src/tool_metalink.c",
236        "src/tool_msgs.c",
237        "src/tool_operate.c",
238        "src/tool_operhlp.c",
239        "src/tool_panykey.c",
240        "src/tool_paramhlp.c",
241        "src/tool_parsecfg.c",
242        "src/tool_strdup.c",
243        "src/tool_setopt.c",
244        "src/tool_sleep.c",
245        "src/tool_urlglob.c",
246        "src/tool_util.c",
247        "src/tool_vms.c",
248        "src/tool_writeout.c",
249        "src/tool_xattr.c",
250    ],
251    shared_libs: [
252        "libcrypto",
253        "libssl",
254        "libz",
255    ],
256    static_libs: ["libcurl"],
257}
258