Skip to content

Commit

Permalink
rework gd defines
Browse files Browse the repository at this point in the history
USE_GD_GIF, USE_GD_PNG, USE_GD_JPEG are now checked for
USE_GD_FT is removed
  • Loading branch information
tbonfort committed May 22, 2012
1 parent ce99505 commit a7502f9
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 6 deletions.
28 changes: 27 additions & 1 deletion configure
Expand Up @@ -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"

Expand Down
26 changes: 25 additions & 1 deletion configure.in
Expand Up @@ -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`)
Expand Down
4 changes: 0 additions & 4 deletions mapgd.c
Expand Up @@ -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)
Expand Down

0 comments on commit a7502f9

Please sign in to comment.