From 5b6c405e6ff97bbeab11ee8f53a74d4abb82f3f7 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 16 Jul 2025 17:46:43 +0200 Subject: [PATCH] Make *_config_checks_*.h automatically generated files For the time being, only do this if the generation script `scripts/generate_config_checks.py` exists in the consuming repository. This way we can use this framework revision before the scripts are added to the consuming repositories. Signed-off-by: Gilles Peskine --- scripts/make_generated_files.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/make_generated_files.py b/scripts/make_generated_files.py index 1ca0f2da7..cd60b087f 100755 --- a/scripts/make_generated_files.py +++ b/scripts/make_generated_files.py @@ -10,6 +10,7 @@ Generate the TF-PSA-Crypto generated files """ import argparse import filecmp +import os import shutil import subprocess import sys @@ -66,6 +67,18 @@ def get_generation_script_files(generation_script: str): return files +COMMON_GENERATION_SCRIPTS = [ +] + +# Once the script has been added to both Mbed TLS and TF-PSA-Crypto, +# we can include this unconditionally. +# https://github.com/Mbed-TLS/mbedtls/issues/10305 +if os.path.exists("scripts/generate_config_checks.py"): + COMMON_GENERATION_SCRIPTS.append(GenerationScript( + Path("scripts/generate_config_checks.py"), + get_generation_script_files("scripts/generate_config_checks.py"), + "", None)) + if build_tree.looks_like_tf_psa_crypto_root("."): TF_PSA_CRYPTO_GENERATION_SCRIPTS = [ GenerationScript( @@ -244,6 +257,7 @@ def main(): generation_scripts = MBEDTLS_GENERATION_SCRIPTS else: raise Exception("No support for Mbed TLS 3.6") + generation_scripts += COMMON_GENERATION_SCRIPTS if args.list: files = get_generated_files(generation_scripts)