# Critical to get rid of old versions, since they will break the install, since
# at some point one of the libraries accidently links against what's in SAGE_LOCAL,
# instead of what is in the build directory!
rm "$SAGE_LOCAL"/lib/libgd.*

cd src

export CFLAGS="-g $CFLAGS"

# We explicitly disable X and fontconfig support, since (1) X is not a SAGE dependency,
# and (2) the gd build fails on a lot of OS X PPC machines when X is enabled.
sdh_configure --without-jpeg --without-xpm --without-x --without-fontconfig \
              --with-zlib="$SAGE_LOCAL" --with-freetype="$SAGE_LOCAL" \
              $LIBGD_CONFIGURE
sdh_make
sdh_make_install
