Add private versions of libcrypto and libssl (LibreSSL v2.4.2)
[dragonfly.git] / secure / lib / librecrypto / Makefile
1 # This version of libcrypto is from LibreSSL
2 .include "Makefile.inc"
3
4 LIB=            private_crypto
5 SHLIB_MAJOR=    38
6 SHLIBDIR?=      /lib/priv
7 LIBDIR?=        /usr/lib/priv
8 PROFLIBDIR?=    /usr/lib/priv/profile
9 WARNS?=         2
10
11 INCS+=          aes.h asn1.h asn1_mac.h asn1t.h
12 INCS+=          bio.h blowfish.h bn.h buffer.h
13 INCS+=          camellia.h cast.h chacha.h cmac.h cms.h comp.h conf.h conf_api.h crypto.h
14 INCS+=          des.h dh.h dsa.h dso.h
15 INCS+=          ec.h ecdh.h ecdsa.h engine.h err.h evp.h
16 INCS+=          gost.h hmac.h idea.h krb5_asn.h lhash.h
17 INCS+=          md4.h md5.h modes.h
18 INCS+=          obj_mac.h objects.h ocsp.h opensslconf.h opensslfeatures.h opensslv.h ossl_typ.h
19 INCS+=          pem.h pem2.h pkcs12.h pkcs7.h poly1305.h
20 INCS+=          rand.h rc2.h rc4.h ripemd.h rsa.h
21 INCS+=          safestack.h sha.h stack.h
22 INCS+=          ts.h txt_db.h ui.h ui_compat.h
23 INCS+=          whrlpool.h x509.h x509_vfy.h x509v3.h
24 INCSDIR=        ${INCLUDEDIR}/priv/openssl
25
26 CFLAGS+=        -I${LCRYPTO_SRC}/modes -I${LCRYPTO_SRC}/asn1 -I${LCRYPTO_SRC}/evp -I${.OBJDIR}
27
28 CFLAGS+=        -DAES_ASM \
29                 -DBSAES_ASM \
30                 -DVPAES_ASM \
31                 -DOPENSSL_IA32_SSE2 \
32                 -DOPENSSL_BN_ASM_MONT \
33                 -DOPENSSL_BN_ASM_MONT5 \
34                 -DOPENSSL_BN_ASM_GF2m \
35                 -DMD5_ASM \
36                 -DGHASH_ASM \
37                 -DRSA_ASM \
38                 -DSHA1_ASM \
39                 -DSHA256_ASM \
40                 -DSHA512_ASM \
41                 -DWHIRLPOOL_ASM \
42                 -DOPENSSL_CPUID_OBJ
43
44 FLAGS_GROUPS=           bzero
45 bzero_FLAGS=            -O0
46 bzero_FLAGS_FILES=      explicit_bzero.c
47
48 # Vendor ASM_X86_64_ELF definition with directories stripped off and
49 # rearranged one per row
50 ASM_X86_64_ELF= aes-elf-x86_64.s \
51                 bsaes-elf-x86_64.s \
52                 vpaes-elf-x86_64.s \
53                 aesni-elf-x86_64.s \
54                 aesni-sha1-elf-x86_64.s \
55                 modexp512-elf-x86_64.s \
56                 mont-elf-x86_64.s \
57                 mont5-elf-x86_64.s \
58                 gf2m-elf-x86_64.s \
59                 cmll-elf-x86_64.s \
60                 md5-elf-x86_64.s \
61                 ghash-elf-x86_64.s \
62                 rc4-elf-x86_64.s \
63                 rc4-md5-elf-x86_64.s \
64                 sha1-elf-x86_64.s \
65                 sha256-elf-x86_64.S \
66                 sha512-elf-x86_64.S \
67                 wp-elf-x86_64.s \
68                 cpuid-elf-x86_64.S
69
70 # Based on vendor libcrypto_la_SOURCES definitions with subdirectories stripped out
71
72 SRC_TOP=        cpt_err.c cryptlib.c cversion.c ex_data.c malloc-wrapper.c \
73                 mem_clr.c mem_dbg.c o_init.c o_str.c o_time.c
74 SRC_AES=        aes_cfb.c aes_ctr.c aes_ecb.c aes_ige.c aes_misc.c aes_ofb.c \
75                 aes_wrap.c
76 SRC_ASN1=       a_bitstr.c a_bool.c a_bytes.c a_d2i_fp.c a_digest.c a_dup.c \
77                 a_enum.c a_i2d_fp.c a_int.c a_mbstr.c a_object.c a_octet.c \
78                 a_print.c a_set.c a_sign.c a_strex.c a_strnid.c a_time.c \
79                 a_time_tm.c a_type.c a_utf8.c a_verify.c ameth_lib.c \
80                 asn1_err.c asn1_gen.c asn1_lib.c asn1_par.c asn_mime.c \
81                 asn_moid.c asn_pack.c bio_asn1.c bio_ndef.c d2i_pr.c d2i_pu.c \
82                 evp_asn1.c f_enum.c f_int.c f_string.c i2d_pr.c i2d_pu.c \
83                 n_pkey.c nsseq.c p5_pbe.c p5_pbev2.c p8_pkey.c t_bitst.c \
84                 t_crl.c t_pkey.c t_req.c t_spki.c t_x509.c t_x509a.c \
85                 tasn_dec.c tasn_enc.c tasn_fre.c tasn_new.c tasn_prn.c \
86                 tasn_typ.c tasn_utl.c x_algor.c x_attrib.c x_bignum.c \
87                 x_crl.c x_exten.c x_info.c x_long.c x_name.c x_nx509.c \
88                 x_pkey.c x_pubkey.c x_req.c x_sig.c x_spki.c x_val.c x_x509.c \
89                 x_x509a.c
90 SRC_BF=         bf_cfb64.c bf_ecb.c bf_enc.c bf_ofb64.c bf_skey.c
91 SRC_BIO=        b_dump.c b_posix.c b_print.c b_sock.c bf_buff.c bf_nbio.c \
92                 bf_null.c bio_cb.c bio_err.c bio_lib.c bss_acpt.c bss_bio.c \
93                 bss_conn.c bss_dgram.c bss_fd.c bss_file.c bss_log.c \
94                 bss_mem.c bss_null.c bss_sock.c
95 SRC_BN=         bn_add.c bn_asm.c bn_blind.c bn_const.c bn_ctx.c bn_depr.c \
96                 bn_div.c bn_err.c bn_exp.c bn_exp2.c bn_gcd.c bn_gf2m.c \
97                 bn_kron.c bn_lib.c bn_mod.c bn_mont.c bn_mpi.c bn_mul.c \
98                 bn_nist.c bn_prime.c bn_print.c bn_rand.c bn_recp.c \
99                 bn_shift.c bn_sqr.c bn_sqrt.c bn_word.c bn_x931p.c
100 SRC_BUFFER=     buf_err.c buf_str.c buffer.c
101 SRC_CAMELLIA=   cmll_cfb.c cmll_ctr.c cmll_ecb.c cmll_misc.c cmll_ofb.c
102 SRC_CAST=       c_cfb64.c c_ecb.c c_enc.c c_ofb64.c c_skey.c
103 SRC_CHACHA=     chacha.c
104 SRC_CMAC=       cm_ameth.c cm_pmeth.c cmac.c
105 SRC_COMP=       c_rle.c c_zlib.c
106 SRC_CONF=       comp_err.c comp_lib.c conf_api.c conf_def.c \
107                 conf_err.c conf_lib.c conf_mall.c conf_mod.c conf_sap.c
108 SRC_DES=        cbc_cksm.c cbc_enc.c cfb64ede.c cfb64enc.c cfb_enc.c \
109                 des_enc.c ecb3_enc.c ecb_enc.c ede_cbcm_enc.c enc_read.c \
110                 enc_writ.c fcrypt.c fcrypt_b.c ofb64ede.c ofb64enc.c \
111                 ofb_enc.c pcbc_enc.c qud_cksm.c rand_key.c set_key.c \
112                 str2key.c xcbc_enc.c
113 SRC_DH=         dh_ameth.c dh_asn1.c dh_check.c dh_depr.c dh_err.c dh_gen.c \
114                 dh_key.c dh_lib.c dh_pmeth.c dh_prn.c
115 SRC_DSA=        dsa_ameth.c dsa_asn1.c dsa_depr.c dsa_err.c dsa_gen.c \
116                 dsa_key.c dsa_lib.c dsa_ossl.c dsa_pmeth.c dsa_prn.c \
117                 dsa_sign.c dsa_vrf.c
118 SRC_DSO=        dso_dlfcn.c dso_err.c dso_lib.c dso_null.c dso_openssl.c
119 SRC_EC=         ec2_mult.c ec2_oct.c ec2_smpl.c ec_ameth.c ec_asn1.c \
120                 ec_check.c ec_curve.c ec_cvt.c ec_err.c ec_key.c ec_lib.c \
121                 ec_mult.c ec_oct.c ec_pmeth.c ec_print.c eck_prn.c ecp_mont.c \
122                 ecp_nist.c ecp_oct.c ecp_smpl.c
123 SRC_ECDH=       ech_err.c ech_key.c ech_lib.c
124 SRC_ECDSA=      ecs_asn1.c ecs_err.c ecs_lib.c ecs_ossl.c ecs_sign.c ecs_vrf.c
125 SRC_ENGINE=     eng_all.c eng_cnf.c eng_ctrl.c eng_dyn.c eng_err.c eng_fat.c \
126                 eng_init.c eng_lib.c eng_list.c eng_openssl.c eng_pkey.c \
127                 eng_table.c tb_asnmth.c tb_cipher.c tb_dh.c tb_digest.c \
128                 tb_dsa.c tb_ecdh.c tb_ecdsa.c tb_pkmeth.c tb_rand.c \
129                 tb_rsa.c tb_store.c
130 SRC_ERR=        err.c err_all.c err_prn.c
131 SRC_EVP=        bio_b64.c bio_enc.c bio_md.c c_all.c digest.c e_aes.c \
132                 e_aes_cbc_hmac_sha1.c e_bf.c e_camellia.c e_cast.c e_chacha.c \
133                 e_chacha20poly1305.c e_des.c e_des3.c e_gost2814789.c \
134                 e_idea.c e_null.c e_old.c e_rc2.c e_rc4.c e_rc4_hmac_md5.c \
135                 e_xcbc_d.c encode.c evp_aead.c evp_enc.c evp_err.c evp_key.c \
136                 evp_lib.c evp_pbe.c evp_pkey.c m_dss.c m_dss1.c m_ecdsa.c \
137                 m_gost2814789.c m_gostr341194.c m_md4.c m_md5.c m_null.c \
138                 m_ripemd.c m_sha1.c m_sigver.c m_streebog.c m_wp.c names.c \
139                 p5_crpt.c p5_crpt2.c p_dec.c p_enc.c p_lib.c p_open.c \
140                 p_seal.c p_sign.c p_verify.c pmeth_fn.c pmeth_gn.c \
141                 pmeth_lib.c
142 SRC_GOST=       gost2814789.c gost89_keywrap.c gost89_params.c gost89imit_ameth.c \
143                 gost89imit_pmeth.c gost_asn1.c gost_err.c gostr341001.c \
144                 gostr341001_ameth.c gostr341001_key.c gostr341001_params.c \
145                 gostr341001_pmeth.c gostr341194.c streebog.c
146 SRC_HMAC=       hm_ameth.c hm_pmeth.c hmac.c
147 SRC_IDEA=       i_cbc.c i_cfb64.c i_ecb.c i_ofb64.c i_skey.c
148 SRC_KRB5=       krb5_asn.c
149 SRC_LHASH=      lh_stats.c lhash.c
150 SRC_MD4=        md4_dgst.c md4_one.c
151 SRC_MD5=        md5_dgst.c md5_one.c
152 SRC_MODES=      cbc128.c ccm128.c cfb128.c ctr128.c cts128.c gcm128.c \
153                 ofb128.c xts128.c
154 SRC_OBJECTS=    o_names.c obj_dat.c obj_err.c obj_lib.c obj_xref.c
155 SRC_OCSP=       ocsp_asn.c ocsp_cl.c ocsp_err.c ocsp_ext.c ocsp_ht.c \
156                 ocsp_lib.c ocsp_prn.c ocsp_srv.c ocsp_vfy.c
157 SRC_PEM=        pem_all.c pem_err.c pem_info.c pem_lib.c pem_oth.c pem_pk8.c \
158                 pem_pkey.c pem_seal.c pem_sign.c pem_x509.c pem_xaux.c \
159                 pvkfmt.c
160 SRC_PKCS12=     p12_add.c p12_asn.c p12_attr.c p12_crpt.c p12_crt.c \
161                 p12_decr.c p12_init.c p12_key.c p12_kiss.c p12_mutl.c \
162                 p12_npas.c p12_p8d.c p12_p8e.c p12_utl.c pk12err.c
163 SRC_PKCS7=      bio_pk7.c pk7_asn1.c pk7_attr.c pk7_doit.c pk7_lib.c \
164                 pk7_mime.c pk7_smime.c pkcs7err.c
165 SRC_POLY1305=   poly1305.c
166 SRC_RAND=       rand_err.c rand_lib.c randfile.c
167 SRC_RC2=        rc2_cbc.c rc2_ecb.c rc2_skey.c rc2cfb64.c rc2ofb64.c
168 SRC_RIPEMD=     rmd_dgst.c rmd_one.c
169 SRC_RSA=        rsa_ameth.c rsa_asn1.c rsa_chk.c rsa_crpt.c rsa_depr.c \
170                 rsa_eay.c rsa_err.c rsa_gen.c rsa_lib.c rsa_none.c \
171                 rsa_oaep.c rsa_pk1.c rsa_pmeth.c rsa_prn.c rsa_pss.c \
172                 rsa_saos.c rsa_sign.c rsa_ssl.c rsa_x931.c
173 SRC_SHA=        sha1_one.c sha1dgst.c sha256.c sha512.c
174 SRC_STACK=      stack.c
175 SRC_TS=         ts_asn1.c ts_conf.c ts_err.c ts_lib.c ts_req_print.c \
176                 ts_req_utils.c ts_rsp_print.c ts_rsp_sign.c ts_rsp_utils.c \
177                 ts_rsp_verify.c ts_verify_ctx.c
178 SRC_TXT_DB=     txt_db.c
179 SRC_UI=         ui_err.c ui_lib.c ui_openssl.c ui_util.c
180 SRC_WHRLPOOL=   wp_dgst.c
181 SRC_X509=       by_dir.c by_file.c by_mem.c x509_att.c x509_cmp.c x509_d2.c \
182                 x509_def.c x509_err.c x509_ext.c x509_lu.c x509_obj.c \
183                 x509_r2x.c x509_req.c x509_set.c x509_trs.c x509_txt.c \
184                 x509_v3.c x509_vfy.c x509_vpm.c x509cset.c x509name.c \
185                 x509rset.c x509spki.c x509type.c x_all.c
186 SRC_X509V3=     pcy_cache.c pcy_data.c pcy_lib.c pcy_map.c pcy_node.c \
187                 pcy_tree.c v3_akey.c v3_akeya.c v3_alt.c v3_bcons.c \
188                 v3_bitst.c v3_conf.c v3_cpols.c v3_crld.c v3_enum.c \
189                 v3_extku.c v3_genn.c v3_ia5.c v3_info.c v3_int.c v3_lib.c \
190                 v3_ncons.c v3_ocsp.c v3_pci.c v3_pcia.c v3_pcons.c v3_pku.c \
191                 v3_pmaps.c v3_prn.c v3_purp.c v3_skey.c v3_sxnet.c v3_utl.c \
192                 v3err.c
193
194 SRCS=           ${ASM_X86_64_ELF} ${SRC_TOP} ${SRC_AES} ${SRC_ASN1} \
195                 ${SRC_BF} ${SRC_BIO} ${SRC_BN} ${SRC_BUFFER} ${SRC_CAMELLIA} \
196                 ${SRC_CAST} ${SRC_CHACHA} ${SRC_CMAC} ${SRC_COMP} \
197                 ${SRC_CONF} ${SRC_DES} ${SRC_DH} ${SRC_DSA} ${SRC_DSO} \
198                 ${SRC_EC} ${SRC_ECDH} ${SRC_ECDSA} ${SRC_ENGINE} ${SRC_ERR} \
199                 ${SRC_EVP} ${SRC_GOST} ${SRC_HMAC} ${SRC_IDEA} ${SRC_KRB5} \
200                 ${SRC_LHASH} ${SRC_MD4} ${SRC_MD5} ${SRC_MODES} \
201                 ${SRC_OBJECTS} ${SRC_OCSP} ${SRC_PEM} ${SRC_PKCS12} \
202                 ${SRC_PKCS7} ${SRC_POLY1305} ${SRC_RAND} ${SRC_RC2} \
203                 ${SRC_RIPEMD} ${SRC_RSA} ${SRC_SHA} ${SRC_STACK} ${SRC_TS} \
204                 ${SRC_TXT_DB} ${SRC_UI} ${SRC_WHRLPOOL} ${SRC_X509} \
205                 ${SRC_X509V3}
206
207 .PATH:  ${LCRYPTO_SRC} \
208         ${LCRYPTO_SRC}/aes \
209         ${LCRYPTO_SRC}/asn1 \
210         ${LCRYPTO_SRC}/bf \
211         ${LCRYPTO_SRC}/bio \
212         ${LCRYPTO_SRC}/bn \
213         ${LCRYPTO_SRC}/buffer \
214         ${LCRYPTO_SRC}/camellia \
215         ${LCRYPTO_SRC}/cast \
216         ${LCRYPTO_SRC}/chacha \
217         ${LCRYPTO_SRC}/cmac \
218         ${LCRYPTO_SRC}/comp \
219         ${LCRYPTO_SRC}/compat \
220         ${LCRYPTO_SRC}/conf \
221         ${LCRYPTO_SRC}/des \
222         ${LCRYPTO_SRC}/dh \
223         ${LCRYPTO_SRC}/dsa \
224         ${LCRYPTO_SRC}/dso \
225         ${LCRYPTO_SRC}/ec \
226         ${LCRYPTO_SRC}/ecdh \
227         ${LCRYPTO_SRC}/ecdsa \
228         ${LCRYPTO_SRC}/engine \
229         ${LCRYPTO_SRC}/err \
230         ${LCRYPTO_SRC}/evp \
231         ${LCRYPTO_SRC}/gost \
232         ${LCRYPTO_SRC}/hmac \
233         ${LCRYPTO_SRC}/idea \
234         ${LCRYPTO_SRC}/krb5 \
235         ${LCRYPTO_SRC}/lhash \
236         ${LCRYPTO_SRC}/md4 \
237         ${LCRYPTO_SRC}/md5 \
238         ${LCRYPTO_SRC}/modes \
239         ${LCRYPTO_SRC}/objects \
240         ${LCRYPTO_SRC}/ocsp \
241         ${LCRYPTO_SRC}/pem \
242         ${LCRYPTO_SRC}/pkcs12 \
243         ${LCRYPTO_SRC}/pkcs7 \
244         ${LCRYPTO_SRC}/poly1305 \
245         ${LCRYPTO_SRC}/rand \
246         ${LCRYPTO_SRC}/rc2 \
247         ${LCRYPTO_SRC}/rc4 \
248         ${LCRYPTO_SRC}/ripemd \
249         ${LCRYPTO_SRC}/rsa \
250         ${LCRYPTO_SRC}/sha \
251         ${LCRYPTO_SRC}/stack \
252         ${LCRYPTO_SRC}/ts \
253         ${LCRYPTO_SRC}/txt_db \
254         ${LCRYPTO_SRC}/ui \
255         ${LCRYPTO_SRC}/whrlpool \
256         ${LCRYPTO_SRC}/x509 \
257         ${LCRYPTO_SRC}/x509v3 \
258         ${LIBRESSL_SRC}/include/openssl
259
260 # compat/
261 SRCS+=  explicit_bzero.c reallocarray.c timingsafe_bcmp.c timingsafe_memcmp.c
262
263 .include <bsd.lib.mk>