blob: 111374c5e7f6d929f19a5308985b927af2d96432 [file] [log] [blame]
Kinson Chika8fa74c2011-07-29 11:33:41 -07001LOCAL_PATH:= $(call my-dir)
2
3arm_cflags := -DOPENSSL_BN_ASM_MONT -DAES_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM
4arm_src_files := \
5 aes/asm/aes-armv4.s \
6 bn/asm/armv4-mont.s \
7 sha/asm/sha1-armv4-large.s \
8 sha/asm/sha256-armv4.s \
9 sha/asm/sha512-armv4.s
10non_arm_src_files := aes/aes_core.c
11
12local_src_files := \
13 cryptlib.c \
14 mem.c \
15 mem_clr.c \
16 mem_dbg.c \
17 cversion.c \
18 ex_data.c \
19 cpt_err.c \
20 ebcdic.c \
21 uid.c \
22 o_time.c \
23 o_str.c \
24 o_dir.c \
25 aes/aes_cbc.c \
26 aes/aes_cfb.c \
27 aes/aes_ctr.c \
28 aes/aes_ecb.c \
29 aes/aes_misc.c \
30 aes/aes_ofb.c \
31 aes/aes_wrap.c \
32 asn1/a_bitstr.c \
33 asn1/a_bool.c \
34 asn1/a_bytes.c \
35 asn1/a_d2i_fp.c \
36 asn1/a_digest.c \
37 asn1/a_dup.c \
38 asn1/a_enum.c \
39 asn1/a_gentm.c \
40 asn1/a_i2d_fp.c \
41 asn1/a_int.c \
42 asn1/a_mbstr.c \
43 asn1/a_object.c \
44 asn1/a_octet.c \
45 asn1/a_print.c \
46 asn1/a_set.c \
47 asn1/a_sign.c \
48 asn1/a_strex.c \
49 asn1/a_strnid.c \
50 asn1/a_time.c \
51 asn1/a_type.c \
52 asn1/a_utctm.c \
53 asn1/a_utf8.c \
54 asn1/a_verify.c \
55 asn1/ameth_lib.c \
56 asn1/asn1_err.c \
57 asn1/asn1_gen.c \
58 asn1/asn1_lib.c \
59 asn1/asn1_par.c \
60 asn1/asn_mime.c \
61 asn1/asn_moid.c \
62 asn1/asn_pack.c \
63 asn1/bio_asn1.c \
64 asn1/bio_ndef.c \
65 asn1/d2i_pr.c \
66 asn1/d2i_pu.c \
67 asn1/evp_asn1.c \
68 asn1/f_enum.c \
69 asn1/f_int.c \
70 asn1/f_string.c \
71 asn1/i2d_pr.c \
72 asn1/i2d_pu.c \
73 asn1/n_pkey.c \
74 asn1/nsseq.c \
75 asn1/p5_pbe.c \
76 asn1/p5_pbev2.c \
77 asn1/p8_pkey.c \
78 asn1/t_bitst.c \
79 asn1/t_crl.c \
80 asn1/t_pkey.c \
81 asn1/t_req.c \
82 asn1/t_spki.c \
83 asn1/t_x509.c \
84 asn1/t_x509a.c \
85 asn1/tasn_dec.c \
86 asn1/tasn_enc.c \
87 asn1/tasn_fre.c \
88 asn1/tasn_new.c \
89 asn1/tasn_prn.c \
90 asn1/tasn_typ.c \
91 asn1/tasn_utl.c \
92 asn1/x_algor.c \
93 asn1/x_attrib.c \
94 asn1/x_bignum.c \
95 asn1/x_crl.c \
96 asn1/x_exten.c \
97 asn1/x_info.c \
98 asn1/x_long.c \
99 asn1/x_name.c \
100 asn1/x_nx509.c \
101 asn1/x_pkey.c \
102 asn1/x_pubkey.c \
103 asn1/x_req.c \
104 asn1/x_sig.c \
105 asn1/x_spki.c \
106 asn1/x_val.c \
107 asn1/x_x509.c \
108 asn1/x_x509a.c \
109 bf/bf_cfb64.c \
110 bf/bf_ecb.c \
111 bf/bf_enc.c \
112 bf/bf_ofb64.c \
113 bf/bf_skey.c \
114 bio/b_dump.c \
115 bio/b_print.c \
116 bio/b_sock.c \
117 bio/bf_buff.c \
118 bio/bf_nbio.c \
119 bio/bf_null.c \
120 bio/bio_cb.c \
121 bio/bio_err.c \
122 bio/bio_lib.c \
123 bio/bss_acpt.c \
124 bio/bss_bio.c \
125 bio/bss_conn.c \
126 bio/bss_dgram.c \
127 bio/bss_fd.c \
128 bio/bss_file.c \
129 bio/bss_log.c \
130 bio/bss_mem.c \
131 bio/bss_null.c \
132 bio/bss_sock.c \
133 bn/bn_add.c \
134 bn/bn_asm.c \
135 bn/bn_blind.c \
136 bn/bn_ctx.c \
137 bn/bn_div.c \
138 bn/bn_err.c \
139 bn/bn_exp.c \
140 bn/bn_exp2.c \
141 bn/bn_gcd.c \
142 bn/bn_gf2m.c \
143 bn/bn_kron.c \
144 bn/bn_lib.c \
145 bn/bn_mod.c \
146 bn/bn_mont.c \
147 bn/bn_mpi.c \
148 bn/bn_mul.c \
149 bn/bn_nist.c \
150 bn/bn_prime.c \
151 bn/bn_print.c \
152 bn/bn_rand.c \
153 bn/bn_recp.c \
154 bn/bn_shift.c \
155 bn/bn_sqr.c \
156 bn/bn_sqrt.c \
157 bn/bn_word.c \
158 buffer/buf_err.c \
159 buffer/buffer.c \
160 comp/c_rle.c \
161 comp/c_zlib.c \
162 comp/comp_err.c \
163 comp/comp_lib.c \
164 conf/conf_api.c \
165 conf/conf_def.c \
166 conf/conf_err.c \
167 conf/conf_lib.c \
168 conf/conf_mall.c \
169 conf/conf_mod.c \
170 conf/conf_sap.c \
171 des/cbc_cksm.c \
172 des/cbc_enc.c \
173 des/cfb64ede.c \
174 des/cfb64enc.c \
175 des/cfb_enc.c \
176 des/des_enc.c \
177 des/des_old.c \
178 des/des_old2.c \
179 des/ecb3_enc.c \
180 des/ecb_enc.c \
181 des/ede_cbcm_enc.c \
182 des/enc_read.c \
183 des/enc_writ.c \
184 des/fcrypt.c \
185 des/fcrypt_b.c \
186 des/ofb64ede.c \
187 des/ofb64enc.c \
188 des/ofb_enc.c \
189 des/pcbc_enc.c \
190 des/qud_cksm.c \
191 des/rand_key.c \
192 des/read2pwd.c \
193 des/rpc_enc.c \
194 des/set_key.c \
195 des/str2key.c \
196 des/xcbc_enc.c \
197 dh/dh_ameth.c \
198 dh/dh_asn1.c \
199 dh/dh_check.c \
200 dh/dh_depr.c \
201 dh/dh_err.c \
202 dh/dh_gen.c \
203 dh/dh_key.c \
204 dh/dh_lib.c \
205 dh/dh_pmeth.c \
206 dsa/dsa_ameth.c \
207 dsa/dsa_asn1.c \
208 dsa/dsa_depr.c \
209 dsa/dsa_err.c \
210 dsa/dsa_gen.c \
211 dsa/dsa_key.c \
212 dsa/dsa_lib.c \
213 dsa/dsa_ossl.c \
214 dsa/dsa_pmeth.c \
215 dsa/dsa_prn.c \
216 dsa/dsa_sign.c \
217 dsa/dsa_vrf.c \
218 dso/dso_dl.c \
219 dso/dso_dlfcn.c \
220 dso/dso_err.c \
221 dso/dso_lib.c \
222 dso/dso_null.c \
223 dso/dso_openssl.c \
224 dso/dso_vms.c \
225 dso/dso_win32.c \
226 ec/ec2_mult.c \
227 ec/ec2_smpl.c \
228 ec/ec_ameth.c \
229 ec/ec_asn1.c \
230 ec/ec_check.c \
231 ec/ec_curve.c \
232 ec/ec_cvt.c \
233 ec/ec_err.c \
234 ec/ec_key.c \
235 ec/ec_lib.c \
236 ec/ec_mult.c \
237 ec/ec_pmeth.c \
238 ec/ec_print.c \
239 ec/eck_prn.c \
240 ec/ecp_mont.c \
241 ec/ecp_nist.c \
242 ec/ecp_smpl.c \
243 ecdh/ech_err.c \
244 ecdh/ech_key.c \
245 ecdh/ech_lib.c \
246 ecdh/ech_ossl.c \
247 ecdsa/ecs_asn1.c \
248 ecdsa/ecs_err.c \
249 ecdsa/ecs_lib.c \
250 ecdsa/ecs_ossl.c \
251 ecdsa/ecs_sign.c \
252 ecdsa/ecs_vrf.c \
253 err/err.c \
254 err/err_all.c \
255 err/err_prn.c \
256 evp/bio_b64.c \
257 evp/bio_enc.c \
258 evp/bio_md.c \
259 evp/bio_ok.c \
260 evp/c_all.c \
261 evp/c_allc.c \
262 evp/c_alld.c \
263 evp/digest.c \
264 evp/e_aes.c \
265 evp/e_bf.c \
266 evp/e_des.c \
267 evp/e_des3.c \
268 evp/e_null.c \
269 evp/e_old.c \
270 evp/e_rc2.c \
271 evp/e_rc4.c \
272 evp/e_rc5.c \
273 evp/e_xcbc_d.c \
274 evp/encode.c \
275 evp/evp_acnf.c \
276 evp/evp_enc.c \
277 evp/evp_err.c \
278 evp/evp_key.c \
279 evp/evp_lib.c \
280 evp/evp_pbe.c \
281 evp/evp_pkey.c \
282 evp/m_dss.c \
283 evp/m_dss1.c \
284 evp/m_ecdsa.c \
285 evp/m_md4.c \
286 evp/m_md5.c \
287 evp/m_mdc2.c \
288 evp/m_null.c \
289 evp/m_ripemd.c \
290 evp/m_sha1.c \
291 evp/m_sigver.c \
292 evp/m_wp.c \
293 evp/names.c \
294 evp/p5_crpt.c \
295 evp/p5_crpt2.c \
296 evp/p_dec.c \
297 evp/p_enc.c \
298 evp/p_lib.c \
299 evp/p_open.c \
300 evp/p_seal.c \
301 evp/p_sign.c \
302 evp/p_verify.c \
303 evp/pmeth_fn.c \
304 evp/pmeth_gn.c \
305 evp/pmeth_lib.c \
306 hmac/hm_ameth.c \
307 hmac/hm_pmeth.c \
308 hmac/hmac.c \
309 krb5/krb5_asn.c \
310 lhash/lh_stats.c \
311 lhash/lhash.c \
312 md4/md4_dgst.c \
313 md4/md4_one.c \
314 md5/md5_dgst.c \
315 md5/md5_one.c \
316 modes/cbc128.c \
317 modes/cfb128.c \
318 modes/ctr128.c \
319 modes/ofb128.c \
320 objects/o_names.c \
321 objects/obj_dat.c \
322 objects/obj_err.c \
323 objects/obj_lib.c \
324 objects/obj_xref.c \
325 ocsp/ocsp_asn.c \
326 ocsp/ocsp_cl.c \
327 ocsp/ocsp_err.c \
328 ocsp/ocsp_ext.c \
329 ocsp/ocsp_ht.c \
330 ocsp/ocsp_lib.c \
331 ocsp/ocsp_prn.c \
332 ocsp/ocsp_srv.c \
333 ocsp/ocsp_vfy.c \
334 pem/pem_all.c \
335 pem/pem_err.c \
336 pem/pem_info.c \
337 pem/pem_lib.c \
338 pem/pem_oth.c \
339 pem/pem_pk8.c \
340 pem/pem_pkey.c \
341 pem/pem_seal.c \
342 pem/pem_sign.c \
343 pem/pem_x509.c \
344 pem/pem_xaux.c \
345 pem/pvkfmt.c \
346 pkcs12/p12_add.c \
347 pkcs12/p12_asn.c \
348 pkcs12/p12_attr.c \
349 pkcs12/p12_crpt.c \
350 pkcs12/p12_crt.c \
351 pkcs12/p12_decr.c \
352 pkcs12/p12_init.c \
353 pkcs12/p12_key.c \
354 pkcs12/p12_kiss.c \
355 pkcs12/p12_mutl.c \
356 pkcs12/p12_npas.c \
357 pkcs12/p12_p8d.c \
358 pkcs12/p12_p8e.c \
359 pkcs12/p12_utl.c \
360 pkcs12/pk12err.c \
361 pkcs7/pk7_asn1.c \
362 pkcs7/pk7_attr.c \
363 pkcs7/pk7_doit.c \
364 pkcs7/pk7_lib.c \
365 pkcs7/pk7_mime.c \
366 pkcs7/pk7_smime.c \
367 pkcs7/pkcs7err.c \
368 rand/md_rand.c \
369 rand/rand_egd.c \
370 rand/rand_err.c \
371 rand/rand_lib.c \
372 rand/rand_unix.c \
373 rand/randfile.c \
374 rc2/rc2_cbc.c \
375 rc2/rc2_ecb.c \
376 rc2/rc2_skey.c \
377 rc2/rc2cfb64.c \
378 rc2/rc2ofb64.c \
379 rc4/rc4_enc.c \
380 rc4/rc4_skey.c \
381 ripemd/rmd_dgst.c \
382 ripemd/rmd_one.c \
383 rsa/rsa_ameth.c \
384 rsa/rsa_asn1.c \
385 rsa/rsa_chk.c \
386 rsa/rsa_eay.c \
387 rsa/rsa_err.c \
388 rsa/rsa_gen.c \
389 rsa/rsa_lib.c \
390 rsa/rsa_none.c \
391 rsa/rsa_null.c \
392 rsa/rsa_oaep.c \
393 rsa/rsa_pk1.c \
394 rsa/rsa_pmeth.c \
395 rsa/rsa_prn.c \
396 rsa/rsa_pss.c \
397 rsa/rsa_saos.c \
398 rsa/rsa_sign.c \
399 rsa/rsa_ssl.c \
400 rsa/rsa_x931.c \
401 sha/sha1_one.c \
402 sha/sha1dgst.c \
403 sha/sha256.c \
404 sha/sha512.c \
405 sha/sha_dgst.c \
406 stack/stack.c \
407 ts/ts_err.c \
408 txt_db/txt_db.c \
409 ui/ui_compat.c \
410 ui/ui_err.c \
411 ui/ui_lib.c \
412 ui/ui_openssl.c \
413 ui/ui_util.c \
414 x509/by_dir.c \
415 x509/by_file.c \
416 x509/x509_att.c \
417 x509/x509_cmp.c \
418 x509/x509_d2.c \
419 x509/x509_def.c \
420 x509/x509_err.c \
421 x509/x509_ext.c \
422 x509/x509_lu.c \
423 x509/x509_obj.c \
424 x509/x509_r2x.c \
425 x509/x509_req.c \
426 x509/x509_set.c \
427 x509/x509_trs.c \
428 x509/x509_txt.c \
429 x509/x509_v3.c \
430 x509/x509_vfy.c \
431 x509/x509_vpm.c \
432 x509/x509cset.c \
433 x509/x509name.c \
434 x509/x509rset.c \
435 x509/x509spki.c \
436 x509/x509type.c \
437 x509/x_all.c \
438 x509v3/pcy_cache.c \
439 x509v3/pcy_data.c \
440 x509v3/pcy_lib.c \
441 x509v3/pcy_map.c \
442 x509v3/pcy_node.c \
443 x509v3/pcy_tree.c \
444 x509v3/v3_akey.c \
445 x509v3/v3_akeya.c \
446 x509v3/v3_alt.c \
447 x509v3/v3_bcons.c \
448 x509v3/v3_bitst.c \
449 x509v3/v3_conf.c \
450 x509v3/v3_cpols.c \
451 x509v3/v3_crld.c \
452 x509v3/v3_enum.c \
453 x509v3/v3_extku.c \
454 x509v3/v3_genn.c \
455 x509v3/v3_ia5.c \
456 x509v3/v3_info.c \
457 x509v3/v3_int.c \
458 x509v3/v3_lib.c \
459 x509v3/v3_ncons.c \
460 x509v3/v3_ocsp.c \
461 x509v3/v3_pci.c \
462 x509v3/v3_pcia.c \
463 x509v3/v3_pcons.c \
464 x509v3/v3_pku.c \
465 x509v3/v3_pmaps.c \
466 x509v3/v3_prn.c \
467 x509v3/v3_purp.c \
468 x509v3/v3_skey.c \
469 x509v3/v3_sxnet.c \
470 x509v3/v3_utl.c \
471 x509v3/v3err.c
472
473local_c_includes := \
474 external/openssl \
475 external/openssl/crypto/asn1 \
476 external/openssl/crypto/evp \
477 external/openssl/include \
478 external/openssl/include/openssl \
479 external/zlib
480
481local_c_flags := -DNO_WINDOWS_BRAINDEATH
482
483#######################################
484
485# target
486include $(CLEAR_VARS)
487include $(LOCAL_PATH)/../android-config.mk
488LOCAL_SRC_FILES += $(local_src_files)
489LOCAL_CFLAGS += $(local_c_flags)
490LOCAL_C_INCLUDES += $(local_c_includes)
491LOCAL_SHARED_LIBRARIES += libz
492ifeq ($(TARGET_ARCH),arm)
493 LOCAL_SRC_FILES += $(arm_src_files)
494 LOCAL_CFLAGS += $(arm_cflags)
495else
496 LOCAL_SRC_FILES += $(non_arm_src_files)
497endif
498ifeq ($(TARGET_SIMULATOR),true)
499 # Make valgrind happy.
500 LOCAL_CFLAGS += -DPURIFY
501 LOCAL_LDLIBS += -ldl
502else
503 LOCAL_SHARED_LIBRARIES += libdl
504endif
505LOCAL_MODULE_TAGS := optional
506LOCAL_MODULE:= libcrypto
507include $(BUILD_SHARED_LIBRARY)
508
509#######################################
510# host shared library
511ifeq ($(WITH_HOST_DALVIK),true)
512 include $(CLEAR_VARS)
513 include $(LOCAL_PATH)/../android-config.mk
514 LOCAL_SRC_FILES += $(local_src_files)
515 LOCAL_CFLAGS += $(local_c_flags) -DPURIFY
516 LOCAL_C_INCLUDES += $(local_c_includes)
517 LOCAL_SRC_FILES += $(non_arm_src_files)
518 LOCAL_STATIC_LIBRARIES += libz
519 LOCAL_LDLIBS += -ldl
520 LOCAL_MODULE_TAGS := optional
521 LOCAL_MODULE:= libcrypto
522 include $(BUILD_HOST_SHARED_LIBRARY)
523endif
524
525########################################
526# host static library, which is used by some SDK tools.
527
528include $(CLEAR_VARS)
529include $(LOCAL_PATH)/../android-config.mk
530LOCAL_SRC_FILES += $(local_src_files)
531LOCAL_CFLAGS += $(local_c_flags) -DPURIFY
532LOCAL_C_INCLUDES += $(local_c_includes)
533LOCAL_SRC_FILES += $(non_arm_src_files)
534LOCAL_STATIC_LIBRARIES += libz
535LOCAL_LDLIBS += -ldl
536LOCAL_MODULE_TAGS := optional
537LOCAL_MODULE:= libcrypto_static
538include $(BUILD_HOST_STATIC_LIBRARY)