File: pkgconfig.sh

package info (click to toggle)
mbedtls 3.6.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 50,424 kB
  • sloc: ansic: 164,526; sh: 25,295; python: 14,825; makefile: 2,761; perl: 1,043; tcl: 4
file content (40 lines) | stat: -rwxr-xr-x 991 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
#
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# Purpose
#
# Test pkgconfig files.
#
# For each of the build pkg-config files, .pc files, check that
# they validate and do some basic sanity testing on the output,
# i.e. that the strings are non-empty.
#
# NOTE: This requires the built pc files to be on the pkg-config
# search path, this can be controlled with env variable
# PKG_CONFIG_PATH. See man(1) pkg-config for details.
#

set -e -u

if [ $# -le 0 ]
then
    echo " [!] No package names specified" >&2
    echo "Usage: $0 <package name 1> <package name 2> ..." >&2
    exit 1
fi

for pc in "$@"; do
    printf "testing package config file: ${pc} ... "
    pkg-config --validate "${pc}"
    version="$(pkg-config --modversion "${pc}")"
    test -n "$version"
    cflags="$(pkg-config --cflags "${pc}")"
    test -n "$cflags"
    libs="$(pkg-config --libs "${pc}")"
    test -n "$libs"
    printf "passed\n"
done

exit 0