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
|
#!/bin/sh
# autopkgtest check: Build and run a program against libspeexdsp,
# 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 <<EOF > libspeexdsp_test.c
#include <stddef.h>
#include <speex/speex_resampler.h>
int main(void)
{
SpeexResamplerState *st = speex_resampler_init(1, 48000, 48000, 4, NULL);
return 0;
}
EOF
# deliberately word-splitting pkg-config output:
# shellcheck disable=SC2046
"${CROSS_COMPILE}gcc" -o libspeexdsp_test libspeexdsp_test.c \
$("${CROSS_COMPILE}pkg-config" --cflags --libs speexdsp)
echo "build: OK"
[ -x libspeexdsp_test ]
./libspeexdsp_test
echo "run: OK"
|