Cannot build php 5.3.18 with ilbgd on CentOS 6.3

Issue #30 resolved
Siarhei Semashko
created an issue

Hello everybody, I tried to build php 5.3.18 with libgd using commands:

./configure --prefix=/usr/php --enable-exif --with-gd=/usr/local --with-png-dir=/usr/local --with-jpeg-dir=/usr/local

make -j4

And I got errors during second command:

In file included from /root/php-5.3.18/ext/gd/gd.c:58: /root/php-5.3.18/ext/gd/libgd/gd_compat.h:43: error: nested redefinition of ‘enum gdPixelateMode’ /root/php-5.3.18/ext/gd/libgd/gd_compat.h:43: error: redeclaration of ‘enum gdPixelateMode’ /root/php-5.3.18/ext/gd/libgd/gd_compat.h:44: error: redeclaration of enumerator ‘GD_PIXELATE_UPPERLEFT’ /usr/local/gd.h:781: note: previous definition of ‘GD_PIXELATE_UPPERLEFT’ was here /root/php-5.3.18/ext/gd/libgd/gd_compat.h:46: error: redeclaration of enumerator ‘GD_PIXELATE_AVERAGE’ /usr/local/gd.h:783: note: previous definition of ‘GD_PIXELATE_AVERAGE’ was here /bin/sh /root/php-5.3.18/libtool --silent --preserve-dup-deps --mode=compile gcc -I/usr/local/ -Iext/gd/ -I/root/php-5.3.18/ext/gd/ -DPHP_ATOM_INC -I/root/php-5.3.18/include -I/root/php-5.3.18/main -I/root/php-5.3.18 -I/root/php-5.3.18/ext/date/lib -I/root/php-5.3.18/ext/ereg/regex -I/usr/include/libxml2 -I/usr/local/include -I/usr/include/freetype2 -I/usr/local/ -I/root/php-5.3.18/ext/mbstring/oniguruma -I/root/php-5.3.18/ext/mbstring/libmbfl -I/root/php-5.3.18/ext/mbstring/libmbfl/mbfl -I/root/php-5.3.18/TSRM -I/root/php-5.3.18/Zend -I/usr/local/include -g -O2 -fvisibility=hidden -c /root/php-5.3.18/ext/gd/libgd/gd_compat.c -o ext/gd/libgd/gd_compat.lo make: *** [ext/gd/gd.lo] Error 1

GD was installed with libjpeg and libpng:

libjpeg

wget http://www.ijg.org/files/jpegsrc.v8d.tar.gz

tar -xzf jpegsrc.v8d.tar.gz

cd jpeg-8d

./configure --prefix=/usr/local

make -j4

make install

libpng

wget http://downloads.sourceforge.net/project/libpng/libpng15/1.5.13/libpng-1.5.13.tar.gz?r=http%3A%2F%2Fwww.libpng.org%2Fpub%2Fpng%2Flibpng.html&ts=1351421424&use_mirror=citylan

tar -xzf libpng-1.5.13.tar.gz

cd libpng-1.5.13

./configure --prefix=/usr/local

make -j4

make install

GD

hg clone https://bitbucket.org/pierrejoye/gd-libgd

cd gd-libgd/

mkdir build

cd build

echo "cmake_policy(SET CMP0002 OLD)" >> ../CMakeLists.txt

cmake ..

make -j4

make install

Does anybody know how to fix this? Thanks in advance

Comments (5)

  1. Log in to comment