VirtualBox

source: vbox/trunk/src/libs/openssl-1.1.1j/crypto/Makefile.kmk@ 88461

Last change on this file since 88461 was 87984, checked in by vboxsync, 4 years ago

openssl-1.1.1j: Applied and adjusted our OpenSSL changes to 1.1.1j. bugref:9963

File size: 5.0 KB
Line 
1# $Id: Makefile.kmk 127528 2018-12-17 11:52:21Z michael $
2## @file
3# Sub-Makefile for OpenSSL crypto.
4#
5
6#
7# Copyright (C) 2006-2019 Oracle Corporation
8#
9# Oracle Corporation confidential
10# All rights reserved
11#
12
13SUB_DEPTH = ../../../..
14include $(KBUILD_PATH)/subheader.kmk
15
16#
17# Include sub-makefiles.
18#
19# Note! For joining the sub libraries into a crypto lib, we do some trickery to
20# collect the sub-library names here.
21#
22VBOX_LIBRARIES_BEFORE_CRYPTO_SUBDIRS := $(LIBRARIES)
23if defined(VBOX_ONLY_VALIDATIONKIT)
24 include $(VBOX_PATH_CRYPTO)/sha/Makefile.kmk
25else
26 include $(sort $(wildcard $(VBOX_PATH_CRYPTO)/*/Makefile.kmk))
27endif
28VBOX_CRYPTO_SUBLIBS := $(filter-out $(VBOX_LIBRARIES_BEFORE_CRYPTO_SUBDIRS), $(LIBRARIES))
29VBOX_CRYPTO_SUBLIBS_X86 := $(filter %-x86, $(VBOX_CRYPTO_SUBLIBS))
30VBOX_CRYPTO_SUBLIBS := $(filter-out %-x86, $(VBOX_CRYPTO_SUBLIBS))
31if defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS)
32 $(eval LIBRARIES = $(VBOX_LIBRARIES_BEFORE_CRYPTO_SUBDIRS) crypto_sha)
33else if "$(SDK_VBOX_OPENSSL_INCS)" != "$(SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS)"
34 $(eval LIBRARIES = $(VBOX_LIBRARIES_BEFORE_CRYPTO_SUBDIRS))
35endif
36VBOX_LIBRARIES_BEFORE_CRYPTO_SUBDIRS :=
37
38
39#
40# The VBoxRT libcrypto.
41#
42LIBRARIES += VBox-libcrypto
43VBox-libcrypto_TEMPLATE = LIBCRYPTO
44VBox-libcrypto_INCS = $(VBox-libcrypto_0_OUTDIR)
45VBox-libcrypto_SOURCES = \
46 cpt_err.c \
47 cryptlib.c \
48 ctype.c \
49 cversion.c \
50 ebcdic.c \
51 ex_data.c \
52 getenv.c \
53 init.c \
54 mem.c \
55 mem_dbg.c \
56 mem_sec.c \
57 o_dir.c \
58 o_fips.c \
59 o_fopen.c \
60 o_init.c \
61 o_str.c \
62 o_time.c \
63 uid.c \
64 threads_iprt.c
65
66ifdef VBOX_WITH_CRYPTO_ASM
67 VBox-libcrypto_DEFS.x86 += OPENSSL_CPUID_OBJ=x86cpuid.o
68 VBox-libcrypto_SOURCES.x86 += $(VBOX_PATH_CRYPTO_GENASM)/x86cpuid.S
69 VBox-libcrypto_DEFS.amd64 += OPENSSL_CPUID_OBJ=x86_64cpuid.o
70 VBox-libcrypto_SOURCES.amd64 += $(VBOX_PATH_CRYPTO_GENASM)/x86_64cpuid.S
71else
72 VBox-libcrypto_SOURCES += mem_clr.c
73endif
74
75ifdef VBOX_WITH_OPENSSL_FIPS
76 VBox-libcrypto_SOURCES += o_fips.c fips_ers.c
77endif
78
79if defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS)
80 VBox-libcrypto_SOURCES += $(crypto_sha_1_TARGET)
81else if "$(SDK_VBOX_OPENSSL_INCS)" == "$(SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS)"
82 VBox-libcrypto_SOURCES += $(foreach sublib,$(VBOX_CRYPTO_SUBLIBS), $($(sublib)_1_TARGET))
83endif
84
85VBox-libcrypto_CLEAN = $(VBox-libcrypto_0_OUTDIR)/buildinf.h
86VBox-libcrypto_INTERMEDIATES = $(VBox-libcrypto_0_OUTDIR)/buildinf.h
87
88
89ifdef VBOX_WITH_32_ON_64_MAIN_API # 32-bit edition.
90 LIBRARIES += VBox-libcrypto-x86
91 VBox-libcrypto-x86_TEMPLATE = VBoxLibCrypto-x86
92 VBox-libcrypto-x86_EXTENDS = VBox-libcrypto
93 VBox-libcrypto-x86_SOURCES = $(filter %.c %.cpp,$(VBox-libcrypto_SOURCES)) \
94 $(foreach sublib,$(VBOX_CRYPTO_SUBLIBS_X86), $($(sublib)_1_TARGET))
95endif
96
97
98ifdef VBOX_NEED_EXTPACK_OPENSSL
99#
100# The extension pack libcrypto.
101#
102LIBRARIES += VBoxExtPack-libcrypto
103VBoxExtPack-libcrypto = For the Oracle Extension Pack
104VBoxExtPack-libcrypto_EXTENDS = VBox-libcrypto
105VBoxExtPack-libcrypto_DEFS = $(VBox-libcrypto_DEFS) VBOX_IN_EXTPACK
106VBoxExtPack-libcrypto_SOURCES = \
107 $(filter %.c %.cpp,$(VBox-libcrypto_SOURCES)) \
108 $(foreach sublib,$(VBOX_CRYPTO_SUBLIBS), $(VBoxExtPack-$(sublib)_1_TARGET))
109define def_VBoxExtPack_libcrypto_inherit
110 LIBRARIES += VBoxExtPack-$(sublib)
111 VBoxExtPack-$(sublib) = Oracle Extension Pack version of $(sublib)
112 VBoxExtPack-$(sublib)_EXTENDS = $(sublib)
113 VBoxExtPack-$(sublib)_EXTENDS_BY = appending
114 VBoxExtPack-$(sublib)_DEFS = VBOX_IN_EXTPACK
115 VBoxExtPack-$(sublib)_DEFPATH = $($(sublib)_DEFPATH)
116 ## @todo kBuild: DEFPATH isn't inherited! FIXME!
117endef
118$(foreach sublib,$(VBOX_CRYPTO_SUBLIBS), $(eval $(def_VBoxExtPack_libcrypto_inherit)))
119
120endif # VBOX_NEED_EXTPACK_OPENSSL
121
122
123#
124# ...
125#
126recreate-openssl-asm: $(VBOX_PATH_CRYPTO)/perlasm/x86asm.pl \
127 $(VBOX_PATH_CRYPTO)/x86cpuid.pl \
128 $(VBOX_PATH_CRYPTO)/x86_64cpuid.pl \
129 recreate-aes-asm \
130 recreate-bn-asm \
131 recreate-chacha-asm \
132 recreate-ec-asm \
133 recreate-md5-asm \
134 recreate-modes-asm \
135 recreate-rc4-asm \
136 recreate-sha-asm
137 perl $(VBOX_PATH_CRYPTO)/x86cpuid.pl elf -fPIC $(VBOX_PATH_CRYPTO)/genasm-elf/x86cpuid.S
138 perl $(VBOX_PATH_CRYPTO)/x86_64cpuid.pl elf $(VBOX_PATH_CRYPTO)/genasm-elf/x86_64cpuid.S
139 perl $(VBOX_PATH_CRYPTO)/x86cpuid.pl macosx $(VBOX_PATH_CRYPTO)/genasm-macosx/x86cpuid.S
140 perl $(VBOX_PATH_CRYPTO)/x86_64cpuid.pl macosx $(VBOX_PATH_CRYPTO)/genasm-macosx/x86_64cpuid.S
141 perl $(VBOX_PATH_CRYPTO)/x86cpuid.pl win32n $(VBOX_PATH_CRYPTO)/genasm-nasm/x86cpuid.S
142 perl $(VBOX_PATH_CRYPTO)/x86_64cpuid.pl nasm $(VBOX_PATH_CRYPTO)/genasm-nasm/x86_64cpuid.S
143
144
145include $(FILE_KBUILD_SUB_FOOTER)
146
147
148#
149# Generate
150#
151$(VBox-libcrypto_0_OUTDIR)/buildinf.h: $(VBOX_PATH_CRYPTO)/Makefile.kmk | $$(dir $$@)
152 $(call MSG_GENERATE,,$@)
153 $(QUIET)$(RM) -f $@
154 $(QUIET)$(APPEND) $@ '/* auto-generated by crypto/Makefile.kmk for crypto/cversion.c */'
155 $(QUIET)$(APPEND) $@ '#ifndef MK1MF_BUILD'
156 $(QUIET)$(APPEND) $@ '# define PLATFORM "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)"'
157 $(QUIET)$(APPEND) $@ '# define DATE "$(date-utc )"'
158 $(QUIET)$(APPEND) $@ 'static const char compiler_flags[] ='
159 $(QUIET)$(APPEND) $@ ' "$(VBox-libcrypto_CFLAGS)";'
160 $(QUIET)$(APPEND) $@ '#endif'
161
Note: See TracBrowser for help on using the repository browser.

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