summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/gd/config.m415
-rw-r--r--ext/gd/gdttf.c6
-rw-r--r--stamp-h.in1
3 files changed, 19 insertions, 3 deletions
diff --git a/ext/gd/config.m4 b/ext/gd/config.m4
index 8d6d819ecb..51fac09457 100644
--- a/ext/gd/config.m4
+++ b/ext/gd/config.m4
@@ -90,6 +90,21 @@ dnl A whole whack of possible places where this might be
],[
AC_CHECK_LIB(gd, gdImageLine)
AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13) ])
+ if test "$ac_cv_lib_gd_gdImageLine" = "yes"; then
+ old_LIBS=$LIBS
+ AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13) ])
+ LIBS="$LIBS -lpng -lz"
+ AC_CHECK_LIB(gd, gdImageColorResolve, [AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE,1)])
+ AC_CHECK_LIB(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG, 1)])
+
+ LIBS=$old_LIBS
+ LDFLAGS=$old_LDFLAGS
+ if test "$ac_cv_lib_gd_gdImageCreateFromPng" = "yes"; then
+ AC_ADD_LIBRARY(png)
+ AC_ADD_LIBRARY(z)
+ fi
+ ac_cv_lib_gd_gdImageLine=yes
+ fi
])
if test "$ac_cv_lib_gd_gdImageLine" = "yes"; then
CHECK_TTF="yes"
diff --git a/ext/gd/gdttf.c b/ext/gd/gdttf.c
index f2c1a03a9a..df1e549734 100644
--- a/ext/gd/gdttf.c
+++ b/ext/gd/gdttf.c
@@ -149,10 +149,9 @@ static void bitmapRelease( void *element );
/* local prototype */
char *gdttfchar(gdImage *im, int fg, font_t *font, int x, int y, TT_F26Dot6 x1, TT_F26Dot6 y1, TT_F26Dot6 *advance, TT_BBox **bbox, char **next);
-/* This prototype is missing from gd.h */
-/* FIXME Since when does GD have this function??? My copy of 1.3 doesnt
+#ifndef HAVE_GDIMAGECOLORRESOLVE
+
int gdImageColorResolve(gdImagePtr im, int r, int g, int b);
-*/
/********************************************************************/
/* gdImageColorResolve is a replacement for the old fragment: */
@@ -203,6 +202,7 @@ gdImageColorResolve(gdImagePtr im, int r, int g, int b)
im->open [op] = 0;
return op; /* Return newly allocated color */
}
+#endif
/********************************************************************
* gdTcl_UtfToUniChar is borrowed from ...
diff --git a/stamp-h.in b/stamp-h.in
index e69de29bb2..9788f70238 100644
--- a/stamp-h.in
+++ b/stamp-h.in
@@ -0,0 +1 @@
+timestamp