diff --git a/configure b/configure index 194d7dd9d5..2ce3de28c1 100755 --- a/configure +++ b/configure @@ -17094,12 +17094,38 @@ $as_echo "using $GDCONFIG" >&6; } GDMINOR=`$GDCONFIG --minorversion` GDREV=`$GDCONFIG --revision` GDVERSION=`$GDCONFIG --version` + GDFEATURES=`$GDCONFIG --features` + + if test -z "`echo $GDFEATURES | grep 'GD_PNG'`" ; then + as_fn_error $? "supplied GD is missing PNG support" "$LINENO" 5 + else + GD_ENABLED="$GD_ENABLED -DUSE_GD_PNG" + fi + if test -z "`echo $GDFEATURES | grep 'GD_JPEG'`" ; then + as_fn_error $? "supplied GD is missing JPEG support" "$LINENO" 5 + else + GD_ENABLED="$GD_ENABLED -DUSE_GD_JPEG" + fi + if test -z "`echo $GDFEATURES | grep 'GD_GIF'`" ; then + as_fn_error $? "supplied GD is missing GIF support" "$LINENO" 5 + else + GD_ENABLED="$GD_ENABLED -DUSE_GD_GIF" + fi + if test -z "`echo $GDFEATURES | grep 'GD_FREETYPE'`" ; then + as_fn_error $? "supplied GD is missing FT support" "$LINENO" 5 + else + GD_ENABLED="$GD_ENABLED -DUSE_GD_FT" + fi + + if test $GDMAJOR -lt 2 -o $GDMINOR -lt 0 -o $GDREV -lt 28 ; then as_fn_error $? "GD version $GDVERSION too old. need at least 2.0.28" "$LINENO" 5 fi - GD_ENABLED="-DUSE_GD" + + + GD_ENABLED="-DUSE_GD $GD_ENABLED" ALL_ENABLED="$GD_ENABLED $ALL_ENABLED" GD_ENABLED="$GD_ENABLED" diff --git a/configure.in b/configure.in index 5ba5ba3acf..be8e1abec6 100755 --- a/configure.in +++ b/configure.in @@ -484,12 +484,36 @@ AC_DEFUN([MS_CHECK_GD],[ GDMINOR=`$GDCONFIG --minorversion` GDREV=`$GDCONFIG --revision` GDVERSION=`$GDCONFIG --version` + GDFEATURES=`$GDCONFIG --features` + + if test -z "`echo $GDFEATURES | grep 'GD_PNG'`" ; then + AC_MSG_ERROR([supplied GD is missing PNG support]) + else + GD_ENABLED="$GD_ENABLED -DUSE_GD_PNG" + fi + if test -z "`echo $GDFEATURES | grep 'GD_JPEG'`" ; then + AC_MSG_ERROR([supplied GD is missing JPEG support]) + else + GD_ENABLED="$GD_ENABLED -DUSE_GD_JPEG" + fi + if test -z "`echo $GDFEATURES | grep 'GD_GIF'`" ; then + AC_MSG_ERROR([supplied GD is missing GIF support]) + else + GD_ENABLED="$GD_ENABLED -DUSE_GD_GIF" + fi + if test -z "`echo $GDFEATURES | grep 'GD_FREETYPE'`" ; then + AC_MSG_ERROR([supplied GD is missing FT support]) + fi + + if test $GDMAJOR -lt 2 -o $GDMINOR -lt 0 -o $GDREV -lt 28 ; then AC_MSG_ERROR([GD version $GDVERSION too old. need at least 2.0.28]) fi - GD_ENABLED="-DUSE_GD" + + + GD_ENABLED="-DUSE_GD $GD_ENABLED" ALL_ENABLED="$GD_ENABLED $ALL_ENABLED" AC_SUBST(GD_ENABLED, "$GD_ENABLED") AC_SUBST(GD_INC, `$GDCONFIG --includes`) diff --git a/mapgd.c b/mapgd.c index ca604cdd26..024c7e839c 100644 --- a/mapgd.c +++ b/mapgd.c @@ -43,23 +43,19 @@ #endif int msGDSetup() { -#ifdef USE_GD_FT if (gdFontCacheSetup() != 0) { return MS_FAILURE; } -#endif return MS_SUCCESS; } void msGDCleanup(int signal) { -#ifdef USE_GD_FT if(!signal) { /* there's a potential deadlock if we're killed by a signal and the font cache is already locked. We don't tear down the fontcache in this case to avoid it (issue 4093)*/ gdFontCacheShutdown(); } -#endif } #define MS_IMAGE_GET_GDIMAGEPTR(image) ((gdImagePtr) image->img.plugin)