From: Pierre Joye Date: Tue, 7 Apr 2009 09:26:22 +0000 (+0000) Subject: - #47812, undefined symbol: gdJpegGetVersionInt X-Git-Tag: php-5.3.0RC2~206 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=039a1546332f567d80b73c0f765c07f0215136e3;p=php - #47812, undefined symbol: gdJpegGetVersionInt - #46015, Build fails with system gd - enable gd_compat when built using system's gd --- diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index aa4371d191..70bf7fe180 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -184,6 +184,7 @@ AC_DEFUN([PHP_GD_FREETYPE2],[ PHP_ADD_INCLUDE($FREETYPE2_INC_DIR) AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ]) AC_DEFINE(HAVE_LIBFREETYPE,1,[ ]) + AC_DEFINE(ENABLE_GD_TTF,1,[ ]) ],[ AC_MSG_ERROR([Problem with freetype.(a|so). Please check config.log for more information.]) ],[ @@ -328,7 +329,8 @@ dnl enable the support in bundled GD library if test -n "$FREETYPE2_DIR"; then AC_DEFINE(HAVE_GD_STRINGFT, 1, [ ]) AC_DEFINE(HAVE_GD_STRINGFTEX, 1, [ ]) - GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_LIBFREETYPE" + AC_DEFINE(ENABLE_GD_TTF, 1, [ ]) + GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_LIBFREETYPE -DENABLE_GD_TTF" fi if test -n "$USE_GD_JIS_CONV"; then @@ -340,7 +342,7 @@ else if test "$PHP_GD" != "no"; then GD_MODULE_TYPE=external - extra_sources="gdcache.c" + extra_sources="gdcache.c libgd/gd_compat.c" dnl Various checks for GD features PHP_GD_ZLIB diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 4e477ba90a..8525e14309 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -54,6 +54,10 @@ #endif #if HAVE_LIBGD +#if !HAVE_GD_BUNDLED +# include "libgd/gd_compat.h" +#endif + static int le_gd, le_gd_font; #if HAVE_LIBT1 @@ -69,7 +73,6 @@ static void php_free_ps_enc(zend_rsrc_list_entry *rsrc TSRMLS_DC); #include /* 3 Medium bold font */ #include /* 4 Large font */ #include /* 5 Giant font */ -#include #ifdef HAVE_GD_WBMP #include "libgd/wbmp.h" @@ -1294,7 +1297,7 @@ PHP_MINFO_FUNCTION(gd) #ifdef HAVE_GD_JPG { char tmp[12]; - snprintf(tmp, sizeof(tmp), "%d", gdJpegGetVersionInt()); + snprintf(tmp, sizeof(tmp), "%s", gdJpegGetVersionString()); php_info_print_table_row(2, "JPEG Support", "enabled"); php_info_print_table_row(2, "libJPEG Version", tmp); } diff --git a/ext/gd/libgd/gd_jpeg.c b/ext/gd/libgd/gd_jpeg.c index a71469137f..0d9bae151c 100644 --- a/ext/gd/libgd/gd_jpeg.c +++ b/ext/gd/libgd/gd_jpeg.c @@ -107,6 +107,18 @@ int gdJpegGetVersionInt() return JPEG_LIB_VERSION; } +const char * gdJpegGetVersionString() +{ + switch(JPEG_LIB_VERSION) { + case 62: + return "6b"; + break; + default: + return "unknown"; + } +} + + /* * Write IM to OUTFILE as a JFIF-formatted JPEG image, using quality * QUALITY. If QUALITY is in the range 0-100, increasing values