#!/bin/sh
# autopkgtest check: Build and run a program against ITL, to verify that the
# headers and pkg-config file are installed correctly

set -e

WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > itltest.c
#include <itl/prayer.h>

int main(int argc, char **argv)
{
  Method m;
  getMethod(0, &m);
  return 0;
}
EOF

gcc -o itltest itltest.c  -litl -lm
#gcc -o itltest itltest.c `pkg-config --cflags --libs itl`
echo "build: OK"
[ -x itltest ]
./itltest
echo "run: OK"
