@@ -2441,15 +2441,21 @@ component_build_psa_config_file () {
24412441component_build_psa_alt_headers () {
24422442 msg " build: make with PSA alt headers" # ~20s
24432443
2444+ PSA_ALT_HDRS=" $PWD /framework/tests/include/alt-extra"
24442445 # Generate alternative versions of the substitutable headers with the
24452446 # same content except different include guards.
2446- make -C tests ../framework/tests/include/alt-extra/psa/crypto_platform_alt.h ../framework/tests/include/alt-extra/psa/crypto_struct_alt.h
2447+ sed -E ' s/^(# *(define|ifndef) +[A-Za-z0-9_]+)_H\b/\1_ALT_H/' \
2448+ tf-psa-crypto/include/psa/crypto_platform.h \
2449+ > $PSA_ALT_HDRS /psa/crypto_platform_alt.h
2450+
2451+ sed -E ' s/^(# *(define|ifndef) +[A-Za-z0-9_]+)_H\b/\1_ALT_H/' \
2452+ tf-psa-crypto/include/psa/crypto_struct.h \
2453+ > $PSA_ALT_HDRS /psa/crypto_struct_alt.h
24472454
24482455 # Build the library and some programs.
2449- # Don't build the fuzzers to avoid having to go through hoops to set
2450- # a correct include path for programs/fuzz/Makefile.
2451- $MAKE_COMMAND CFLAGS=" -I ../framework/tests/include/alt-extra -DMBEDTLS_PSA_CRYPTO_PLATFORM_FILE='\" psa/crypto_platform_alt.h\" ' -DMBEDTLS_PSA_CRYPTO_STRUCT_FILE='\" psa/crypto_struct_alt.h\" '" lib
2452- make -C programs -o fuzz CFLAGS=" -I ../framework/tests/include/alt-extra -DMBEDTLS_PSA_CRYPTO_PLATFORM_FILE='\" psa/crypto_platform_alt.h\" ' -DMBEDTLS_PSA_CRYPTO_STRUCT_FILE='\" psa/crypto_struct_alt.h\" '"
2456+ CFLAGS=" -I$PSA_ALT_HDRS -DMBEDTLS_PSA_CRYPTO_PLATFORM_FILE='\" psa/crypto_platform_alt.h\" ' -DMBEDTLS_PSA_CRYPTO_STRUCT_FILE='\" psa/crypto_struct_alt.h\" '" cmake -D CMAKE_BUILD_TYPE:String=Release .
2457+ cmake --build . --target lib
2458+ cmake --build . --target programs
24532459
24542460 # Check that we're getting the alternative include guards and not the
24552461 # original include guards.
0 commit comments