1 | # $Id: Makefile.kmk 125764 2018-10-12 17:09:46Z michael $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the OpenSSL base directory.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2020 Oracle Corporation
|
---|
8 | #
|
---|
9 | # Oracle Corporation confidential
|
---|
10 | # All rights reserved
|
---|
11 | #
|
---|
12 |
|
---|
13 | SUB_DEPTH = ../../..
|
---|
14 | include $(KBUILD_PATH)/subheader.kmk
|
---|
15 |
|
---|
16 | # Make sure our Config.kmk is included.
|
---|
17 | ifndef VBOX_PATH_CRYPTO
|
---|
18 | include $(PATH_SUB_CURRENT)/Config.kmk
|
---|
19 | endif
|
---|
20 |
|
---|
21 | VBOX_OSSL_TARGETS := linux.amd64
|
---|
22 |
|
---|
23 | # Include sub-makefiles.
|
---|
24 | include $(PATH_SUB_CURRENT)/providers/Makefile.kmk
|
---|
25 | include $(PATH_SUB_CURRENT)/crypto/Makefile.kmk
|
---|
26 | include $(PATH_SUB_CURRENT)/ssl/Makefile.kmk
|
---|
27 |
|
---|
28 | # Let kBuild generate the rules.
|
---|
29 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
30 |
|
---|
31 | #
|
---|
32 | # Re-creates certain openssl headers which exist as templates.
|
---|
33 | #
|
---|
34 | OSSL_HDR_TEMPLATES := \
|
---|
35 | $(PATH_SUB_CURRENT)/include/openssl/asn1.h.in \
|
---|
36 | $(PATH_SUB_CURRENT)/include/openssl/asn1t.h.in \
|
---|
37 | $(PATH_SUB_CURRENT)/include/openssl/bio.h.in \
|
---|
38 | $(PATH_SUB_CURRENT)/include/openssl/cmp.h.in \
|
---|
39 | $(PATH_SUB_CURRENT)/include/openssl/cms.h.in \
|
---|
40 | $(PATH_SUB_CURRENT)/include/openssl/conf.h.in \
|
---|
41 | $(PATH_SUB_CURRENT)/include/openssl/configuration.h.in \
|
---|
42 | $(PATH_SUB_CURRENT)/include/openssl/crmf.h.in \
|
---|
43 | $(PATH_SUB_CURRENT)/include/openssl/crypto.h.in \
|
---|
44 | $(PATH_SUB_CURRENT)/include/openssl/ct.h.in \
|
---|
45 | $(PATH_SUB_CURRENT)/include/openssl/err.h.in \
|
---|
46 | $(PATH_SUB_CURRENT)/include/openssl/ess.h.in \
|
---|
47 | $(PATH_SUB_CURRENT)/include/openssl/fipskey.h.in \
|
---|
48 | $(PATH_SUB_CURRENT)/include/openssl/lhash.h.in \
|
---|
49 | $(PATH_SUB_CURRENT)/include/openssl/opensslv.h.in \
|
---|
50 | $(PATH_SUB_CURRENT)/include/openssl/ocsp.h.in \
|
---|
51 | $(PATH_SUB_CURRENT)/include/openssl/pkcs12.h.in \
|
---|
52 | $(PATH_SUB_CURRENT)/include/openssl/pkcs7.h.in \
|
---|
53 | $(PATH_SUB_CURRENT)/include/openssl/safestack.h.in \
|
---|
54 | $(PATH_SUB_CURRENT)/include/openssl/srp.h.in \
|
---|
55 | $(PATH_SUB_CURRENT)/include/openssl/ssl.h.in \
|
---|
56 | $(PATH_SUB_CURRENT)/include/openssl/ui.h.in \
|
---|
57 | $(PATH_SUB_CURRENT)/include/openssl/x509.h.in \
|
---|
58 | $(PATH_SUB_CURRENT)/include/openssl/x509_vfy.h.in \
|
---|
59 | $(PATH_SUB_CURRENT)/include/openssl/x509v3.h.in
|
---|
60 |
|
---|
61 | #
|
---|
62 | # Big fat @todo:
|
---|
63 | # I'm too stupid atm to figure out how to get this executed sequentially
|
---|
64 | # instead of getting it expanded and executed at once...
|
---|
65 | #
|
---|
66 | recreate-headers: $(PATH_SUB_CURRENT)/util/dofile.pl \
|
---|
67 | $(OSSL_HDR_TEMPLATES) \
|
---|
68 | recreate-providers-headers
|
---|
69 | $(foreach target, $(VBOX_OSSL_TARGETS), \
|
---|
70 | $(foreach header, $(OSSL_HDR_TEMPLATES), \
|
---|
71 | perl -I$(PATH_SUB_CURRENT)/gen-includes/$(target) \
|
---|
72 | -Mconfigdata $(PATH_SUB_CURRENT)/util/dofile.pl -oMakefile \
|
---|
73 | $(header) > $(PATH_SUB_CURRENT)/gen-includes/$(target)/openssl/$(basename $(notdir $(header)));))
|
---|
74 |
|
---|
75 | #
|
---|
76 | # How to regenerate the openssl-mangling.h
|
---|
77 | #
|
---|
78 | openssl-mangling.h openssl-mangling-new.h: $(VBox-libcrypto_1_TARGET) $(VBox-libssl_1_TARGET) FORCE
|
---|
79 | $(RM) -f -- $@
|
---|
80 | $(APPEND_EXT) -tn $@ \
|
---|
81 | '/* $(DOLLAR)Id: $(DOLLAR) */' \
|
---|
82 | "/** @file" \
|
---|
83 | " * Autogenerate symbol mangling header for openssl." \
|
---|
84 | " */" \
|
---|
85 | "" \
|
---|
86 | "/*" \
|
---|
87 | " * Copyright (C) 2011$(if-expr $(date %Y) > 2011,-$(date %Y),) Oracle Corporation" \
|
---|
88 | " *" \
|
---|
89 | " * This file is part of VirtualBox Open Source Edition (OSE), as" \
|
---|
90 | " * available from http://www.alldomusa.eu.org. This file is free software;" \
|
---|
91 | " * you can redistribute it and/or modify it under the terms of the GNU" \
|
---|
92 | " * General Public License (GPL) as published by the Free Software" \
|
---|
93 | " * Foundation, in version 2 as it comes in the \"COPYING\" file of the" \
|
---|
94 | " * VirtualBox OSE distribution. VirtualBox OSE is distributed in the" \
|
---|
95 | " * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind." \
|
---|
96 | " *" \
|
---|
97 | " * The contents of this file may alternatively be used under the terms" \
|
---|
98 | " * of the Common Development and Distribution License Version 1.0" \
|
---|
99 | " * (CDDL) only, as it comes in the \"COPYING.CDDL\" file of the" \
|
---|
100 | " * VirtualBox OSE distribution, in which case the provisions of the" \
|
---|
101 | " * CDDL are applicable instead of those of the GPL." \
|
---|
102 | " *" \
|
---|
103 | " * You may elect to license modified versions of this file under the" \
|
---|
104 | " * terms and conditions of either the GPL or the CDDL or both." \
|
---|
105 | " */" \
|
---|
106 | "" \
|
---|
107 | "#ifndef ___openssl_mangling_h___" \
|
---|
108 | "#define ___openssl_mangling_h___" \
|
---|
109 | "# ifdef VBOX_IN_EXTPACK" \
|
---|
110 | "# define OPENSSL_MANGLER(a_Name) OracleExtPack_ ## a_Name" \
|
---|
111 | "# define OPENSSL_MANGLER_ASM(a_Name) _OracleExtPack_ ## a_Name" \
|
---|
112 | "# else" \
|
---|
113 | "# define OPENSSL_MANGLER(a_Name) VBox_ ## a_Name" \
|
---|
114 | "# define OPENSSL_MANGLER_ASM(a_Name) _VBox_ ## a_Name" \
|
---|
115 | "# endif"
|
---|
116 | nm $(filter-out FORCE, $+) \
|
---|
117 | | $(SED) \
|
---|
118 | -e '/^[[:xdigit:]][[:xdigit:]]* [TSDBC] /!d' \
|
---|
119 | -e '/\.eh$(DOLLAR)/d' \
|
---|
120 | -e 's/^[^ ]* [TSDBC] $(if $(intersects $(KBUILD_TARGET), darwin os2 win),_,)\([[:alpha:]_].*\)/\1/' \
|
---|
121 | -e 's/[[:space:]]*//g' \
|
---|
122 | -e 's/^VBox_//' \
|
---|
123 | | sort \
|
---|
124 | | $(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 $@
|
---|
125 | $(APPEND_EXT) -n $@ \
|
---|
126 | "#endif" \
|
---|
127 | ""
|
---|
128 |
|
---|
129 | #
|
---|
130 | # Lists unmangled symbols.
|
---|
131 | #
|
---|
132 | .PHONY: check-openssl-mangling
|
---|
133 | check-openssl-mangling: \
|
---|
134 | $(VBox-libcrypto_1_TARGET) \
|
---|
135 | $(VBox-libssl_1_TARGET) \
|
---|
136 | $(VBoxExtPack-libcrypto_1_TARGET) \
|
---|
137 | $(VBoxExtPack-libssl_1_TARGET) FORCE
|
---|
138 | nm $(VBox-libcrypto_1_TARGET) $(VBox-libssl_1_TARGET) \
|
---|
139 | | $(SED) \
|
---|
140 | -e '/^[[:xdigit:]][[:xdigit:]]* [TSDBC] /!d' \
|
---|
141 | -e 's/^[^ ]* [TSDBC] $(if $(intersects $(KBUILD_TARGET), darwin os2 win),_,)\([[:alpha:]_].*\)/\1/' \
|
---|
142 | -e 's/[[:space:]]*//g' \
|
---|
143 | -e '/^VBox_/d' \
|
---|
144 | | sort
|
---|
145 | nm $(VBoxExtPack-libcrypto_1_TARGET) $(VBoxExtPack-libssl_1_TARGET) \
|
---|
146 | | $(SED) \
|
---|
147 | -e '/^[[:xdigit:]][[:xdigit:]]* [TSDBC] /!d' \
|
---|
148 | -e 's/^[^ ]* [TSDBC] $(if $(intersects $(KBUILD_TARGET), darwin os2 win),_,)\([[:alpha:]_].*\)/\1/' \
|
---|
149 | -e 's/[[:space:]]*//g' \
|
---|
150 | -e '/^OracleExtPack_/d' \
|
---|
151 | | sort
|
---|