1 | # $Id: Makefile.kmk 101211 2023-09-21 06:43:35Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the OpenSSL base directory.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox base platform packages, as
|
---|
10 | # available from https://www.virtualbox.org.
|
---|
11 | #
|
---|
12 | # This program is free software; you can redistribute it and/or
|
---|
13 | # modify it under the terms of the GNU General Public License
|
---|
14 | # as published by the Free Software Foundation, in version 3 of the
|
---|
15 | # License.
|
---|
16 | #
|
---|
17 | # This program is distributed in the hope that it will be useful, but
|
---|
18 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | # General Public License for more details.
|
---|
21 | #
|
---|
22 | # You should have received a copy of the GNU General Public License
|
---|
23 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | #
|
---|
25 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | #
|
---|
27 |
|
---|
28 | SUB_DEPTH = ../../..
|
---|
29 | include $(KBUILD_PATH)/subheader.kmk
|
---|
30 |
|
---|
31 | # Make sure our Config.kmk is included.
|
---|
32 | ifndef VBOX_PATH_CRYPTO
|
---|
33 | include $(PATH_SUB_CURRENT)/Config.kmk
|
---|
34 | endif
|
---|
35 |
|
---|
36 | # Include sub-makefiles.
|
---|
37 | include $(PATH_SUB_CURRENT)/providers/Makefile.kmk
|
---|
38 | include $(PATH_SUB_CURRENT)/crypto/Makefile.kmk
|
---|
39 | include $(PATH_SUB_CURRENT)/ssl/Makefile.kmk
|
---|
40 |
|
---|
41 | # Let kBuild generate the rules.
|
---|
42 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
43 |
|
---|
44 | #
|
---|
45 | # Re-creates certain openssl headers which exist as templates.
|
---|
46 | #
|
---|
47 | OSSL_HDR_TEMPLATES := \
|
---|
48 | $(PATH_SUB_CURRENT)/include/openssl/asn1.h.in \
|
---|
49 | $(PATH_SUB_CURRENT)/include/openssl/asn1t.h.in \
|
---|
50 | $(PATH_SUB_CURRENT)/include/openssl/bio.h.in \
|
---|
51 | $(PATH_SUB_CURRENT)/include/openssl/cmp.h.in \
|
---|
52 | $(PATH_SUB_CURRENT)/include/openssl/cms.h.in \
|
---|
53 | $(PATH_SUB_CURRENT)/include/openssl/conf.h.in \
|
---|
54 | $(PATH_SUB_CURRENT)/include/openssl/configuration.h.in \
|
---|
55 | $(PATH_SUB_CURRENT)/include/openssl/crmf.h.in \
|
---|
56 | $(PATH_SUB_CURRENT)/include/openssl/crypto.h.in \
|
---|
57 | $(PATH_SUB_CURRENT)/include/openssl/ct.h.in \
|
---|
58 | $(PATH_SUB_CURRENT)/include/openssl/err.h.in \
|
---|
59 | $(PATH_SUB_CURRENT)/include/openssl/ess.h.in \
|
---|
60 | $(PATH_SUB_CURRENT)/include/openssl/fipskey.h.in \
|
---|
61 | $(PATH_SUB_CURRENT)/include/openssl/lhash.h.in \
|
---|
62 | $(PATH_SUB_CURRENT)/include/openssl/opensslv.h.in \
|
---|
63 | $(PATH_SUB_CURRENT)/include/openssl/ocsp.h.in \
|
---|
64 | $(PATH_SUB_CURRENT)/include/openssl/pkcs12.h.in \
|
---|
65 | $(PATH_SUB_CURRENT)/include/openssl/pkcs7.h.in \
|
---|
66 | $(PATH_SUB_CURRENT)/include/openssl/safestack.h.in \
|
---|
67 | $(PATH_SUB_CURRENT)/include/openssl/srp.h.in \
|
---|
68 | $(PATH_SUB_CURRENT)/include/openssl/ssl.h.in \
|
---|
69 | $(PATH_SUB_CURRENT)/include/openssl/ui.h.in \
|
---|
70 | $(PATH_SUB_CURRENT)/include/openssl/x509.h.in \
|
---|
71 | $(PATH_SUB_CURRENT)/include/openssl/x509_vfy.h.in \
|
---|
72 | $(PATH_SUB_CURRENT)/include/openssl/x509v3.h.in
|
---|
73 |
|
---|
74 | #
|
---|
75 | # Big fat @todo:
|
---|
76 | # I'm too stupid atm to figure out how to get this executed sequentially
|
---|
77 | # instead of getting it expanded and executed at once...
|
---|
78 | #
|
---|
79 | recreate-headers: $(PATH_SUB_CURRENT)/util/dofile.pl \
|
---|
80 | $(OSSL_HDR_TEMPLATES) \
|
---|
81 | recreate-providers-headers
|
---|
82 | $(foreach header, $(OSSL_HDR_TEMPLATES), \
|
---|
83 | perl -I$(PATH_SUB_CURRENT) \
|
---|
84 | -Mconfigdata $(PATH_SUB_CURRENT)/util/dofile.pl -oMakefile \
|
---|
85 | $(header) > $(PATH_SUB_CURRENT)/gen-includes/openssl/$(basename $(notdir $(header)));))
|
---|
86 |
|
---|
87 | #
|
---|
88 | # How to regenerate the openssl-mangling.h
|
---|
89 | #
|
---|
90 | openssl-mangling.h openssl-mangling-new.h: $(VBox-libcrypto_1_TARGET) $(VBox-libssl_1_TARGET) FORCE
|
---|
91 | $(RM) -f -- $@
|
---|
92 | $(APPEND_EXT) -tn $@ \
|
---|
93 | '/* $(DOLLAR)Id: $(DOLLAR) */' \
|
---|
94 | "/** @file" \
|
---|
95 | " * Autogenerate symbol mangling header for openssl." \
|
---|
96 | " */" \
|
---|
97 | "" \
|
---|
98 | "/*" \
|
---|
99 | " * Copyright (C) 2011$(if-expr $(date %Y) > 2011,-$(date %Y),) Oracle and/or its affiliates." \
|
---|
100 | " *" \
|
---|
101 | " * This file is part of VirtualBox base platform packages, as" \
|
---|
102 | " * available from https://www.virtualbox.org." \
|
---|
103 | " *" \
|
---|
104 | " * This program is free software; you can redistribute it and/or" \
|
---|
105 | " * modify it under the terms of the GNU General Public License" \
|
---|
106 | " * as published by the Free Software Foundation, in version 3 of the" \
|
---|
107 | " * License." \
|
---|
108 | " *" \
|
---|
109 | " * This program is distributed in the hope that it will be useful, but" \
|
---|
110 | " * WITHOUT ANY WARRANTY; without even the implied warranty of" \
|
---|
111 | " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU" \
|
---|
112 | " * General Public License for more details." \
|
---|
113 | " *" \
|
---|
114 | " * You should have received a copy of the GNU General Public License" \
|
---|
115 | " * along with this program; if not, see <https://www.gnu.org/licenses>." \
|
---|
116 | " *" \
|
---|
117 | " * SPDX-License-Identifier: GPL-3.0-only" \
|
---|
118 | " */" \
|
---|
119 | "" \
|
---|
120 | "#ifndef ___openssl_mangling_h___" \
|
---|
121 | "#define ___openssl_mangling_h___" \
|
---|
122 | "# ifdef VBOX_IN_EXTPACK" \
|
---|
123 | "# define OPENSSL_MANGLER(a_Name) OracleExtPack_ ## a_Name" \
|
---|
124 | "# define OPENSSL_MANGLER_ASM(a_Name) _OracleExtPack_ ## a_Name" \
|
---|
125 | "# else" \
|
---|
126 | "# define OPENSSL_MANGLER(a_Name) VBox_ ## a_Name" \
|
---|
127 | "# define OPENSSL_MANGLER_ASM(a_Name) _VBox_ ## a_Name" \
|
---|
128 | "# endif"
|
---|
129 | nm $(filter-out FORCE, $+) \
|
---|
130 | | $(SED) \
|
---|
131 | -e '/^[[:xdigit:]][[:xdigit:]]* [TSDBC] /!d' \
|
---|
132 | -e '/\.eh$(DOLLAR)/d' \
|
---|
133 | -e 's/^[^ ]* [TSDBC] $(if $(intersects $(KBUILD_TARGET), darwin os2 win),_,)\([[:alpha:]_].*\)/\1/' \
|
---|
134 | -e 's/[[:space:]]*//g' \
|
---|
135 | -e 's/^VBox_//' \
|
---|
136 | | sort \
|
---|
137 | | $(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 $@
|
---|
138 | $(APPEND_EXT) -n $@ \
|
---|
139 | "#endif" \
|
---|
140 | ""
|
---|
141 |
|
---|
142 | #
|
---|
143 | # Lists unmangled symbols.
|
---|
144 | #
|
---|
145 | .PHONY: check-openssl-mangling
|
---|
146 | check-openssl-mangling: \
|
---|
147 | $(VBox-libcrypto_1_TARGET) \
|
---|
148 | $(VBox-libssl_1_TARGET) \
|
---|
149 | $(VBoxExtPack-libcrypto_1_TARGET) \
|
---|
150 | $(VBoxExtPack-libssl_1_TARGET) FORCE
|
---|
151 | nm $(VBox-libcrypto_1_TARGET) $(VBox-libssl_1_TARGET) \
|
---|
152 | | $(SED) \
|
---|
153 | -e '/^[[:xdigit:]][[:xdigit:]]* [TSDBC] /!d' \
|
---|
154 | -e 's/^[^ ]* [TSDBC] $(if $(intersects $(KBUILD_TARGET), darwin os2 win),_,)\([[:alpha:]_].*\)/\1/' \
|
---|
155 | -e 's/[[:space:]]*//g' \
|
---|
156 | -e '/^VBox_/d' \
|
---|
157 | | sort
|
---|
158 | nm $(VBoxExtPack-libcrypto_1_TARGET) $(VBoxExtPack-libssl_1_TARGET) \
|
---|
159 | | $(SED) \
|
---|
160 | -e '/^[[:xdigit:]][[:xdigit:]]* [TSDBC] /!d' \
|
---|
161 | -e 's/^[^ ]* [TSDBC] $(if $(intersects $(KBUILD_TARGET), darwin os2 win),_,)\([[:alpha:]_].*\)/\1/' \
|
---|
162 | -e 's/[[:space:]]*//g' \
|
---|
163 | -e '/^OracleExtPack_/d' \
|
---|
164 | | sort
|
---|