first get freetype ( http://www.freetype.org/ )which is necessary
./configure --prefix=/usr/local
make
make install
then zlib
./configure
make
make install
next is jpeg lib
./configure --enable-shared --enable-static --prefix=/usr/local
make
make test
make install
if you don't have it, install libpng and stuff as well
if you have X, the better 😉
extract gd and edit the Makefile
there are lines with
CFLAGS=-O
and
#CFLAGS=-O -DHAVE_XPM -DHAVE_JPEG -DHAVE_LIBTTF
comment the first one and uncomment the 2nd one. if you don't have X, remove the first paramter (-DHAVE_XPM)
further down, you'll find
LIBS=-lm -lgd -lpng -lz
and
#LIBS=-lm -lgd -lpng -lz -ljpeg -lttf -lXpm -lX11
again, comment the first one and uncomment the 2nd one
now... if you don't have libpng, remove -lpng
if you don't have X, remove -lXpm -lX11
some lines down, you'll find INCLUDEDIRS and LIBDIRS
there, you add -I/usr/local/include/freetype (include) and -L/usr/local/lib/freetype (lib)
then you should check if the locations are correct:
INSTALL_LIB=/usr/local/lib
INSTALL_INCLUDE=/usr/local/include
INSTALL_BIN=/usr/local/bin
is the standard case
then, my php configure looks like this:
./configure \
--with-apache=/usr/src/apache_1.3.20 \
--with-mysql=/usr/local/mysql/current \
--with-zlib=/usr/local \
--with-ftp \
--with-gd=shared \
--with-jpeg-dir=/usr/local \
--with-png-dir=/usr/local \
--with-ttf=/usr/local \
--with-pdflib=shared \
--with-pgsql \
--enable-versioning \
--enable-track-vars=yes \
--enable-url-includes \
--enable-sysvshm=yes \
--enable-sysvsem=yes \
--with-config-file-path=/etc
this is for all the libs including pdf and postgresql, so you might be able to skip some of it
BUT even with this i can't get gd to run. the only file i have is /usr/local/include/gd.h
if i use dl ("gd.h"); in my script, i get
Warning: Unable to load dynamic library './gd.h' - ./gd.h: cannot open shared object file: No such file or directory in /var/www/htdocs/scripts/genbutton.php</b> on line 3
maybe the extension_dir is wrong but i already tried everything
SubWorx