diff --git a/CMakeLists.txt b/CMakeLists.txt index f56fd681..0936d717 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ project(crypto C) set(SA_CUSTOM_PATH_DEFAULT "../../sa/custom") set(KEY_CUSTOM_PATH_DEFAULT "../../key/custom") set(MC_CUSTOM_PATH_DEFAULT "../../mc/custom") +set(MC_LOG_PATH_DEFAULT "log.txt") set(CRYPTO_CUSTOM_PATH_DEFAULT "../../crypto/custom") @@ -120,6 +121,13 @@ if(DEBUG) add_compile_options(-ggdb) endif() +if(DEFINED MC_LOG_CUSTOM_PATH) + message(STATUS "MC_LOG_CUSTOM_PATH set to: ${MC_LOG_CUSTOM_PATH}") + add_compile_definitions(MC_LOG_PATH="${MC_LOG_CUSTOM_PATH}") +else() + add_compile_definitions(MC_LOG_PATH="${MC_LOG_PATH_DEFAULT}") +endif() + IF(KMC_MDB_RH) ADD_DEFINITIONS(-DKMC_MDB_RH) ADD_DEFINITIONS(-DKMC_CFFI_EXCLUDE) diff --git a/src/mc/internal/mc_interface_internal.template.c b/src/mc/internal/mc_interface_internal.template.c index 170c9e6f..974fd567 100644 --- a/src/mc/internal/mc_interface_internal.template.c +++ b/src/mc/internal/mc_interface_internal.template.c @@ -53,11 +53,11 @@ static int32_t mc_initialize(void) int32_t status = CRYPTO_LIB_SUCCESS; /* Open log */ - mc_file_ptr = fopen("log.txt", "a"); + mc_file_ptr = fopen(MC_LOG_PATH, "a"); if (mc_file_ptr == NULL) { status = CRYPTO_LIB_ERR_MC_INIT; - printf(KRED "ERROR: Monitoring andcontrol initialization - internal failed\n" RESET); + printf(KRED "ERROR: Monitoring and control initialization - internal failed\n" RESET); } return status; diff --git a/support/scripts/build_internal.sh b/support/scripts/build_internal.sh index 7da05ad4..c41dd2c3 100755 --- a/support/scripts/build_internal.sh +++ b/support/scripts/build_internal.sh @@ -9,4 +9,6 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/env.sh +rm $BASE_DIR/CMakeCache.txt + cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DMC_INTERNAL=1 -DTEST=1 -DTEST_ENC=1 -DSA_FILE=1 -DKEY_VALIDATION=0 && make && make test diff --git a/support/scripts/build_kmc.sh b/support/scripts/build_kmc.sh index 95c1489f..2c18bd7a 100755 --- a/support/scripts/build_kmc.sh +++ b/support/scripts/build_kmc.sh @@ -9,4 +9,6 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/env.sh +rm $BASE_DIR/CMakeCache.txt + cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DCRYPTO_KMC=1 -DKEY_KMC=1 -DMC_DISABLED=1 -DSA_MARIADB=1 -DTEST=1 -DTEST_ENC=1 -DKMC_CFFI_EXCLUDE=1 -DSA_FILE=1 && make && make test diff --git a/support/scripts/build_minimal.sh b/support/scripts/build_minimal.sh index c07c09a3..f9781ae7 100755 --- a/support/scripts/build_minimal.sh +++ b/support/scripts/build_minimal.sh @@ -9,4 +9,6 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/env.sh +rm $BASE_DIR/CMakeCache.txt + cmake $BASE_DIR && make && make test diff --git a/support/scripts/build_rhel.sh b/support/scripts/build_rhel.sh index 94053036..9f711589 100755 --- a/support/scripts/build_rhel.sh +++ b/support/scripts/build_rhel.sh @@ -9,4 +9,6 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/env.sh +rm $BASE_DIR/CMakeCache.txt + cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DMC_INTERNAL=1 -DTEST=1 -DTEST_ENC=1 -DSA_FILE=1 && make && make test diff --git a/support/scripts/build_support.sh b/support/scripts/build_support.sh index 4e92ea6c..0392bd8f 100755 --- a/support/scripts/build_support.sh +++ b/support/scripts/build_support.sh @@ -9,4 +9,6 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/env.sh +rm $BASE_DIR/CMakeCache.txt + cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DSUPPORT=1 -DTEST=1 -DTEST_ENC=1 && make && make test diff --git a/support/scripts/build_wolf.sh b/support/scripts/build_wolf.sh index 0cae1611..a646e932 100755 --- a/support/scripts/build_wolf.sh +++ b/support/scripts/build_wolf.sh @@ -9,4 +9,6 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/env.sh +rm $BASE_DIR/CMakeCache.txt + cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DCRYPTO_LIBGCRYPT=0 -DCRYPTO_WOLFSSL=1 -DTEST=1 -DTEST_ENC=1 -DSA_FILE=1 && make && make test