VirtualBox

source: vbox/trunk/src/libs/openssl-1.1.1l/Config.kmk@ 91977

最後變更 在這個檔案從91977是 91772,由 vboxsync 提交於 3 年 前

openssl-1.1.1l: Applied and adjusted our OpenSSL changes to 1.1.1l. bugref:10126

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 12.0 KB
 
1# $Id: Config.kmk 91772 2021-10-15 21:49:59Z vboxsync $
2## @file
3# OpenSSL kBuild Configuration file.
4#
5
6#
7# Copyright (C) 2006-2016 Oracle Corporation
8#
9# Oracle Corporation confidential
10# All rights reserved
11#
12
13# Include the top-level configure file.
14ifndef VBOX_ROOT_CONFIG_KMK_INCLUDED
15 include $(PATH_ROOT)/Config.kmk
16endif
17
18# Figure out openssl perl asm style for the target
19VBOX_CRYPTO_ASM_SCHEME := portme
20if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris)
21 VBOX_CRYPTO_ASM_SCHEME := elf
22else ifeq ($(KBUILD_TARGET), darwin)
23 VBOX_CRYPTO_ASM_SCHEME := macosx
24else ifeq ($(KBUILD_TARGET), win)
25 VBOX_CRYPTO_ASM_SCHEME := nasm
26endif
27
28# Can't use relative paths when dealing with sub-makefiles.
29VBOX_PATH_OPENSSL := $(PATH_ROOT)/src/libs/openssl-1.1.1l
30VBOX_PATH_CRYPTO := $(VBOX_PATH_OPENSSL)/crypto
31VBOX_PATH_CRYPTO_GENASM := $(VBOX_PATH_CRYPTO)/genasm-$(VBOX_CRYPTO_ASM_SCHEME)
32VBOX_PATH_CRYPTO_AES := $(VBOX_PATH_CRYPTO)/aes
33VBOX_PATH_CRYPTO_BN := $(VBOX_PATH_CRYPTO)/bn
34VBOX_PATH_CRYPTO_CHACHA := $(VBOX_PATH_CRYPTO)/chacha
35VBOX_PATH_CRYPTO_EC := $(VBOX_PATH_CRYPTO)/ec
36VBOX_PATH_CRYPTO_MD5 := $(VBOX_PATH_CRYPTO)/md5
37VBOX_PATH_CRYPTO_MODES := $(VBOX_PATH_CRYPTO)/modes
38VBOX_PATH_CRYPTO_RC4 := $(VBOX_PATH_CRYPTO)/rc4
39VBOX_PATH_CRYPTO_SHA := $(VBOX_PATH_CRYPTO)/sha
40VBOX_PATH_CRYPTO_DES := $(VBOX_PATH_CRYPTO)/des
41VBOX_PATH_CRYPTO_CAMELLIA := $(VBOX_PATH_CRYPTO)/camellia
42VBOX_INST_CRYPTO_HEADERS := obj/$(if-expr "$(CURSUBDIR)" == ".",,$(CURSUBDIR)/)crypto-1.1.1-headers/include/openssl/
43VBOX_PATH_CRYPTO_HEADERS := $(abspath $(PATH_OUT))/$(patsubst %/,%,$(VBOX_INST_CRYPTO_HEADERS))
44
45# Enable asm implementation of crypto.
46if1of ($(KBUILD_TARGET_ARCH), x86 amd64)
47 ifneq ($(VBOX_CRYPTO_ASM_SCHEME),portme)
48 ifn1of ($(KBUILD_TARGET), ) # Selective exclusion for testing.
49 VBOX_WITH_CRYPTO_ASM = 1
50 endif
51 endif
52endif
53
54#
55# A target for installer the header files into a include directory
56# for the build. We have to put this in the Config.kmk because it
57# is required when running make from a sub directory too.
58#
59INSTALLS += crypto-headers
60crypto-headers_INST = $(VBOX_INST_CRYPTO_HEADERS)
61crypto-headers_MODE = a+r,u+w
62crypto-headers_DEFPATH = $(VBOX_PATH_OPENSSL)
63crypto-headers_SOURCES = \
64 include/openssl/aes.h=>aes.h \
65 include/openssl/asn1.h=>asn1.h \
66 include/openssl/asn1err.h=>asn1err.h \
67 include/openssl/asn1t.h=>asn1t.h \
68 include/openssl/asn1_mac.h=>asn1_mac.h \
69 include/openssl/async.h=>async.h \
70 include/openssl/asyncerr.h=>asyncerr.h \
71 include/openssl/bio.h=>bio.h \
72 include/openssl/bioerr.h=>bioerr.h \
73 include/openssl/blowfish.h=>blowfish.h \
74 include/openssl/bn.h=>bn.h \
75 include/openssl/bnerr.h=>bnerr.h \
76 include/openssl/buffer.h=>buffer.h \
77 include/openssl/buffererr.h=>buffererr.h \
78 include/openssl/camellia.h=>camellia.h \
79 include/openssl/cast.h=>cast.h \
80 include/openssl/cmac.h=>cmac.h \
81 include/openssl/cms.h=>cms.h \
82 include/openssl/cmserr.h=>cmserr.h \
83 include/openssl/comp.h=>comp.h \
84 include/openssl/comperr.h=>comperr.h \
85 include/openssl/conf.h=>conf.h \
86 include/openssl/conferr.h=>conferr.h \
87 include/openssl/conf_api.h=>conf_api.h \
88 include/openssl/crypto.h=>crypto.h \
89 include/openssl/cryptoerr.h=>cryptoerr.h \
90 include/openssl/ct.h=>ct.h \
91 include/openssl/cterr.h=>cterr.h \
92 include/openssl/des.h=>des.h \
93 include/openssl/dh.h=>dh.h \
94 include/openssl/dherr.h=>dherr.h \
95 include/openssl/dsa.h=>dsa.h \
96 include/openssl/dsaerr.h=>dsaerr.h \
97 include/openssl/dtls1.h=>dtls1.h \
98 include/openssl/ebcdic.h=>ebcdic.h \
99 include/openssl/ec.h=>ec.h \
100 include/openssl/ecerr.h=>ecerr.h \
101 include/openssl/ecdh.h=>ecdh.h \
102 include/openssl/ecdsa.h=>ecdsa.h \
103 include/openssl/engine.h=>engine.h \
104 include/openssl/err.h=>err.h \
105 include/openssl/evp.h=>evp.h \
106 include/openssl/evperr.h=>evperr.h \
107 include/openssl/e_os2.h=>e_os2.h \
108 include/openssl/hmac.h=>hmac.h \
109 include/openssl/idea.h=>idea.h \
110 include/openssl/lhash.h=>lhash.h \
111 include/openssl/md2.h=>md2.h \
112 include/openssl/md4.h=>md4.h \
113 include/openssl/md5.h=>md5.h \
114 include/openssl/mdc2.h=>mdc2.h \
115 include/openssl/modes.h=>modes.h \
116 include/openssl/objects.h=>objects.h \
117 include/openssl/objectserr.h=>objectserr.h \
118 include/openssl/obj_mac.h=>obj_mac.h \
119 include/openssl/ocsp.h=>ocsp.h \
120 include/openssl/ocsperr.h=>ocsperr.h \
121 openssl-mangling.h=>openssl-mangling.h \
122 include/openssl/opensslconf.h=>opensslconf.h \
123 include/openssl/opensslv.h=>opensslv.h \
124 include/openssl/ossl_typ.h=>ossl_typ.h \
125 include/openssl/pem.h=>pem.h \
126 include/openssl/pemerr.h=>pemerr.h \
127 include/openssl/pem2.h=>pem2.h \
128 include/openssl/pkcs12.h=>pkcs12.h \
129 include/openssl/pkcs12err.h=>pkcs12err.h \
130 include/openssl/pkcs7.h=>pkcs7.h \
131 include/openssl/pkcs7err.h=>pkcs7err.h \
132 include/openssl/rand.h=>rand.h \
133 include/openssl/randerr.h=>randerr.h \
134 include/openssl/rc2.h=>rc2.h \
135 include/openssl/rc4.h=>rc4.h \
136 include/openssl/ripemd.h=>ripemd.h \
137 include/openssl/rsa.h=>rsa.h \
138 include/openssl/rsaerr.h=>rsaerr.h \
139 include/openssl/safestack.h=>safestack.h \
140 include/openssl/seed.h=>seed.h \
141 include/openssl/sha.h=>sha.h \
142 include/openssl/srp.h=>srp.h \
143 include/openssl/srtp.h=>srtp.h \
144 include/openssl/ssl.h=>ssl.h \
145 include/openssl/sslerr.h=>sslerr.h \
146 include/openssl/ssl2.h=>ssl2.h \
147 include/openssl/ssl3.h=>ssl3.h \
148 include/openssl/stack.h=>stack.h \
149 include/openssl/symhacks.h=>symhacks.h \
150 include/openssl/tls1.h=>tls1.h \
151 include/openssl/ts.h=>ts.h \
152 include/openssl/txt_db.h=>txt_db.h \
153 include/openssl/ui.h=>ui.h \
154 include/openssl/x509.h=>x509.h \
155 include/openssl/x509err.h=>x509err.h \
156 include/openssl/x509v3.h=>x509v3.h \
157 include/openssl/x509v3err.h=>x509v3err.h \
158 include/openssl/x509_vfy.h=>x509_vfy.h
159
160
161
162#
163# The templates used for the crypo lib and all its sublibraries.
164#
165TEMPLATE_LIBCRYPTO = Template for the OpenSSL crypto library.
166TEMPLATE_LIBCRYPTO_EXTENDS = VBoxR3RuntimeDllNonPedantic
167ifneq ($(KBUILD_TARGET), win)
168 ## @todo correct inheritance here to make it use all the VBOXR3NP settings instead of overriding all of them.
169 TEMPLATE_LIBCRYPTO_ASTOOL = $(TEMPLATE_VBoxR3RuntimeDllNonPedantic_TOOL)
170 TEMPLATE_LIBCRYPTO_ASFLAGS = -include $(VBOX_PATH_OPENSSL)/openssl-mangling.h
171 TEMPLATE_LIBCRYPTO_ASFLAGS.x86 = -m32
172 TEMPLATE_LIBCRYPTO_ASFLAGS.amd64 = -m64
173 TEMPLATE_LIBCRYPTO_ASDEFS = $(NO_SUCH_VARIABLE)
174 TEMPLATE_LIBCRYPTO_ASDEFS.darwin = OPENSSL_MANGLE_ASM
175endif
176
177TEMPLATE_LIBCRYPTO_DEFS = \
178 $(TEMPLATE_VBoxR3RuntimeDllNonPedantic_DEFS) \
179 VBOX_SUFF_DLL=$(VBOX_SUFF_DLL) \
180 IN_RT_R3 \
181 DSO_NONE \
182 OPENSSL_USE_NODELETE \
183 OPENSSL_PIC \
184 OPENSSL_IA32_SSE2
185ifdef VBOX_WITH_CRYPTO_ASM
186TEMPLATE_LIBCRYPTO_DEFS += \
187 OPENSSL_BN_ASM_MONT \
188 OPENSSL_BN_ASM_GF2m \
189 SHA1_ASM \
190 SHA256_ASM \
191 SHA512_ASM \
192 RC4_ASM \
193 MD5_ASM \
194 AES_ASM \
195 VPAES_ASM \
196 ECP_NISTZ256_ASM \
197 PADLOCK_ASM \
198 POLY1305_ASM
199TEMPLATE_LIBCRYPTO_DEFS.amd64 = \
200 BSAES_ASM \
201 GHASH_ASM \
202 KECCAK1600_ASM \
203 OPENSSL_BN_ASM_MONT5 \
204 X25519_ASM
205else
206TEMPLATE_LIBCRYPTO_DEFS += \
207 OPENSSL_NO_ASM
208endif
209if1of ($(KBUILD_TARGET), linux solaris)
210TEMPLATE_LIBCRYPTO_DEFS += \
211 _REENTRANT \
212 _GNU_SOURCE
213endif
214ifeq ($(sort $(filter -fPIC,$(TEMPLATE_VBoxR3RuntimeDllNonPedantic_CFLAGS))),-fPIC)
215TEMPLATE_LIBCRYPTO_DEFS += \
216 OPENSSL_PIC
217endif
218TEMPLATE_LIBCRYPTO_DEFS.amd64 += \
219 MD32_REG_T=int
220ifeq ($(KBUILD_TARGET),win)
221TEMPLATE_LIBCRYPTO_DEFS += \
222 OPENSSL_SYSNAME_WIN32 \
223 OPENSSL_RAND_SEED_OS
224# Exclude WinCrypt.h, causes trouble all over the place
225TEMPLATE_LIBCRYPTO_DEFS += \
226 NOCRYPT
227endif
228if1of ($(KBUILD_TARGET_ARCH), x86 amd64 arm64)
229TEMPLATE_LIBCRYPTO_DEFS += \
230 L_ENDIAN
231else
232TEMPLATE_LIBCRYPTO_DEFS += \
233 B_ENDIAN
234endif
235ifeq ($(KBUILD_TARGET),os2)
236TEMPLATE_LIBCRYPTO_DEFS += \
237 OPENSSL_NO_SECURE_MEMORY
238endif
239if defined(VBOX_WITH_PARFAIT) #&& VBOX_GCC_VERSION_CC == 50301
240 TEMPLATE_LIBCRYPTO_DEFS += __STDC_NO_ATOMICS__
241endif
242# Enable for running with valgrind:
243#TEMPLATE_LIBCRYPTO_DEFS += PURIFY
244
245TEMPLATE_LIBCRYPTO_CFLAGS = $(filter-out $(VBOX_GCC_fvisibility-hidden),$(TEMPLATE_VBoxR3RuntimeDllNonPedantic_CFLAGS))
246TEMPLATE_LIBCRYPTO_CFLAGS.win = $(TEMPLATE_VBoxR3RuntimeDllNonPedantic_CFLAGS.win)
247TEMPLATE_LIBCRYPTO_CFLAGS.win += -wd4305 # asn1_lib.c(455) : warning C4305: 'type cast' : truncation from 'const unsigned char *' to 'unsigned long'
248TEMPLATE_LIBCRYPTO_CFLAGS.win += -wd4306 # tasn_new.c(338) : warning C4306: 'type cast' : conversion from 'int' to 'ASN1_VALUE *' of greater size
249TEMPLATE_LIBCRYPTO_CFLAGS.win += -wd4701 # tasn_dec.c(840) : warning C4701: potentially uninitialized local variable 'buf' used
250TEMPLATE_LIBCRYPTO_CFLAGS.win += -wd4101 # bn_asm.c(619) : warning C4101: 'bh' : unreferenced local variable
251TEMPLATE_LIBCRYPTO_CFLAGS.win += -wd4206 # e_camellia.c(120) : warning C4206: nonstandard extension used : translation unit is empty
252TEMPLATE_LIBCRYPTO_CFLAGS.win += -wd4232 # warning C4232: nonstandard extension used : 'malloc_func' : address of dllimport 'malloc' is not stati c, identity not guaranteed
253TEMPLATE_LIBCRYPTO_CFLAGS.win += -wd4146 # x_long.c(79) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
254TEMPLATE_LIBCRYPTO_CFLAGS.win += -wd4130 # b_addr.c(750) : warning C4130: '==' : logical operation on address of string constant
255TEMPLATE_LIBCRYPTO_CFLAGS.win += -wd4090 # ssl_lib.c(229) : warning C4090: 'function' : different 'const' qualifiers
256TEMPLATE_LIBCRYPTO_CFLAGS.win += -wd4310 # bss_acpt.c(223) : warning C4310: cast truncates constant value [(int)INVALID_SOCKET]
257TEMPLATE_LIBCRYPTO_CFLAGS.win += -wd4210 # bn_exp.c(913) : warning C4210: nonstandard extension used : function given file scope
258TEMPLATE_LIBCRYPTO_CFLAGS.win += -wd4067 # mem.c(14) : warning C4067: unexpected tokens following preprocessor directive - expected a newline
259
260if1of ($(VBOX_VCC_TOOL_STEM), VCC120)
261 TEMPLATE_LIBCRYPTO_CFLAGS.win += -wd4005 # sdk\v7.1\include\sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition
262endif
263TEMPLATE_LIBCRYPTO_CFLAGS.freebsd = -std=gnu99
264
265TEMPLATE_LIBCRYPTO_INCS := \
266 $(VBOX_PATH_OPENSSL) \
267 $(VBOX_PATH_OPENSSL)/include \
268 $(VBOX_PATH_CRYPTO)/include \
269 $(VBOX_PATH_CRYPTO_MODES) \
270 $(VBOX_PATH_CRYPTO)/ec/curve448 \
271 $(VBOX_PATH_CRYPTO)/ec/curve448/arch_32 \
272 $(patsubst %/openssl,%,$(VBOX_PATH_CRYPTO_HEADERS))
273
274#TEMPLATE_LIBCRYPTO_INTERMEDIATES = $($(crypto-headers)_1_STAGE_TARGET)
275TEMPLATE_LIBCRYPTO_INTERMEDIATES := \
276 $(foreach f,$(crypto-headers_SOURCES),$(VBOX_PATH_CRYPTO_HEADERS)/$(lastword $(subst =>, ,$(f))))
277
278# Same as LIBCRYPTO except that we don't install these libraries.
279TEMPLATE_SUBLIBCRYPTO = Template for the OpenSSL crypto sub-libraries.
280TEMPLATE_SUBLIBCRYPTO_EXTENDS = LIBCRYPTO
281TEMPLATE_SUBLIBCRYPTO_INSTTYPE = none
282
283# Somewhat similar to LIBCRYPTO.
284TEMPLATE_LIBCRYPTOTST = Template for the OpenSSL crypto testcases.
285TEMPLATE_LIBCRYPTOTST_EXTENDS = VBOXR3TSTEXE
286TEMPLATE_LIBCRYPTOTST_DEFS = $(TEMPLATE_VBOXR3TSTEXE_DEFS) $(filter-out $(TEMPLATE_VBoxR3RuntimeDllNonPedantic_DEFS) IN_RT_R3,$(TEMPLATE_LIBCRYPTO_DEFS))
287TEMPLATE_LIBCRYPTOTST_INCS = $(TEMPLATE_LIBCRYPTO_INCS) $(TEMPLATE_VBOXR3TSTEXE_INCS)
288ifeq ($(KBUILD_TARGET),win)
289TEMPLATE_LIBCRYPTOTST_CFLAGS = $(filter-out $(VBOX_VCC_WERR), $(TEMPLATE_VBOXR3TSTEXE_CXXFLAGS)) $(VBOX_VCC_NON_PEDANTIC)
290else
291TEMPLATE_LIBCRYPTOTST_CFLAGS = $(filter-out $(VBOX_GCC_PEDANTIC_C), $(TEMPLATE_VBOXR3TSTEXE_CFLAGS)) $(VBOX_GCC_NON_PEDANTIC_C)
292endif
293TEMPLATE_LIBCRYPTOTST_LIBS = $(PATH_STAGE_LIB)/VBox-libcrypto$(VBOX_SUFF_LIB) $(TEMPLATE_VBOXR3TSTEXE_LIBS)
294
295#
296# 32-bit version of LIBCRYPTO and SUBLIBCRYPTO.
297#
298TEMPLATE_VBoxLibCrypto-x86 = 32-bit template for the OpenSSL crypto library.
299TEMPLATE_VBoxLibCrypto-x86_EXTENDS = LIBCRYPTO
300TEMPLATE_VBoxLibCrypto-x86_BLD_TRG_ARCH = x86
301TEMPLATE_VBoxLibCrypto-x86_DEFS = $(filter-out HC_ARCH_BITS%,$(TEMPLATE_LIBCRYPTO_DEFS)) HC_ARCH_BITS=32 ARCH_BITS=32
302
303TEMPLATE_VBoxSubLibCrypto-x86 = 32-bit template for the OpenSSL crypto sub-library.
304TEMPLATE_VBoxSubLibCrypto-x86_EXTENDS = VBoxLibCrypto-x86
305TEMPLATE_VBoxSubLibCrypto-x86_INSTTYPE = none
306
307ifdef VBOX_WITH_32_ON_64_MAIN_API # 32-bit edition.
308 define VBOX_OPENSSL_X86
309 $(eval LIBRARIES += $(1)-x86)
310 $(1)-x86_TEMPLATE := VBoxSubLibCrypto-x86
311 $(1)-x86_EXTENDS := $(1)
312 endef
313else
314 define VBOX_OPENSSL_X86
315 endef
316endif
317
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette