GD on 10.4

First you need to get the sources of the files that we require, here is a listing and links to the software needed.

zlib 1.2.2 – http://www.gzip.org/zlib/
libpng 1.2.8 – http://www.libpng.org/pub/png/libpng.html
libjpeg v6b – ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
freetype2 2.1.9 – http://freetype.sourceforge.net/download.html
GD 2.0.33 – http://www.boutell.com/gd/

Once you have all the needed files you may want to create a folder called install or something along those lines. Once you create the folder go ahead and untar all the files into their own directory inside the install folder. Now that you have done that we can begin, open up a terminal window and I always just become su as it makes it easier.

1.) Compile zlib

cd zlib-1.2.2
./configure && make && make install
cd ../libpng-1.2.8/

2.) Compile libpng

cp scripts/makefile.darwin ./Makefile
make && make install

3.) Compile libjpg, we have to take part of the gd config to make this work.

cd ../gd-2.0.33
./configure
cp libtool ../jpeg-6b
cd ../jpeg-6b
./configure –enable-shared
make && make install

4.) Compile Freetype2

cd ../freetype-2.1.9
./configure; make; sudo make install

5.) Compile GD

cd ../gd-2.0.33
./configure

If everything went as planned you will see an output screen showing something like this. Pretty much the more stuff that says yes.. the better.

** Configuration summary for gd 2.0.33:

Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: yes

Then just make and install it.
make && make install

Now you should have GD 2.0.33 Installed.

And if your luck you wont get a bunch of errors like this

gdft.c:113:31: error: freetype/freetype.h: No such file or directory
gdft.c:114:30: error: freetype/ftglyph.h: No such file or directory
gdft.c:115:30: error: freetype/ftsizes.h: No such file or directory

but if you did, there is an easy fix jsut edit the Makefile in the gd directory after you run ./configure and add “-I/usr/X11R6/include” to the CPPFLAGS section, run make and make install and you should be all set.