#!/bin/sh

set -e

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

int main()
{
    return 0;
}
EOF

gcc -o sccptest sccptest.c `pkg-config --cflags --libs libosmo-mtp libosmo-sccp libosmo-xua` -losmocore > /dev/null
echo "build: OK"
[ -x sccptest ]
# > /dev/null because it writes this: full talloc report on 'sccp' (total      1 bytes in   1 blocks)
./sccptest 2> /dev/null
echo "run: OK"

