]> granicus.if.org Git - php/commitdiff
- #47812, undefined symbol: gdJpegGetVersionInt
authorPierre Joye <pajoye@php.net>
Tue, 7 Apr 2009 09:26:22 +0000 (09:26 +0000)
committerPierre Joye <pajoye@php.net>
Tue, 7 Apr 2009 09:26:22 +0000 (09:26 +0000)
- #46015, Build fails with system gd
- enable gd_compat when built using system's gd

ext/gd/config.m4
ext/gd/gd.c
ext/gd/libgd/gd_jpeg.c

index aa4371d191c158a0f1ddf5a1524e25d0bbfe1a5a..70bf7fe180f5192565a96ce9500490b125d3affa 100644 (file)
@@ -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
index 4e477ba90a2a521a6bdbf74f0d31bee2ee8824aa..8525e143097cfb6357644385a113212eca1054a2 100644 (file)
 #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 <gdfontmb.h> /* 3 Medium bold font */
 #include <gdfontl.h>  /* 4 Large font */
 #include <gdfontg.h>  /* 5 Giant font */
-#include <gdhelpers.h>
 
 #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);
        }
index a71469137f2870363ee29c7ed08de169e919db2a..0d9bae151cc38eda52e3df9667d818ff168a62bb 100644 (file)
@@ -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