blob: 2702bfa134e8b9beae3fd959bb1f73eb704c1dbc [file] [log] [blame]
Bill Roberts3cc48e42024-03-25 08:52:47 -05001#!/bin/sh
2#
3# Copyright The Mbed TLS Contributors
4# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
5#
6# Purpose
7#
8# Test pkgconfig files.
9#
10# For each of the build pkg-config files, .pc files, check that
11# they validate and do some basic sanity testing on the output,
12# i.e. that the strings are non-empty.
13#
14# NOTE: This requires the built pc files to be on the pkg-config
15# search path, this can be controlled with env variable
16# PKG_CONFIG_PATH. See man(1) pkg-config for details.
17#
18
19set -e -u
20
21# These are the EXPECTED package names. Renaming these could break
22# consumers of pkg-config, consider carefully.
23all_pcs="mbedtls mbedx509 mbedcrypto"
24
25for pc in $all_pcs; do
26 printf "testing package config file: ${pc} ... "
27 pkg-config --validate "${pc}"
28 version="$(pkg-config --modversion "${pc}")"
29 test -n "$version"
30 cflags="$(pkg-config --cflags "${pc}")"
31 test -n "$cflags"
32 libs="$(pkg-config --libs "${pc}")"
33 test -n "$libs"
34 printf "passed\n"
35done
36
37exit 0