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

cd src

if [ "$SAGE_DEBUG" = yes ]; then
    CYSIGNALS_CONFIGURE="--enable-debug $CYSIGNALS_CONFIGURE"
fi

./configure $CYSIGNALS_CONFIGURE
if [ $? -ne 0 ]; then
    echo "Error configuring cysignals ... exiting"
    exit 1
fi

sdh_pip_install .
if [ $? -ne 0 ]; then
    echo "Error installing cysignals ... exiting"
    exit 1
fi
