| 1 |
#!/bin/sh |
| 2 |
# autopkgtest check: Build and run a program against fribidi, to verify that the |
| 3 |
# headers and pkg-config file are installed correctly |
| 4 |
|
| 5 |
set -e |
| 6 |
|
| 7 |
if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then |
| 8 |
CC="$DEB_HOST_GNU_TYPE-gcc" |
| 9 |
PKGCONFIG="$DEB_HOST_GNU_TYPE-pkg-config" |
| 10 |
else |
| 11 |
CC=gcc |
| 12 |
PKGCONFIG=pkg-config |
| 13 |
fi |
| 14 |
|
| 15 |
WORKDIR=$(mktemp -d) |
| 16 |
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM |
| 17 |
cd $WORKDIR |
| 18 |
cat <<EOF > fribiditest.c |
| 19 |
#include <fribidi.h> |
| 20 |
#include <stdio.h> |
| 21 |
|
| 22 |
int main(int argc, char **argv) |
| 23 |
{ |
| 24 |
printf("%s\n", fribidi_version_info); |
| 25 |
return 0; |
| 26 |
} |
| 27 |
EOF |
| 28 |
|
| 29 |
"$CC" -o fribiditest fribiditest.c `"$PKGCONFIG" --cflags --libs fribidi` |
| 30 |
echo "build: OK" |
| 31 |
[ -x fribiditest ] |
| 32 |
./fribiditest |
| 33 |
echo "run: OK" |