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 41 42 43 44
|
#!/bin/sh
# Copyright © 2019-2023 Collabora Ltd.
# SPDX-License-Identifier: BSD-2-Clause
# (see debian/copyright)
# Check that the library can be linked by using pkgconf in the most
# obvious way.
set -e
set -u
set -x
if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
else
CROSS_COMPILE=
fi
CC="${CROSS_COMPILE}gcc"
PKG_CONFIG="${CROSS_COMPILE}pkgconf"
tempdir="$(mktemp -d)"
cd "$tempdir"
cat > trivial.c <<'EOF'
#undef NDEBUG
#include <assert.h>
#include <waffle.h>
int main (void)
{
assert (waffle_enum_to_string (WAFFLE_DONT_CARE) != NULL);
return 0;
}
EOF
# Deliberately word-splitting pkgconf output
# shellcheck disable=SC2046
"$CC" -o trivial trivial.c $("$PKG_CONFIG" --cflags --libs waffle-1)
test -x trivial
./trivial
rm -fr "$tempdir"
|