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

cd src

# Configuring
./configure --prefix="$SAGE_LOCAL"
if [ $? -ne 0 ]; then
    echo >&2 "Error configuring yasm."
    exit 1
fi

# Building
$MAKE
if [ $? -ne 0 ]; then
    echo >&2 "Error building yasm."
    exit 1
fi

# Installing
$MAKE install
if [ $? -ne 0 ]; then
    echo >&2 "Error installing yasm."
    exit 1
fi
