#!/bin/sh # autopkgtest check: Build and run a program against libldac, to verify that # the headers and pkg-config file are installed correctly set -e if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then CROSS_COMPILE="$DEB_HOST_GNU_TYPE-" else CROSS_COMPILE= fi cat < libldac_test.c #include #include #include int main(void) { HANDLE_LDAC_BT ldac; assert(ldacBT_get_handle()); return 0; } EOF # deliberately word-splitting pkg-config output: # shellcheck disable=SC2046 "${CROSS_COMPILE}gcc" -o libldac_test libldac_test.c \ $("${CROSS_COMPILE}pkg-config" --cflags --libs ldacBT-enc) echo "build: OK" [ -x libldac_test ] ./libldac_test echo "run: OK"