|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-09-07 07:21 UTC] Fedora at FamilleCollet dot com
Description: ------------ Build fails when trying to use system GD --with-gd=shared,/usr This is because gdhelpers only provided by bundled library. Trivial patch proposal : --- ext/gd/gd.c.orig 2008-09-07 08:53:38.000000000 +0200 +++ ext/gd/gd.c 2008-09-07 08:54:03.000000000 +0200 @@ -74,7 +74,9 @@ #include <gdfontmb.h> /* 3 Medium bold font */ #include <gdfontl.h> /* 4 Large font */ #include <gdfontg.h> /* 5 Giant font */ +#if HAVE_GD_BUNDLED #include <gdhelpers.h> +#endif #ifdef HAVE_GD_WBMP #include "libgd/wbmp.h" Reproduce code: --------------- make Expected result: ---------------- Build complete. Actual result: -------------- Build failed. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 14:00:01 2025 UTC |
Here's a quick patch that removes support for building against an external libgd and replaces it with an error message. It seems to work as intended but I am by no means experienced with the autoconf system. --- php-5.3.0RC1.orig/ext/gd/config.m4 2009-01-14 13:05:59.000000000 -0600 +++ php-5.3.0RC1/ext/gd/config.m4 2009-03-27 13:42:01.071603975 -0500 @@ -262,7 +262,6 @@ dnl if test "$PHP_GD" = "yes"; then - GD_MODULE_TYPE=builtin extra_sources="libgd/gd.c libgd/gd_gd.c libgd/gd_gd2.c libgd/gd_io.c libgd/gd_io_dp.c \ libgd/gd_io_file.c libgd/gd_ss.c libgd/gd_io_ss.c libgd/gd_png.c libgd/gd_jpeg.c \ libgd/gdxpm.c libgd/gdfontt.c libgd/gdfonts.c libgd/gdfontmb.c libgd/gdfontl.c \ @@ -339,57 +338,7 @@ else if test "$PHP_GD" != "no"; then - GD_MODULE_TYPE=external - extra_sources="gdcache.c" - -dnl Various checks for GD features - PHP_GD_ZLIB - PHP_GD_TTSTR - PHP_GD_JPEG - PHP_GD_PNG - PHP_GD_XPM - PHP_GD_FREETYPE2 - PHP_GD_T1LIB - -dnl Header path - for i in include/gd1.3 include/gd include gd1.3 gd ""; do - test -f "$PHP_GD/$i/gd.h" && GD_INCLUDE="$PHP_GD/$i" - done - -dnl Library path - for i in $PHP_LIBDIR/gd1.3 $PHP_LIBDIR/gd $PHP_LIBDIR gd1.3 gd ""; do - test -f "$PHP_GD/$i/libgd.$SHLIB_SUFFIX_NAME" || test -f "$PHP_GD/$i/libgd.a" && GD_LIB="$PHP_GD/$i" - done - - if test -n "$GD_INCLUDE" && test -n "$GD_LIB"; then - PHP_ADD_LIBRARY_WITH_PATH(gd, $GD_LIB, GD_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBGD,1,[ ]) - PHP_GD_CHECK_VERSION - elif test -z "$GD_INCLUDE"; then - AC_MSG_ERROR([Unable to find gd.h anywhere under $PHP_GD]) - else - AC_MSG_ERROR([Unable to find libgd.(a|so) anywhere under $PHP_GD]) - fi - - PHP_EXPAND_PATH($GD_INCLUDE, GD_INCLUDE) - - dnl - dnl Check for gd 2.0.4 greater availability - dnl - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$GD_INCLUDE - AC_TRY_COMPILE([ -#include <gd.h> -#include <stdlib.h> - ], [ -gdIOCtx *ctx; -ctx = malloc(sizeof(gdIOCtx)); -ctx->gd_free = 1; - ], [ - AC_DEFINE(HAVE_LIBGD204, 1, [ ]) - ]) - CPPFLAGS=$old_CPPFLAGS - + AC_MSG_ERROR([Building the GD extension against an external libgd is not supported.]) fi fi @@ -399,23 +348,13 @@ if test "$PHP_GD" != "no"; then PHP_NEW_EXTENSION(gd, gd.c $extra_sources, $ext_shared,, \\$(GDLIB_CFLAGS)) - if test "$GD_MODULE_TYPE" = "builtin"; then - GDLIB_CFLAGS="-I$ext_srcdir/libgd $GDLIB_CFLAGS" - PHP_ADD_BUILD_DIR($ext_builddir/libgd) - GD_HEADER_DIRS="ext/gd/ ext/gd/libgd/" - - PHP_TEST_BUILD(foobar, [], [ - AC_MSG_ERROR([GD build test failed. Please check the config.log for details.]) - ], [ $GD_SHARED_LIBADD ], [char foobar () {}]) - else - GD_HEADER_DIRS="ext/gd/" - GDLIB_CFLAGS="-I$GD_INCLUDE $GDLIB_CFLAGS" - PHP_ADD_INCLUDE($GD_INCLUDE) - - PHP_CHECK_LIBRARY(gd, gdImageCreate, [], [ - AC_MSG_ERROR([GD build test failed. Please check the config.log for details.]) - ], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - fi + GDLIB_CFLAGS="-I$ext_srcdir/libgd $GDLIB_CFLAGS" + PHP_ADD_BUILD_DIR($ext_builddir/libgd) + GD_HEADER_DIRS="ext/gd/ ext/gd/libgd/" + + PHP_TEST_BUILD(foobar, [], [ + AC_MSG_ERROR([GD build test failed. Please check the config.log for details.]) + ], [ $GD_SHARED_LIBADD ], [char foobar () {}]) PHP_INSTALL_HEADERS([$GD_HEADER_DIRS]) PHP_SUBST(GDLIB_CFLAGS)