From 4870e613f87face18f7b9eee846137225cb3c64a Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Thu, 17 Oct 2024 17:49:57 +0200 Subject: [PATCH] Refactor pkgconfig.sh Refactor pkgconfig.sh to be able to use it for Mbed TLS and TF-PSA-Crypto packages. Signed-off-by: Ronald Cron --- tests/scripts/components-build-system.sh | 6 +++++- tests/scripts/pkgconfig.sh | 11 +++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/scripts/components-build-system.sh b/tests/scripts/components-build-system.sh index a2c32f7e57..5467b604a9 100644 --- a/tests/scripts/components-build-system.sh +++ b/tests/scripts/components-build-system.sh @@ -135,7 +135,11 @@ component_test_cmake_as_package () { make ./cmake_package if [[ "$OSTYPE" == linux* ]]; then - PKG_CONFIG_PATH="${build_variant_dir}/mbedtls/pkgconfig" ${root_dir}/tests/scripts/pkgconfig.sh + PKG_CONFIG_PATH="${build_variant_dir}/mbedtls/pkgconfig" \ + ${root_dir}/tests/scripts/pkgconfig.sh \ + mbedtls mbedx509 mbedcrypto + # These are the EXPECTED package names. Renaming these could break + # consumers of pkg-config, consider carefully. fi } diff --git a/tests/scripts/pkgconfig.sh b/tests/scripts/pkgconfig.sh index 2702bfa134..07a73b3dae 100755 --- a/tests/scripts/pkgconfig.sh +++ b/tests/scripts/pkgconfig.sh @@ -18,11 +18,14 @@ set -e -u -# These are the EXPECTED package names. Renaming these could break -# consumers of pkg-config, consider carefully. -all_pcs="mbedtls mbedx509 mbedcrypto" +if [ $# -le 0 ] +then + echo " [!] No package names specified" >&2 + echo "Usage: $0 ..." >&2 + exit 1 +fi -for pc in $all_pcs; do +for pc in "$@"; do printf "testing package config file: ${pc} ... " pkg-config --validate "${pc}" version="$(pkg-config --modversion "${pc}")"