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 libxml2, to verify that the
# headers and pkg-config file are installed correctly
# (C) 2012 Canonical Ltd.
# Author: Daniel Holbach <daniel.holbach@ubuntu.com>
# Picca Frédéric-Emmnauel <picca@debian.org>
set -e
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > hkltest.c
#include <hkl.h>
int
main(void)
{
size_t n;
HklFactory **factory = hkl_factory_get_all(&n);
if (factory == NULL)
return (1);
return (0);
}
EOF
gcc -o hkltest hkltest.c `pkg-config --cflags --libs hkl`
echo "build: OK"
[ -x hkltest ]
./hkltest
echo "run: OK"
|