###############################################################################
#
# FLINT Sage install script
#
###############################################################################
if [ "$SAGE_DEBUG" = "yes" ]; then
    echo "Building a debug version of FLINT."
    CFLAGS="-O0 -g $CFLAGS"; export CFLAGS
    FLINT_TUNE=" $FLINT_TUNE"; export FLINT_TUNE
    FLINT_CONFIGURE="--enable-assert $FLINT_CONFIGURE"
fi

cd src

echo "Configuring FLINT."
./configure \
    --disable-static \
    --prefix="$SAGE_LOCAL" \
    $SAGE_CONFIGURE_GMP \
    $SAGE_CONFIGURE_MPFR \
    --with-ntl="$SAGE_NTL_PREFIX" \
    $FLINT_CONFIGURE || sdh_die "Error: Failed to configure FLINT."

sdh_make verbose

echo "Deleting old FLINT files."
rm -f $SAGE_LOCAL/lib/libflint*
rm -rf $SAGE_LOCAL/include/flint

sdh_make_install
