1 | # $Id: Makefile.kmk 94320 2022-03-22 10:38:12Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for OpenSSL providers.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2022 Oracle Corporation
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | SUB_DEPTH = ../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 | #
|
---|
22 | # Include sub-makefiles.
|
---|
23 | #
|
---|
24 | # Note! For joining the sub libraries into a single lib, we do some trickery to
|
---|
25 | # collect the sub-library names here.
|
---|
26 | #
|
---|
27 | VBOX_LIBRARIES_BEFORE_CRYPTO_PROVIDERS_SUBDIRS := $(LIBRARIES)
|
---|
28 |
|
---|
29 | include $(VBOX_PATH_CRYPTO_PROVIDERS)/common/Makefile.kmk
|
---|
30 | include $(sort $(wildcard $(VBOX_PATH_CRYPTO_PROVIDERS)/implementations/*/Makefile.kmk))
|
---|
31 |
|
---|
32 | VBOX_CRYPTO_PROVIDERS_SUBLIBS := $(filter-out $(VBOX_LIBRARIES_BEFORE_CRYPTO_PROVIDERS_SUBDIRS), $(LIBRARIES))
|
---|
33 | VBOX_CRYPTO_PROVIDERS_SUBLIBS_X86 := $(filter %-x86, $(VBOX_CRYPTO_PROVIDERS_SUBLIBS))
|
---|
34 | VBOX_CRYPTO_PROVIDERS_SUBLIBS := $(filter-out %-x86, $(VBOX_CRYPTO_PROVIDERS_SUBLIBS))
|
---|
35 | #if defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS)
|
---|
36 | # $(eval LIBRARIES = $(VBOX_LIBRARIES_BEFORE_CRYPTO_SUBDIRS) crypto_sha)
|
---|
37 | #else
|
---|
38 | if "$(SDK_VBOX_OPENSSL_INCS)" != "$(SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS)"
|
---|
39 | $(eval LIBRARIES = $(VBOX_LIBRARIES_BEFORE_CRYPTO_SUBDIRS))
|
---|
40 | endif
|
---|
41 | VBOX_LIBRARIES_BEFORE_CRYPTO_PROVIDERS_SUBDIRS :=
|
---|
42 |
|
---|
43 | #
|
---|
44 | # The main target: libproviders.
|
---|
45 | #
|
---|
46 | if "$(SDK_VBOX_OPENSSL_INCS)" == "$(SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS)"
|
---|
47 | LIBRARIES += VBox-libproviders
|
---|
48 | endif
|
---|
49 | VBox-libproviders_TEMPLATE = LIBCRYPTO
|
---|
50 | VBox-libproviders_DEFS = OPENSSL_NO_DEPRECATED
|
---|
51 | VBox-libproviders_SOURCES = \
|
---|
52 | baseprov.c \
|
---|
53 | defltprov.c \
|
---|
54 | legacyprov.c \
|
---|
55 | nullprov.c \
|
---|
56 | prov_running.c
|
---|
57 | VBox-libproviders_SOURCES += $(foreach sublib,$(VBOX_CRYPTO_PROVIDERS_SUBLIBS), $($(sublib)_1_TARGET))
|
---|
58 |
|
---|
59 | ifdef VBOX_WITH_32_ON_64_MAIN_API # 32-bit edition.
|
---|
60 | LIBRARIES += VBox-libproviders-x86
|
---|
61 | VBox-libproviders-x86_TEMPLATE = VBoxLibCrypto-x86
|
---|
62 | VBox-libproviders-x86_EXTENDS = VBox-libproviders
|
---|
63 | VBox-libproviders-x86_SOURCES = $(filter %.c %.cpp,$(VBox-libproviders_SOURCES)) \
|
---|
64 | $(foreach sublib,$(VBOX_CRYPTO_PROVIDERS_SUBLIBS_X86), $($(sublib)_1_TARGET))
|
---|
65 | endif
|
---|
66 |
|
---|
67 |
|
---|
68 | ifdef VBOX_NEED_EXTPACK_OPENSSL
|
---|
69 | #
|
---|
70 | # For the extension pack.
|
---|
71 | #
|
---|
72 | LIBRARIES += VBoxExtPack-libproviders
|
---|
73 | VBoxExtPack-libproviders_EXTENDS = VBox-libproviders
|
---|
74 | VBoxExtPack-libproviders_DEFS = VBOX_IN_EXTPACK
|
---|
75 | endif
|
---|
76 |
|
---|
77 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
78 |
|
---|
79 | #
|
---|
80 | # Re-creates certain openssl headers which exist as templates.
|
---|
81 | #
|
---|
82 | OSSL_PROVIDERS_HDR_TEMPLATES := \
|
---|
83 | $(VBOX_PATH_CRYPTO_PROVIDERS)/common/include/prov/der_digests.h.in \
|
---|
84 | $(VBOX_PATH_CRYPTO_PROVIDERS)/common/include/prov/der_dsa.h.in \
|
---|
85 | $(VBOX_PATH_CRYPTO_PROVIDERS)/common/include/prov/der_ec.h.in \
|
---|
86 | $(VBOX_PATH_CRYPTO_PROVIDERS)/common/include/prov/der_ecx.h.in \
|
---|
87 | $(VBOX_PATH_CRYPTO_PROVIDERS)/common/include/prov/der_rsa.h.in \
|
---|
88 | $(VBOX_PATH_CRYPTO_PROVIDERS)/common/include/prov/der_sm2.h.in \
|
---|
89 | $(VBOX_PATH_CRYPTO_PROVIDERS)/common/include/prov/der_wrap.h.in
|
---|
90 |
|
---|
91 | #
|
---|
92 | # Big fat @todo:
|
---|
93 | # I'm too stupid atm to figure out how to get this executed sequentially
|
---|
94 | # instead of getting it expanded and executed at once...
|
---|
95 | #
|
---|
96 | recreate-providers-headers: $(VBOX_PATH_OPENSSL)/util/dofile.pl \
|
---|
97 | $(OSSL_PROVIDERS_HDR_TEMPLATES) \
|
---|
98 | recreate-providers-der-sources
|
---|
99 | $(foreach header, $(OSSL_PROVIDERS_HDR_TEMPLATES), \
|
---|
100 | perl \
|
---|
101 | -I$(VBOX_PATH_OPENSSL) \
|
---|
102 | -I$(VBOX_PATH_OPENSSL)/util/perl \
|
---|
103 | -I$(VBOX_PATH_CRYPTO_PROVIDERS)/common/der \
|
---|
104 | -Mconfigdata -Moids_to_c $(VBOX_PATH_OPENSSL)/util/dofile.pl -oMakefile \
|
---|
105 | $(header) > $(VBOX_PATH_OPENSSL)/gen-includes/prov/$(basename $(notdir $(header)));))
|
---|