Skip to content

Commit 7e5b36d

Browse files
committed
check_names.py: support both development and 3.6 branches
Signed-off-by: Valerio Setti <[email protected]>
1 parent 93aa7c4 commit 7e5b36d

File tree

1 file changed

+105
-65
lines changed

1 file changed

+105
-65
lines changed

scripts/check_names.py

Lines changed: 105 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import subprocess
4545
import logging
4646

47-
import scripts_path # pylint: disable=unused-import
47+
import project_scripts # pylint: disable=unused-import
4848
from mbedtls_framework import build_tree
4949

5050

@@ -235,70 +235,110 @@ def comprehensive_parse(self):
235235
)
236236

237237
all_macros = {"public": [], "internal": [], "private":[]}
238-
all_macros["public"] = self.parse_macros([
239-
"include/mbedtls/*.h",
240-
"include/psa/*.h",
241-
"tf-psa-crypto/include/psa/*.h",
242-
"tf-psa-crypto/include/tf-psa-crypto/*.h",
243-
"tf-psa-crypto/drivers/builtin/include/mbedtls/*.h",
244-
"tf-psa-crypto/drivers/everest/include/everest/everest.h",
245-
"tf-psa-crypto/drivers/everest/include/everest/x25519.h"
246-
])
247-
all_macros["internal"] = self.parse_macros([
248-
"library/*.h",
249-
"tf-psa-crypto/core/*.h",
250-
"tf-psa-crypto/drivers/builtin/src/*.h",
251-
"framework/tests/include/test/drivers/*.h",
252-
])
253-
all_macros["private"] = self.parse_macros([
254-
"library/*.c",
255-
"tf-psa-crypto/core/*.c",
256-
"tf-psa-crypto/drivers/builtin/src/*.c",
257-
])
258-
enum_consts = self.parse_enum_consts([
259-
"include/mbedtls/*.h",
260-
"include/psa/*.h",
261-
"tf-psa-crypto/include/psa/*.h",
262-
"tf-psa-crypto/include/tf-psa-crypto/*.h",
263-
"tf-psa-crypto/drivers/builtin/include/mbedtls/*.h",
264-
"library/*.h",
265-
"tf-psa-crypto/core/*.h",
266-
"tf-psa-crypto/drivers/builtin/src/*.h",
267-
"library/*.c",
268-
"tf-psa-crypto/core/*.c",
269-
"tf-psa-crypto/drivers/builtin/src/*.c",
270-
"tf-psa-crypto/drivers/everest/include/everest/everest.h",
271-
"tf-psa-crypto/drivers/everest/include/everest/x25519.h"
272-
])
273-
identifiers, excluded_identifiers = self.parse_identifiers([
274-
"include/mbedtls/*.h",
275-
"include/psa/*.h",
276-
"tf-psa-crypto/include/psa/*.h",
277-
"tf-psa-crypto/include/tf-psa-crypto/*.h",
278-
"tf-psa-crypto/drivers/builtin/include/mbedtls/*.h",
279-
"library/*.h",
280-
"tf-psa-crypto/core/*.h",
281-
"tf-psa-crypto/drivers/builtin/src/*.h",
282-
"tf-psa-crypto/drivers/everest/include/everest/everest.h",
283-
"tf-psa-crypto/drivers/everest/include/everest/x25519.h"
284-
], ["tf-psa-crypto/drivers/p256-m/p256-m/p256-m.h"])
285-
mbed_psa_words = self.parse_mbed_psa_words([
286-
"include/mbedtls/*.h",
287-
"include/psa/*.h",
288-
"tf-psa-crypto/include/psa/*.h",
289-
"tf-psa-crypto/include/tf-psa-crypto/*.h",
290-
"tf-psa-crypto/drivers/builtin/include/mbedtls/*.h",
291-
"library/*.h",
292-
"tf-psa-crypto/core/*.h",
293-
"tf-psa-crypto/drivers/builtin/src/*.h",
294-
"tf-psa-crypto/drivers/everest/include/everest/everest.h",
295-
"tf-psa-crypto/drivers/everest/include/everest/x25519.h",
296-
"library/*.c",
297-
"tf-psa-crypto/core/*.c",
298-
"tf-psa-crypto/drivers/builtin/src/*.c",
299-
"tf-psa-crypto/drivers/everest/library/everest.c",
300-
"tf-psa-crypto/drivers/everest/library/x25519.c"
301-
], ["tf-psa-crypto/core/psa_crypto_driver_wrappers.h"])
238+
if build_tree.is_mbedtls_3_6():
239+
all_macros["public"] = self.parse_macros([
240+
"include/mbedtls/*.h",
241+
"include/psa/*.h",
242+
"3rdparty/everest/include/everest/everest.h",
243+
"3rdparty/everest/include/everest/x25519.h"
244+
])
245+
all_macros["internal"] = self.parse_macros([
246+
"library/*.h",
247+
"framework/tests/include/test/drivers/*.h",
248+
])
249+
all_macros["private"] = self.parse_macros([
250+
"library/*.c",
251+
])
252+
enum_consts = self.parse_enum_consts([
253+
"include/mbedtls/*.h",
254+
"include/psa/*.h",
255+
"library/*.h",
256+
"library/*.c",
257+
"3rdparty/everest/include/everest/everest.h",
258+
"3rdparty/everest/include/everest/x25519.h"
259+
])
260+
identifiers, excluded_identifiers = self.parse_identifiers([
261+
"include/mbedtls/*.h",
262+
"include/psa/*.h",
263+
"library/*.h",
264+
"3rdparty/everest/include/everest/everest.h",
265+
"3rdparty/everest/include/everest/x25519.h"
266+
], ["3rdparty/p256-m/p256-m/p256-m.h"])
267+
mbed_psa_words = self.parse_mbed_psa_words([
268+
"include/mbedtls/*.h",
269+
"include/psa/*.h",
270+
"library/*.h",
271+
"3rdparty/everest/include/everest/everest.h",
272+
"3rdparty/everest/include/everest/x25519.h",
273+
"library/*.c",
274+
"3rdparty/everest/library/everest.c",
275+
"3rdparty/everest/library/x25519.c"
276+
], ["library/psa_crypto_driver_wrappers.h"])
277+
else:
278+
all_macros["public"] = self.parse_macros([
279+
"include/mbedtls/*.h",
280+
"include/psa/*.h",
281+
"tf-psa-crypto/include/psa/*.h",
282+
"tf-psa-crypto/include/tf-psa-crypto/*.h",
283+
"tf-psa-crypto/drivers/builtin/include/mbedtls/*.h",
284+
"tf-psa-crypto/drivers/everest/include/everest/everest.h",
285+
"tf-psa-crypto/drivers/everest/include/everest/x25519.h"
286+
])
287+
all_macros["internal"] = self.parse_macros([
288+
"library/*.h",
289+
"tf-psa-crypto/core/*.h",
290+
"tf-psa-crypto/drivers/builtin/src/*.h",
291+
"framework/tests/include/test/drivers/*.h",
292+
])
293+
all_macros["private"] = self.parse_macros([
294+
"library/*.c",
295+
"tf-psa-crypto/core/*.c",
296+
"tf-psa-crypto/drivers/builtin/src/*.c",
297+
])
298+
enum_consts = self.parse_enum_consts([
299+
"include/mbedtls/*.h",
300+
"include/psa/*.h",
301+
"tf-psa-crypto/include/psa/*.h",
302+
"tf-psa-crypto/include/tf-psa-crypto/*.h",
303+
"tf-psa-crypto/drivers/builtin/include/mbedtls/*.h",
304+
"library/*.h",
305+
"tf-psa-crypto/core/*.h",
306+
"tf-psa-crypto/drivers/builtin/src/*.h",
307+
"library/*.c",
308+
"tf-psa-crypto/core/*.c",
309+
"tf-psa-crypto/drivers/builtin/src/*.c",
310+
"tf-psa-crypto/drivers/everest/include/everest/everest.h",
311+
"tf-psa-crypto/drivers/everest/include/everest/x25519.h"
312+
])
313+
identifiers, excluded_identifiers = self.parse_identifiers([
314+
"include/mbedtls/*.h",
315+
"include/psa/*.h",
316+
"tf-psa-crypto/include/psa/*.h",
317+
"tf-psa-crypto/include/tf-psa-crypto/*.h",
318+
"tf-psa-crypto/drivers/builtin/include/mbedtls/*.h",
319+
"library/*.h",
320+
"tf-psa-crypto/core/*.h",
321+
"tf-psa-crypto/drivers/builtin/src/*.h",
322+
"tf-psa-crypto/drivers/everest/include/everest/everest.h",
323+
"tf-psa-crypto/drivers/everest/include/everest/x25519.h"
324+
], ["tf-psa-crypto/drivers/p256-m/p256-m/p256-m.h"])
325+
mbed_psa_words = self.parse_mbed_psa_words([
326+
"include/mbedtls/*.h",
327+
"include/psa/*.h",
328+
"tf-psa-crypto/include/psa/*.h",
329+
"tf-psa-crypto/include/tf-psa-crypto/*.h",
330+
"tf-psa-crypto/drivers/builtin/include/mbedtls/*.h",
331+
"library/*.h",
332+
"tf-psa-crypto/core/*.h",
333+
"tf-psa-crypto/drivers/builtin/src/*.h",
334+
"tf-psa-crypto/drivers/everest/include/everest/everest.h",
335+
"tf-psa-crypto/drivers/everest/include/everest/x25519.h",
336+
"library/*.c",
337+
"tf-psa-crypto/core/*.c",
338+
"tf-psa-crypto/drivers/builtin/src/*.c",
339+
"tf-psa-crypto/drivers/everest/library/everest.c",
340+
"tf-psa-crypto/drivers/everest/library/x25519.c"
341+
], ["tf-psa-crypto/core/psa_crypto_driver_wrappers.h"])
302342
symbols = self.parse_symbols()
303343

304344
# Remove identifier macros like mbedtls_printf or mbedtls_calloc

0 commit comments

Comments
 (0)