From:             php-bugs at i dot org dot ua
Operating system: Solaris8, may be any
PHP version:      4.3.2RC1
PHP Bug Type:     GD related
Bug description:  compilation error in gdcache if used system libgd

Hi.

Branch: PHP_4_3, updated at 03/17/2003.
Compiler: cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15
OS: Solaris 8
GD version 2.0.11 placed in /usr/local
Configure: 
./configure \
    --with-gd=/usr/local --enable-gd-imgstrttf \
    --enable-gd-native-ttf --with-png-dir=/usr/local \
    --with-jpeg-dir=/usr/local \
    --with-freetype-dir=/usr/local
...

Problem: If PHP try compile with system GD library, build break with this
error:

ld: fatal: symbol `gdCacheCreate' is multiply-defined:
        (file ext/gd/gdcache.lo and file
/usr/local/lib/libgd.a(gdcache.o));
ld: fatal: symbol `gdCacheDelete' is multiply-defined:
        (file ext/gd/gdcache.lo and file
/usr/local/lib/libgd.a(gdcache.o));
ld: fatal: symbol `gdCacheGet' is multiply-defined:
        (file ext/gd/gdcache.lo and file
/usr/local/lib/libgd.a(gdcache.o));


Solutions: Dirty hack...

--- ext/gd/config.m4.old        2003-03-17 18:01:40.090001000 +0200
+++ ext/gd/config.m4    2003-03-17 18:36:18.120001000 +0200
@@ -246,4 +246,5 @@
   PHP_CHECK_LIBRARY(gd, gdImageColorResolve,   
[AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE, 1, [ ])], [], [ -L$GD_LIB
$GD_SHARED_LIBADD ])
   PHP_CHECK_LIBRARY(gd, gdImageGifCtx,         
[AC_DEFINE(HAVE_GD_GIF_CTX,          1, [ ])], [], [ -L$GD_LIB
$GD_SHARED_LIBADD ])
+  PHP_CHECK_LIBRARY(gd, gdCacheCreate,         
[AC_DEFINE(HAVE_GD_CACHE_CREATE,     1, [ ])], [], [ -L$GD_LIB
$GD_SHARED_LIBADD ])
 ])


--- ext/gd/gdcache.c.orig       2003-03-17 18:10:02.280000000 +0200
+++ ext/gd/gdcache.c    2003-03-17 21:03:03.039999000 +0200
@@ -44,7 +44,7 @@
 #else
 #include "php_config.h"
 #endif
-#if HAVE_LIBTTF|HAVE_LIBFREETYPE
+#if !HAVE_GD_CACHE_CREATE && HAVE_LIBTTF|HAVE_LIBFREETYPE

 #include "gdcache.h"


-- 
Edit bug report at http://bugs.php.net/?id=22751&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22751&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22751&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22751&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22751&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22751&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22751&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22751&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22751&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22751&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22751&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22751&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22751&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22751&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22751&r=gnused

Reply via email to