#46015 [Asn->Fbk]: Build fails with system gd
| From: | pajoye@php.net | Date: | Tue, 07 Apr 2009 09:27:07 +0000 |
| Subject: | #46015 [Asn->Fbk]: Build fails with system gd | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-135623@lists.php.net to get a copy of this message | ||
ID: 46015
Updated by: pajoye@php.net
Reported By: Fedora at FamilleCollet dot com
-Status: Assigned
+Status: Feedback
Bug Type: GD related
Operating System: Linux (Fedora 9)
PHP Version: 5.3.0alpha2
Assigned To: pajoye
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2009-03-27 18:50:40] tsteiner at nerdclub dot net
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)
------------------------------------------------------------------------
[2009-03-27 18:03:22] tsteiner at nerdclub dot net
This is still an issue in 5.3.0RC1. If building against an external
version of GD is no longer supported, the configure script should
probably be updated to throw an error or at least a warning should one
try to do so. Currently, the build just fails during "make" with the
error:
ext/gd/gd.c:72:23: error: gdhelpers.h: No such file or directory
leaving the user with no idea what to do.
------------------------------------------------------------------------
[2008-12-05 18:53:05] php-bugs-2008 at ryandesign dot com
Thanks for letting us know why specifically the bundled libgd is
superior (the imagefilter and imagerotate functions). Given this, I will
switch MacPorts php5 back to using the bundled libgd.
You must admit however there is room for confusion. The first sentence
on the installation instructions [1] says "If you have the GD library
(available at » http://www.libgd.org/) you will also be able to
create
and manipulate images." And the libgd homepage in turn says "The library
[...] is now maintained by Pierre-A. Joye under the umbrella of
PHP.net." This gives the impression that the standalone libgd is being
developed by the same people who develop PHP's bundled libgd. The note
further down the installation instructions reads "Since PHP 4.3 there is
a bundled version of the GD lib [which] should be used in preference to
the external library since its codebase is better maintained and more
stable." Because PHP 4.3 is so old, someone reading this note might well
assume the information is outdated, and that since libgd is now under
PHP.net's umbrella, the unique changes in PHP's bundled libgd are now in
the standalone libgd as well.
php5 has supported standalone libgd, up to and including php 5.3.0
alpha 1. So it would be good if php 5.3.0 final did not break this. Or,
if it is your intention to break this, then do so with a friendlier
message in the configure phase and update the documentation.
[1] http://www.php.net/manual/en/image.setup.php
------------------------------------------------------------------------
[2008-12-05 09:13:40] pajoye@php.net
The bundled GD is the recommend version anyway. It has more bug fixes
and features than almost all GD distributions out there (the worst is
debian's gd which should not be used at all).
Functions like imagefilter, imagerotate are not available when an
external GD is used.
php6 may support external GD but only a recent version and only when a
minimum set of features are enabled.
------------------------------------------------------------------------
[2008-12-05 08:56:05] karsten at typo3 dot org
I had the same issue yesterday and switched to the bundled GD to make
it
compile. Now, it would be interesting to know what functionality
difference this means and what the other issue is, this is related to.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/46015
--
Edit this bug report at http://bugs.php.net/?id=46015&edit=1