#46015 [Com]: Build fails with system gd

2009-03-27 Thread tsteiner at nerdclub dot net
 ID:   46015
 Comment by:   tsteiner at nerdclub dot net
 Reported By:  Fedora at FamilleCollet dot com
 Status:   Assigned
 Bug Type: GD related
 Operating System: Linux (Fedora 9)
 PHP Version:  5.3.0alpha2
 Assigned To:  pajoye
 New Comment:

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.0 -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 
-#include 
-  ], [
-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)


Previous Comments:


[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

#46015 [Com]: Build fails with system gd

2009-03-27 Thread tsteiner at nerdclub dot net
 ID:   46015
 Comment by:   tsteiner at nerdclub dot net
 Reported By:  Fedora at FamilleCollet dot com
 Status:   Assigned
 Bug Type: GD related
 Operating System: Linux (Fedora 9)
 PHP Version:  5.3.0alpha2
 Assigned To:  pajoye
 New Comment:

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.


Previous Comments:


[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] paj...@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.



[2008-09-08 10:57:48] paj...@php.net

This patch is not correct as then the function defined in gdhelper.h
will not be defined and the default signature will be used. please do
not apply it, I will fix the issue while working on another similar
issue in gd.



[2008-09-08 10:26:57] spher...@php.net

Had the same problem and came up with similar fix. Would someone apply

this patch to CVS? My karma is not sufficient.



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



#46015 [Com]: Build fails with system gd

2008-12-05 Thread php-bugs-2008 at ryandesign dot com
 ID:   46015
 Comment by:   php-bugs-2008 at ryandesign dot com
 Reported By:  Fedora at FamilleCollet dot com
 Status:   Assigned
 Bug Type: GD related
 Operating System: Linux (Fedora 9)
 PHP Version:  5.3.0alpha2
 Assigned To:  pajoye
 New Comment:

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


Previous Comments:


[2008-12-05 09:13:40] [EMAIL PROTECTED]

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.



[2008-09-08 10:57:48] [EMAIL PROTECTED]

This patch is not correct as then the function defined in gdhelper.h
will not be defined and the default signature will be used. please do
not apply it, I will fix the issue while working on another similar
issue in gd.



[2008-09-08 10:26:57] [EMAIL PROTECTED]

Had the same problem and came up with similar fix. Would someone apply

this patch to CVS? My karma is not sufficient.



[2008-09-07 07:21:45] 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.orig2008-09-07 08:53:38.0 +0200
+++ ext/gd/gd.c 2008-09-07 08:54:03.0 +0200
@@ -74,7 +74,9 @@
 #include  /* 3 Medium bold font */
 #include   /* 4 Large font */
 #include   /* 5 Giant font */
+#if HAVE_GD_BUNDLED
 #include 
+#endif
 
 #ifdef HAVE_GD_WBMP
 #include "libgd/wbmp.h"

Reproduce code:
---
make

Expected result:

Build complete.

Actual result:
--
Build failed.





-- 
Edit this bug report at http://bugs.php.net/?id=46015&edit=1



#46015 [Com]: Build fails with system gd

2008-12-05 Thread karsten at typo3 dot org
 ID:   46015
 Comment by:   karsten at typo3 dot org
 Reported By:  Fedora at FamilleCollet dot com
 Status:   Assigned
 Bug Type: GD related
 Operating System: Linux (Fedora 9)
 PHP Version:  5.3.0alpha2
 Assigned To:  pajoye
 New Comment:

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.


Previous Comments:


[2008-09-08 10:57:48] [EMAIL PROTECTED]

This patch is not correct as then the function defined in gdhelper.h
will not be defined and the default signature will be used. please do
not apply it, I will fix the issue while working on another similar
issue in gd.



[2008-09-08 10:26:57] [EMAIL PROTECTED]

Had the same problem and came up with similar fix. Would someone apply

this patch to CVS? My karma is not sufficient.



[2008-09-07 07:21:45] 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.orig2008-09-07 08:53:38.0 +0200
+++ ext/gd/gd.c 2008-09-07 08:54:03.0 +0200
@@ -74,7 +74,9 @@
 #include  /* 3 Medium bold font */
 #include   /* 4 Large font */
 #include   /* 5 Giant font */
+#if HAVE_GD_BUNDLED
 #include 
+#endif
 
 #ifdef HAVE_GD_WBMP
 #include "libgd/wbmp.h"

Reproduce code:
---
make

Expected result:

Build complete.

Actual result:
--
Build failed.





-- 
Edit this bug report at http://bugs.php.net/?id=46015&edit=1