# $Id: Makefile.kmk 94320 2022-03-22 10:38:12Z vboxsync $ ## @file # Sub-Makefile for the OpenSSL base directory. # # # Copyright (C) 2006-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 # Make sure our Config.kmk is included. ifndef VBOX_PATH_CRYPTO include $(PATH_SUB_CURRENT)/Config.kmk endif # Include sub-makefiles. include $(PATH_SUB_CURRENT)/providers/Makefile.kmk include $(PATH_SUB_CURRENT)/crypto/Makefile.kmk include $(PATH_SUB_CURRENT)/ssl/Makefile.kmk # Let kBuild generate the rules. include $(FILE_KBUILD_SUB_FOOTER) # # Re-creates certain openssl headers which exist as templates. # OSSL_HDR_TEMPLATES := \ $(PATH_SUB_CURRENT)/include/openssl/asn1.h.in \ $(PATH_SUB_CURRENT)/include/openssl/asn1t.h.in \ $(PATH_SUB_CURRENT)/include/openssl/bio.h.in \ $(PATH_SUB_CURRENT)/include/openssl/cmp.h.in \ $(PATH_SUB_CURRENT)/include/openssl/cms.h.in \ $(PATH_SUB_CURRENT)/include/openssl/conf.h.in \ $(PATH_SUB_CURRENT)/include/openssl/configuration.h.in \ $(PATH_SUB_CURRENT)/include/openssl/crmf.h.in \ $(PATH_SUB_CURRENT)/include/openssl/crypto.h.in \ $(PATH_SUB_CURRENT)/include/openssl/ct.h.in \ $(PATH_SUB_CURRENT)/include/openssl/err.h.in \ $(PATH_SUB_CURRENT)/include/openssl/ess.h.in \ $(PATH_SUB_CURRENT)/include/openssl/fipskey.h.in \ $(PATH_SUB_CURRENT)/include/openssl/lhash.h.in \ $(PATH_SUB_CURRENT)/include/openssl/opensslv.h.in \ $(PATH_SUB_CURRENT)/include/openssl/ocsp.h.in \ $(PATH_SUB_CURRENT)/include/openssl/pkcs12.h.in \ $(PATH_SUB_CURRENT)/include/openssl/pkcs7.h.in \ $(PATH_SUB_CURRENT)/include/openssl/safestack.h.in \ $(PATH_SUB_CURRENT)/include/openssl/srp.h.in \ $(PATH_SUB_CURRENT)/include/openssl/ssl.h.in \ $(PATH_SUB_CURRENT)/include/openssl/ui.h.in \ $(PATH_SUB_CURRENT)/include/openssl/x509.h.in \ $(PATH_SUB_CURRENT)/include/openssl/x509_vfy.h.in \ $(PATH_SUB_CURRENT)/include/openssl/x509v3.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-headers: $(PATH_SUB_CURRENT)/util/dofile.pl \ $(OSSL_HDR_TEMPLATES) \ recreate-providers-headers $(foreach header, $(OSSL_HDR_TEMPLATES), \ perl -I$(PATH_SUB_CURRENT) \ -Mconfigdata $(PATH_SUB_CURRENT)/util/dofile.pl -oMakefile \ $(header) > $(PATH_SUB_CURRENT)/gen-includes/openssl/$(basename $(notdir $(header)));)) # # How to regenerate the openssl-mangling.h # openssl-mangling.h openssl-mangling-new.h: $(VBox-libcrypto_1_TARGET) $(VBox-libssl_1_TARGET) FORCE $(RM) -f -- $@ $(APPEND_EXT) -tn $@ \ '/* $(DOLLAR)Id: $(DOLLAR) */' \ "/** @file" \ " * Autogenerate symbol mangling header for openssl." \ " */" \ "" \ "/*" \ " * Copyright (C) 2011$(if-expr $(date %Y) > 2011,-$(date %Y),) 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." \ " *" \ " * The contents of this file may alternatively be used under the terms" \ " * of the Common Development and Distribution License Version 1.0" \ " * (CDDL) only, as it comes in the \"COPYING.CDDL\" file of the" \ " * VirtualBox OSE distribution, in which case the provisions of the" \ " * CDDL are applicable instead of those of the GPL." \ " *" \ " * You may elect to license modified versions of this file under the" \ " * terms and conditions of either the GPL or the CDDL or both." \ " */" \ "" \ "#ifndef ___openssl_mangling_h___" \ "#define ___openssl_mangling_h___" \ "# ifdef VBOX_IN_EXTPACK" \ "# define OPENSSL_MANGLER(a_Name) OracleExtPack_ ## a_Name" \ "# define OPENSSL_MANGLER_ASM(a_Name) _OracleExtPack_ ## a_Name" \ "# else" \ "# define OPENSSL_MANGLER(a_Name) VBox_ ## a_Name" \ "# define OPENSSL_MANGLER_ASM(a_Name) _VBox_ ## a_Name" \ "# endif" nm $(filter-out FORCE, $+) \ | $(SED) \ -e '/^[[:xdigit:]][[:xdigit:]]* [TSDBC] /!d' \ -e '/\.eh$(DOLLAR)/d' \ -e 's/^[^ ]* [TSDBC] $(if $(intersects $(KBUILD_TARGET), darwin os2 win),_,)\([[:alpha:]_].*\)/\1/' \ -e 's/[[:space:]]*//g' \ -e 's/^VBox_//' \ | sort \ | $(SED) -e 's/^\(.*\)$(DOLLAR)/#ifndef OPENSSL_MANGLE_ASM\n# ifndef \1\n# define \1 OPENSSL_MANGLER(\1)\n# endif\n#else\n# ifndef _\1\n# define _\1 OPENSSL_MANGLER_ASM(\1)\n# endif\n#endif/' --append-text $@ $(APPEND_EXT) -n $@ \ "#endif" \ "" # # Lists unmangled symbols. # .PHONY: check-openssl-mangling check-openssl-mangling: \ $(VBox-libcrypto_1_TARGET) \ $(VBox-libssl_1_TARGET) \ $(VBoxExtPack-libcrypto_1_TARGET) \ $(VBoxExtPack-libssl_1_TARGET) FORCE nm $(VBox-libcrypto_1_TARGET) $(VBox-libssl_1_TARGET) \ | $(SED) \ -e '/^[[:xdigit:]][[:xdigit:]]* [TSDBC] /!d' \ -e 's/^[^ ]* [TSDBC] $(if $(intersects $(KBUILD_TARGET), darwin os2 win),_,)\([[:alpha:]_].*\)/\1/' \ -e 's/[[:space:]]*//g' \ -e '/^VBox_/d' \ | sort nm $(VBoxExtPack-libcrypto_1_TARGET) $(VBoxExtPack-libssl_1_TARGET) \ | $(SED) \ -e '/^[[:xdigit:]][[:xdigit:]]* [TSDBC] /!d' \ -e 's/^[^ ]* [TSDBC] $(if $(intersects $(KBUILD_TARGET), darwin os2 win),_,)\([[:alpha:]_].*\)/\1/' \ -e 's/[[:space:]]*//g' \ -e '/^OracleExtPack_/d' \ | sort