cd src

# Use newer version of config.guess and config.sub (see Trac #23847)
cp "$SAGE_ROOT"/config/config.* config

./configure --prefix="$SAGE_LOCAL" \
            --libdir="$SAGE_LOCAL/lib" \
            --with-lisp=ecl
if [ $? -ne 0 ]; then
    echo >&2 "Error configuring fricas."
    exit 1
fi

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

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