# $Id: Makefile.kmk 94320 2022-03-22 10:38:12Z vboxsync $ ## @file # Sub-Makefile for OpenSSL providers. # # # Copyright (C) 2022 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; # you can redistribute it and/or modify it under the terms of the GNU # General Public License (GPL) as published by the Free Software # Foundation, in version 2 as it comes in the "COPYING" file of the # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # SUB_DEPTH = ../../../.. include $(KBUILD_PATH)/subheader.kmk # # Include sub-makefiles. # # Note! For joining the sub libraries into a single lib, we do some trickery to # collect the sub-library names here. # VBOX_LIBRARIES_BEFORE_CRYPTO_PROVIDERS_SUBDIRS := $(LIBRARIES) include $(VBOX_PATH_CRYPTO_PROVIDERS)/common/Makefile.kmk include $(sort $(wildcard $(VBOX_PATH_CRYPTO_PROVIDERS)/implementations/*/Makefile.kmk)) VBOX_CRYPTO_PROVIDERS_SUBLIBS := $(filter-out $(VBOX_LIBRARIES_BEFORE_CRYPTO_PROVIDERS_SUBDIRS), $(LIBRARIES)) VBOX_CRYPTO_PROVIDERS_SUBLIBS_X86 := $(filter %-x86, $(VBOX_CRYPTO_PROVIDERS_SUBLIBS)) VBOX_CRYPTO_PROVIDERS_SUBLIBS := $(filter-out %-x86, $(VBOX_CRYPTO_PROVIDERS_SUBLIBS)) #if defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS) # $(eval LIBRARIES = $(VBOX_LIBRARIES_BEFORE_CRYPTO_SUBDIRS) crypto_sha) #else if "$(SDK_VBOX_OPENSSL_INCS)" != "$(SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS)" $(eval LIBRARIES = $(VBOX_LIBRARIES_BEFORE_CRYPTO_SUBDIRS)) endif VBOX_LIBRARIES_BEFORE_CRYPTO_PROVIDERS_SUBDIRS := # # The main target: libproviders. # if "$(SDK_VBOX_OPENSSL_INCS)" == "$(SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS)" LIBRARIES += VBox-libproviders endif VBox-libproviders_TEMPLATE = LIBCRYPTO VBox-libproviders_DEFS = OPENSSL_NO_DEPRECATED VBox-libproviders_SOURCES = \ baseprov.c \ defltprov.c \ legacyprov.c \ nullprov.c \ prov_running.c VBox-libproviders_SOURCES += $(foreach sublib,$(VBOX_CRYPTO_PROVIDERS_SUBLIBS), $($(sublib)_1_TARGET)) ifdef VBOX_WITH_32_ON_64_MAIN_API # 32-bit edition. LIBRARIES += VBox-libproviders-x86 VBox-libproviders-x86_TEMPLATE = VBoxLibCrypto-x86 VBox-libproviders-x86_EXTENDS = VBox-libproviders VBox-libproviders-x86_SOURCES = $(filter %.c %.cpp,$(VBox-libproviders_SOURCES)) \ $(foreach sublib,$(VBOX_CRYPTO_PROVIDERS_SUBLIBS_X86), $($(sublib)_1_TARGET)) endif ifdef VBOX_NEED_EXTPACK_OPENSSL # # For the extension pack. # LIBRARIES += VBoxExtPack-libproviders VBoxExtPack-libproviders_EXTENDS = VBox-libproviders VBoxExtPack-libproviders_DEFS = VBOX_IN_EXTPACK endif include $(FILE_KBUILD_SUB_FOOTER) # # Re-creates certain openssl headers which exist as templates. # OSSL_PROVIDERS_HDR_TEMPLATES := \ $(VBOX_PATH_CRYPTO_PROVIDERS)/common/include/prov/der_digests.h.in \ $(VBOX_PATH_CRYPTO_PROVIDERS)/common/include/prov/der_dsa.h.in \ $(VBOX_PATH_CRYPTO_PROVIDERS)/common/include/prov/der_ec.h.in \ $(VBOX_PATH_CRYPTO_PROVIDERS)/common/include/prov/der_ecx.h.in \ $(VBOX_PATH_CRYPTO_PROVIDERS)/common/include/prov/der_rsa.h.in \ $(VBOX_PATH_CRYPTO_PROVIDERS)/common/include/prov/der_sm2.h.in \ $(VBOX_PATH_CRYPTO_PROVIDERS)/common/include/prov/der_wrap.h.in # # Big fat @todo: # I'm too stupid atm to figure out how to get this executed sequentially # instead of getting it expanded and executed at once... # recreate-providers-headers: $(VBOX_PATH_OPENSSL)/util/dofile.pl \ $(OSSL_PROVIDERS_HDR_TEMPLATES) \ recreate-providers-der-sources $(foreach header, $(OSSL_PROVIDERS_HDR_TEMPLATES), \ perl \ -I$(VBOX_PATH_OPENSSL) \ -I$(VBOX_PATH_OPENSSL)/util/perl \ -I$(VBOX_PATH_CRYPTO_PROVIDERS)/common/der \ -Mconfigdata -Moids_to_c $(VBOX_PATH_OPENSSL)/util/dofile.pl -oMakefile \ $(header) > $(VBOX_PATH_OPENSSL)/gen-includes/prov/$(basename $(notdir $(header)));))