if [ -z "$SAGE_LOCAL" ]; then
    echo >&2 "Error: SAGE_LOCAL undefined - exiting..."
    echo >&2 "Maybe run 'sage -sh'?"
    exit 1
fi

# unset RM since it messes with libtool
unset RM

# We don't have to (again) set up CFLAGS etc. here, as 'configure' puts
# them into the Makefiles.

cd src

echo
echo "Now building and running MPFR's test suite..."
$MAKE check
if [ $? -ne 0 ]; then
    echo >&2 "Error building or running MPFR's test suite."
    exit 1
fi
echo
echo "MPFR's test suite passed without errors."
