Date: Sat, 27 Oct 2001 14:56:17 +0300 From: Peter Pentchev <roam@ringlet.net> To: Dirk Froemberg <dirk@FreeBSD.org> Cc: ports@FreeBSD.org Subject: Re: www/mod_php3 FreeBSD port fix for interop with gd Message-ID: <20011027145617.B8761@straylight.oblivion.bg> In-Reply-To: <20011027143234.A8761@straylight.oblivion.bg>; from roam@ringlet.net on Sat, Oct 27, 2001 at 02:32:34PM %2B0300 References: <20011027143234.A8761@straylight.oblivion.bg>
next in thread | previous in thread | raw e-mail | index | archive | help
--sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Oct 27, 2001 at 02:32:34PM +0300, Peter Pentchev wrote: > There are several ways to work around this problem: > > 1. Fully disable GIF support in PHP by overriding whatever the configure > script detected - see the attached php-nogif.patch > > 2. Separate the checks for gdImageCreateFromGif() and gdImageGif() - > see the attached php-gdinout.patch. ENOATTACHMNT.. here they are. G'luck, Peter -- Do you think anybody has ever had *precisely this thought* before? --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="php-nogif.patch" Index: ports/www/mod_php3/Makefile =================================================================== RCS file: /home/ncvs/ports/www/mod_php3/Makefile,v retrieving revision 1.128 diff -u -r1.128 Makefile --- ports/www/mod_php3/Makefile 2001/08/22 20:13:49 1.128 +++ ports/www/mod_php3/Makefile 2001/10/26 10:35:14 @@ -64,6 +64,9 @@ pre-fetch: @${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.php +post-configure: + ${PERL} -ni -e '!/HAVE_GD_GIF/ and print' ${WRKSRC}/config.h + post-install: .if !defined(STANDALONE) @${INSTALL_DATA} ${WRKSRC}/php3.ini-dist ${PREFIX}/etc --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="php-gdinout.patch" Index: ports/www/mod_php3/files/patch-aq =================================================================== RCS file: /home/ncvs/ports/www/mod_php3/files/patch-aq,v retrieving revision 1.11 diff -u -r1.11 patch-aq --- ports/www/mod_php3/files/patch-aq 2001/03/04 18:27:56 1.11 +++ ports/www/mod_php3/files/patch-aq 2001/10/26 11:02:03 @@ -1,5 +1,5 @@ ---- configure.orig Fri Oct 20 21:05:17 2000 -+++ configure Mon Feb 26 13:09:58 2001 +--- configure.old Fri Oct 26 13:58:30 2001 ++++ configure Fri Oct 26 14:01:30 2001 @@ -1626,7 +1626,7 @@ ;; *) @@ -29,7 +29,163 @@ else IMAP_INC_DIR=$withval/include fi -@@ -9231,7 +9231,7 @@ +@@ -5988,7 +5988,50 @@ + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +-#define HAVE_GD_GIF 1 ++#define HAVE_GD_GIF_IN 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for gdImageGif in -lgd""... $ac_c" 1>&6 ++echo "configure:5957: checking for gdImageGif in -lgd" >&5 ++ac_lib_var=`echo gd'_'gdImageGif | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lgd $LIBS" ++cat > conftest.$ac_ext <<EOF ++#line 5965 "configure" ++#include "confdefs.h" ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char gdImageGif(); ++ ++int main() { ++gdImageGif() ++; return 0; } ++EOF ++if { (eval echo configure:5976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_GD_GIF_OUT 1 + EOF + + else +@@ -6503,7 +6546,50 @@ + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +-#define HAVE_GD_GIF 1 ++#define HAVE_GD_GIF_IN 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for gdImageGif in -lgd""... $ac_c" 1>&6 ++echo "configure:6472: checking for gdImageGif in -lgd" >&5 ++ac_lib_var=`echo gd'_'gdImageGif | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lgd $LIBS" ++cat > conftest.$ac_ext <<EOF ++#line 6480 "configure" ++#include "confdefs.h" ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char gdImageGif(); ++ ++int main() { ++gdImageGif() ++; return 0; } ++EOF ++if { (eval echo configure:6491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_GD_GIF_OUT 1 + EOF + + else +@@ -6956,7 +7042,50 @@ + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +-#define HAVE_GD_GIF 1 ++#define HAVE_GD_GIF_IN 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for gdImageGif in -lgd""... $ac_c" 1>&6 ++echo "configure:6925: checking for gdImageGif in -lgd" >&5 ++ac_lib_var=`echo gd'_'gdImageGif | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lgd $LIBS" ++cat > conftest.$ac_ext <<EOF ++#line 6933 "configure" ++#include "confdefs.h" ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char gdImageGif(); ++ ++int main() { ++gdImageGif() ++; return 0; } ++EOF ++if { (eval echo configure:6944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_GD_GIF_OUT 1 + EOF + + else +@@ -9231,7 +9360,7 @@ fi SYBASE_CT_INCLUDE=-I$SYBASE_CT_INCDIR SYBASE_CT_LFLAGS="-L$SYBASE_CT_LIBDIR" @@ -38,7 +194,7 @@ old_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -L$SYBASE_CT_LIBDIR" echo $ac_n "checking for netg_errstr in -ltcl""... $ac_c" 1>&6 -@@ -9272,7 +9272,6 @@ +@@ -9272,7 +9401,6 @@ SYBASE_CT_LIBS="$SYBASE_CT_LIBS -ltcl" else echo "$ac_t""no" 1>&6 Index: ports/www/mod_php3/files/patch-au =================================================================== RCS file: patch-au diff -N patch-au --- ports/www/mod_php3/files/patch-au Fri Oct 26 14:50:41 2001 +++ ports/www/mod_php3/files/patch-au Fri Oct 26 14:05:28 2001 @@ -0,0 +1,12 @@ +--- config.h.in.old Fri Oct 26 14:04:56 2001 ++++ config.h.in Fri Oct 26 14:05:03 2001 +@@ -151,7 +151,8 @@ + #define HAVE_LIBGD 0 + + #undef HAVE_GD_PNG +-#undef HAVE_GD_GIF ++#undef HAVE_GD_GIF_IN ++#undef HAVE_GD_GIF_OUT + #undef HAVE_GD_JPG + #undef HAVE_GD_LZW + #undef HAVE_GD_COLORRESOLVE Index: ports/www/mod_php3/files/patch-av =================================================================== RCS file: patch-av diff -N patch-av --- ports/www/mod_php3/files/patch-av Fri Oct 26 14:50:41 2001 +++ ports/www/mod_php3/files/patch-av Fri Oct 26 14:08:02 2001 @@ -0,0 +1,55 @@ +--- functions/gd.c.old Fri Oct 26 13:50:03 2001 ++++ functions/gd.c Fri Oct 26 14:07:21 2001 +@@ -176,7 +176,7 @@ + #if HAVE_GD_PNG + php3_printf("Version 1.6 (PNG) or later"); + #endif +-#if HAVE_GD_GIF ++#if defined(HAVE_GD_GIF_IN) || defined(HAVE_GD_GIF_OUT) + php3_printf("Version 1.5 (GIF) or earlier"); + #endif + #if HAVE_LIBTTF +@@ -371,7 +371,7 @@ + /* {{{ proto int imagecreatefromgif(string filename) + Create a new image from GIF file or URL */ + void php3_imagecreatefromgif (INTERNAL_FUNCTION_PARAMETERS) { +-#if HAVE_GD_GIF ++#if HAVE_GD_GIF_IN + pval *file; + int ind; + gdImagePtr im; +@@ -412,10 +412,10 @@ + ind = php3_list_insert(im, GD_GLOBAL(le_gd)); + + RETURN_LONG(ind); +-#else /* HAVE_GD_GIF */ ++#else /* HAVE_GD_GIF_IN */ + php3_error(E_WARNING, "ImageCreateFromGif: No GIF support in this PHP build"); + RETURN_FALSE; +-#endif /* HAVE_GD_GIF */ ++#endif /* HAVE_GD_GIF_IN */ + } + /* }}} */ + +@@ -833,7 +833,7 @@ + /* {{{ proto int imagegif(int im [, string filename]) + Output GIF image to browser or file */ + void php3_imagegif (INTERNAL_FUNCTION_PARAMETERS) { +-#if HAVE_GD_GIF ++#if HAVE_GD_GIF_OUT + pval *imgind, *file; + gdImagePtr im; + char *fn=NULL; +@@ -913,10 +913,10 @@ + } + + RETURN_TRUE; +-#else /* HAVE_GD_GIF */ ++#else /* HAVE_GD_GIF_OUT */ + php3_error(E_WARNING, "ImageGif: No GIF support in this PHP build"); + RETURN_FALSE; +-#endif /* HAVE_GD_GIF */ ++#endif /* HAVE_GD_GIF_OUT */ + } + /* }}} */ + Index: ports/www/mod_php3/files/patch-aw =================================================================== RCS file: patch-aw diff -N patch-aw --- ports/www/mod_php3/files/patch-aw Fri Oct 26 14:50:41 2001 +++ ports/www/mod_php3/files/patch-aw Fri Oct 26 15:19:50 2001 @@ -0,0 +1,32 @@ +--- configure.in Fri Oct 26 13:53:39 2001 ++++ configure.in Fri Oct 26 13:54:59 2001 +@@ -804,7 +804,8 @@ + AC_ADD_LIBRARY(jpeg) + fi + +- AC_CHECK_LIB(gd,gdImageCreateFromGif,[AC_DEFINE(HAVE_GD_GIF)]) ++ AC_CHECK_LIB(gd,gdImageCreateFromGif,[AC_DEFINE(HAVE_GD_GIF_IN)]) ++ AC_CHECK_LIB(gd,gdImageGif, [AC_DEFINE(HAVE_GD_GIF_OUT)]) + AC_CHECK_LIB(gd,gdImageLzw, [AC_DEFINE(HAVE_GD_LZW)]) + AC_CHECK_LIB(gd,gdImageColorResolve, [AC_DEFINE(HAVE_GD_COLORRESOLVE)]) + AC_CHECK_LIB(gd,gdImageString16,[ ], [AC_DEFINE(HAVE_GD_ANCIENT)]) +@@ -874,7 +875,8 @@ + AC_ADD_LIBRARY(z) + fi + +- AC_CHECK_LIB(gd,gdImageCreateFromGif,[AC_DEFINE(HAVE_GD_GIF)]) ++ AC_CHECK_LIB(gd,gdImageCreateFromGif,[AC_DEFINE(HAVE_GD_GIF_IN)]) ++ AC_CHECK_LIB(gd,gdImageGif, [AC_DEFINE(HAVE_GD_GIF_OUT)]) + AC_CHECK_LIB(gd,gdImageLzw, [AC_DEFINE(HAVE_GD_LZW)]) + AC_CHECK_LIB(gd,gdImageColorResolve, [AC_DEFINE(HAVE_GD_COLORRESOLVE)]) + AC_CHECK_LIB(gd,gdImageString16,[ ], [AC_DEFINE(HAVE_GD_ANCIENT)]) +@@ -915,7 +917,8 @@ + AC_ADD_LIBRARY(z) + fi + +- AC_CHECK_LIB(gd,gdImageCreateFromGif,[AC_DEFINE(HAVE_GD_GIF)]) ++ AC_CHECK_LIB(gd,gdImageCreateFromGif,[AC_DEFINE(HAVE_GD_GIF_IN)]) ++ AC_CHECK_LIB(gd,gdImageGif, [AC_DEFINE(HAVE_GD_GIF_OUT)]) + AC_CHECK_LIB(gd,gdImageLzw, [AC_DEFINE(HAVE_GD_LZW)]) + AC_CHECK_LIB(gd,gdImageColorResolve, [AC_DEFINE(HAVE_GD_COLORRESOLVE)]) + AC_CHECK_LIB(gd,gdImageString16,[ ], [AC_DEFINE(HAVE_GD_ANCIENT)]) --sm4nu43k4a2Rpi4c-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011027145617.B8761>