@@ -165,13 +165,17 @@ pre_initialize_variables () {
165165 PSA_CORE_PATH=' tf-psa-crypto/core'
166166 BUILTIN_SRC_PATH=' tf-psa-crypto/drivers/builtin/src'
167167 CONFIG_TEST_DRIVER_H=' tf-psa-crypto/tests/configs/crypto_config_test_driver.h'
168+ MBEDTLS_ROOT_DIR=" $PWD "
169+ TF_PSA_CRYPTO_ROOT_DIR=" $PWD /tf-psa-crypto"
168170 fi
169171 config_files=" $CONFIG_H $CRYPTO_CONFIG_H $CONFIG_TEST_DRIVER_H "
170172 else
171173 CRYPTO_CONFIG_H=' include/psa/crypto_config.h'
172174 PSA_CORE_PATH=' core'
173175 BUILTIN_SRC_PATH=' drivers/builtin/src'
174176 CONFIG_TEST_DRIVER_H=' tests/configs/config_test_driver.h'
177+ TF_PSA_CRYPTO_ROOT_DIR=" $PWD "
178+ MBEDTLS_ROOT_DIR=" "
175179
176180 config_files=" $CRYPTO_CONFIG_H $CONFIG_TEST_DRIVER_H "
177181 fi
@@ -214,7 +218,7 @@ pre_initialize_variables () {
214218 : ${OPENSSL_NEXT:= " $OPENSSL " }
215219 : ${GNUTLS_CLI:= " gnutls-cli" }
216220 : ${GNUTLS_SERV:= " gnutls-serv" }
217- : ${OUT_OF_SOURCE_DIR:= . / mbedtls_out_of_source_build }
221+ : ${OUT_OF_SOURCE_DIR:= $PWD / out_of_source_build }
218222 : ${ARMC6_BIN_DIR:=/ usr/ bin}
219223 : ${ARM_NONE_EABI_GCC_PREFIX:= arm-none-eabi-}
220224 : ${ARM_LINUX_GNUEABI_GCC_PREFIX:= arm-linux-gnueabi-}
@@ -400,6 +404,11 @@ cleanup()
400404 rm -f programs/test/cmake_package_install/Makefile
401405 rm -f programs/test/cmake_package_install/cmake_package_install
402406
407+ # Remove out of source directory
408+ if in_tf_psa_crypto_repo; then
409+ rm -rf " $OUT_OF_SOURCE_DIR "
410+ fi
411+
403412 # Restore files that may have been clobbered by the job
404413 restore_backed_up_files
405414}
@@ -937,6 +946,10 @@ run_component () {
937946 " ${dd_cmd[@]} "
938947 fi
939948
949+ if in_tf_psa_crypto_repo; then
950+ pre_create_tf_psa_crypto_out_of_source_directory
951+ fi
952+
940953 # Run the component in a subshell, with error trapping and output
941954 # redirection set up based on the relevant options.
942955 if [ $KEEP_GOING -eq 1 ]; then
@@ -975,6 +988,11 @@ run_component () {
975988 unset current_component
976989}
977990
991+ pre_create_tf_psa_crypto_out_of_source_directory () {
992+ rm -rf " $OUT_OF_SOURCE_DIR "
993+ mkdir " $OUT_OF_SOURCE_DIR "
994+ }
995+
978996# ###############################################################
979997# ### Main
980998# ###############################################################
0 commit comments