aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/openssl/ya.make
blob: c5962936a690bfd805ec85584e653f30bbdb3a1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# Generated by devtools/yamaker from nixpkgs 22.05.

LIBRARY()

VERSION(1.1.1t)

ORIGINAL_SOURCE(https://github.com/openssl/openssl/archive/OpenSSL_1_1_1t.tar.gz)

IF (OPENSOURCE_REPLACE_OPENSSL AND EXPORT_CMAKE)

    OPENSOURCE_EXPORT_REPLACEMENT(
        CMAKE OpenSSL
        CMAKE_TARGET OpenSSL::OpenSSL
        CONAN openssl/${OPENSOURCE_REPLACE_OPENSSL}
    )

ELSE()

    ADDINCL(
        GLOBAL contrib/libs/openssl/include
    )

ENDIF()

LICENSE(
    Apache-2.0 AND
    BSD-2-Clause AND
    BSD-3-Clause AND
    BSD-Source-Code AND
    OpenSSL AND
    Public-Domain
)

LICENSE_TEXTS(.yandex_meta/licenses.list.txt)

PROVIDES(openssl)

PEERDIR(
    contrib/libs/openssl/crypto
)

ADDINCL(
    contrib/libs/openssl
)

IF (NOT EXPORT_CMAKE OR NOT OPENSOURCE_REPLACE_OPENSSL)

IF (OS_LINUX)
    IF (ARCH_ARM64)
        SET(LINUX_ARM64 yes)
    ELSEIF (ARCH_ARM7)
        SET(LINUX_ARMV7 yes)
    ELSEIF (ARCH_X86_64)
        SET(LINUX_X86_64 yes)
    ENDIF()
ENDIF()

IF (OS_IOS)
    IF (ARCH_ARM64)
        SET(IOS_ARM64 yes)
    ELSEIF (ARCH_ARM7)
        SET(IOS_ARMV7 yes)
    ELSEIF (ARCH_X86_64)
        SET(IOS_X86_64 yes)
    ELSEIF (ARCH_I386)
        SET(IOS_I386 yes)
    ENDIF()
ENDIF()

IF (OS_ANDROID)
    IF (ARCH_ARM64)
        SET(ANDROID_ARM64 yes)
    ELSEIF (ARCH_ARM7)
        SET(ANDROID_ARMV7 yes)
    ELSEIF (ARCH_X86_64)
        SET(ANDROID_X86_64 yes)
    ELSEIF (ARCH_I686)
        SET(ANDROID_I686 yes)
    ENDIF()
ENDIF()

IF (OS_WINDOWS)
    IF (ARCH_X86_64)
        SET(WINDOWS_X86_64 yes)
    ELSEIF (ARCH_I686)
        SET(WINDOWS_I686 yes)
    ENDIF()
ENDIF()

NO_COMPILER_WARNINGS()

NO_RUNTIME()

CFLAGS(
    -DAESNI_ASM
    -DOPENSSL_BN_ASM_MONT
    -DOPENSSL_CPUID_OBJ
    -DSHA1_ASM
    -DSHA256_ASM
    -DSHA512_ASM
)

IF (NOT WINDOWS_I686)
    CFLAGS(
        -DECP_NISTZ256_ASM
        -DPOLY1305_ASM
    )
ENDIF()

IF (NOT ANDROID_I686 AND NOT WINDOWS_I686)
    CFLAGS(
        -DKECCAK1600_ASM
    )
ENDIF()

IF (NOT OS_WINDOWS)
    CFLAGS(
        -DENGINESDIR=\"/usr/local/lib/engines-1.1\"
        -DOPENSSLDIR=\"/usr/local/ssl\"
    )
ENDIF()

IF (OS_DARWIN AND ARCH_X86_64 OR OS_LINUX AND ARCH_X86_64 OR OS_WINDOWS AND ARCH_X86_64)
    CFLAGS(
        -DGHASH_ASM
        -DL_ENDIAN
        -DMD5_ASM
        -DOPENSSL_BN_ASM_GF2m
        -DOPENSSL_BN_ASM_MONT5
        -DOPENSSL_IA32_SSE2
        -DPADLOCK_ASM
        -DRC4_ASM
        -DX25519_ASM
    )
ENDIF()

IF (OS_LINUX AND ARCH_AARCH64 OR OS_LINUX AND ARCH_X86_64 OR OS_ANDROID)
    CFLAGS(
        -DOPENSSL_USE_NODELETE
    )
ENDIF()

IF (OS_DARWIN AND ARCH_ARM64)
    CFLAGS(
        -DL_ENDIAN
        -DOPENSSL_PIC
    )
ENDIF()

IF (OS_WINDOWS)
    IF (ARCH_X86_64)
        CFLAGS(
            -DENGINESDIR="\"C:\\\\Program\ Files\\\\OpenSSL\\\\lib\\\\engines-1_1\""
            -DOPENSSLDIR="\"C:\\\\Program\ Files\\\\Common\ Files\\\\SSL\""
        )
    ELSEIF (ARCH_I386)
        CFLAGS(
            -DENGINESDIR="\"C:\\\\Program\ Files\ \(x86\)\\\\OpenSSL\\\\lib\\\\engines-1_1\""
            -DOPENSSLDIR="\"C:\\\\Program\ Files\ \(x86\)\\\\Common\ Files\\\\SSL\""
        )
    ENDIF()
    CFLAGS(
        -DOPENSSL_SYS_WIN32
        /GF
    )
ENDIF()

IF (SANITIZER_TYPE == memory)
    CFLAGS(
        -DPURIFY
    )
ENDIF()

IF (MUSL)
    CFLAGS(
        -DOPENSSL_NO_ASYNC
    )
ENDIF()

IF (ARCH_TYPE_32)
    CFLAGS(
        -DOPENSSL_NO_EC_NISTP_64_GCC_128
    )
ENDIF()

SRCS(
    engines/e_capi.c
    engines/e_padlock.c
    ssl/bio_ssl.c
    ssl/d1_lib.c
    ssl/d1_msg.c
    ssl/d1_srtp.c
    ssl/methods.c
    ssl/packet.c
    ssl/pqueue.c
    ssl/record/dtls1_bitmap.c
    ssl/record/rec_layer_d1.c
    ssl/record/rec_layer_s3.c
    ssl/record/ssl3_buffer.c
    ssl/record/ssl3_record.c
    ssl/record/ssl3_record_tls13.c
    ssl/s3_cbc.c
    ssl/s3_enc.c
    ssl/s3_lib.c
    ssl/s3_msg.c
    ssl/ssl_asn1.c
    ssl/ssl_cert.c
    ssl/ssl_ciph.c
    ssl/ssl_conf.c
    ssl/ssl_err.c
    ssl/ssl_init.c
    ssl/ssl_lib.c
    ssl/ssl_mcnf.c
    ssl/ssl_rsa.c
    ssl/ssl_sess.c
    ssl/ssl_stat.c
    ssl/ssl_txt.c
    ssl/ssl_quic.c
    ssl/ssl_utst.c
    ssl/statem/extensions.c
    ssl/statem/extensions_clnt.c
    ssl/statem/extensions_cust.c
    ssl/statem/extensions_srvr.c
    ssl/statem/statem.c
    ssl/statem/statem_clnt.c
    ssl/statem/statem_dtls.c
    ssl/statem/statem_lib.c
    ssl/statem/statem_quic.c
    ssl/statem/statem_srvr.c
    ssl/t1_enc.c
    ssl/t1_lib.c
    ssl/t1_trce.c
    ssl/tls13_enc.c
    ssl/tls_srp.c
)

IF (NOT IOS_ARMV7 AND NOT LINUX_ARMV7)
    CFLAGS(
        -DVPAES_ASM
    )
ENDIF()

IF (OS_LINUX AND ARCH_ARM7 OR OS_LINUX AND ARCH_AARCH64 OR OS_LINUX AND ARCH_X86_64 OR OS_LINUX AND ARCH_PPC64LE)
    SRCS(
        engines/e_afalg.c
    )
ENDIF()

IF (OS_DARWIN AND ARCH_X86_64)
    SRCS(
        asm/darwin/engines/e_padlock-x86_64.s
    )
ENDIF()

IF (OS_LINUX AND ARCH_X86_64)
    SRCS(
        asm/linux/engines/e_padlock-x86_64.s
    )
ENDIF()

IF (OS_WINDOWS AND ARCH_X86_64)
    SRCS(
        asm/windows/engines/e_padlock-x86_64.masm
    )
ENDIF()

IF (OS_WINDOWS AND ARCH_I386)
    CFLAGS(
        -DPADLOCK_ASM
    )
    MASMFLAGS(
        /safeseh
    )
    SRCS(
        asm/windows/engines/e_padlock-x86.masm
    )
ENDIF()

IF (OS_IOS AND ARCH_X86_64)
    CFLAGS(
        -DPADLOCK_ASM
        -D_REENTRANT
    )
    SRCS(
        asm/ios/x86_64/engines/e_padlock-x86_64.s
        engines/e_dasync.c
        engines/e_ossltest.c
    )
ENDIF()

IF (OS_ANDROID AND ARCH_X86_64)
    CFLAGS(
        -DOPENSSL_PIC
        -DOPENSSL_IA32_SSE2
        -DOPENSSL_BN_ASM_MONT5
        -DOPENSSL_BN_ASM_GF2m
        -DDRC4_ASM
        -DMD5_ASM
        -DGHASH_ASM
        -DX25519_ASM
    )
    SRCS(
        asm/android/x86_64/engines/e_padlock-x86_64.s
    )
ENDIF()

IF (OS_ANDROID AND ARCH_I686)
    CFLAGS(
        -DOPENSSL_PIC
        -DOPENSSL_BN_ASM_PART_WORDS
        -DOPENSSL_IA32_SSE2
        -DOPENSSL_BN_ASM_MONT
        -DOPENSSL_BN_ASM_GF2m
        -DRC4_ASM
        -DMD5_ASM
        -DRMD160_ASM
        -DVPAES_ASM
        -DWHIRLPOOL_ASM
        -DGHASH_ASM
    )
    SRCS(
        asm/android/i686/engines/e_padlock-x86.s
    )
ENDIF()

IF (OS_ANDROID AND ARCH_ARM7)
    CFLAGS(
        -DOPENSSL_PIC
        -DOPENSSL_BN_ASM_GF2m
        -DKECCAK1600_ASM
        -DAES_ASM
        -DBSAES_ASM
        -DGHASH_ASM
    )
ENDIF()

IF (OS_ANDROID AND ARCH_ARM64)
    CFLAGS(
        -DOPENSSL_PIC
        -DKECCAK1600_ASM
        -DVPAES_ASM
    )
ENDIF()

ENDIF() # IF (NOT EXPORT_CMAKE OR NOT OPENSOURCE_REPLACE_OPENSSL)

END()

RECURSE(
    apps
    crypto
)