cd src

# Unset CC and CFLAGS.  This will make mpc use the same configuration
# as MPIR, which is probably a good thing.
unset CC
unset CFLAGS


EXTRA=""

if [ $UNAME = "CYGWIN" ]; then
    EXTRA="--disable-static --enable-shared"
fi

# Building
sdh_configure --with-gmp="$SAGE_LOCAL" --with-mpfr="$SAGE_LOCAL" $EXTRA
sdh_make

# Cleaning
echo "Deleting old headers"
rm -f "$SAGE_LOCAL"/include/mpc.h
# Do not delete old libraries as this causes gcc to break during
# parallel builds.
# echo "Deleting old libraries"
# rm -f "$SAGE_LOCAL"/lib/libmpc.*

# Installing
sdh_make_install
