#!/bin/sh -ex

# Some of the Debian patches touch the build system, so
autoreconf -f -i

./configure \
    --disable-doxygen-doc \
    --disable-apache-13 \
    --disable-apache-20 \
    --disable-apache-22 \
    --disable-apache-24

# Work around the make dependency:
touch shibsp/libshibsp.la

# Replace the linker option:
make shibsptest_LDADD="$(pkg-config --libs shibsp opensaml xmltooling xerces-c)" VERBOSE=1 -C unittests check || ret=$?

if [ "$AUTOPKGTEST_ARTIFACTS" ]; then
    mv unittests/*.log unittests/*.trs "$AUTOPKGTEST_ARTIFACTS"
fi

exit $ret
