FreeType installation?

billbaloney

House pianist
Hey folks, I'm working on installing GD support for PHP on my OX 10.1 PowerBook, and I want to include FreeType support. FreeType, curiously, doesn't seem to recognize the existence of OS X -- the package still warns that they "do not support Macs".

I substituted OS X's native "config.guess" and "config.sub", and the configure process finishes smoothly now. However, make starts to fail when it looks for what appear to be a ton of X11-related files and definitions:

/usr/src/freetype-build/freetype-1.3.1/test/arch/unix/../../arch/unix/gwin_x11.c:22: header file 'X11/Xlib.h' not found
/usr/src/freetype-build/freetype-1.3.1/test/arch/unix/../../arch/unix/gwin_x11.c:23: header file 'X11/Xutil.h' not found
/usr/src/freetype-build/freetype-1.3.1/test/arch/unix/../../arch/unix/gwin_x11.c:24: header file 'X11/cursorfont.h' not found
/usr/src/freetype-build/freetype-1.3.1/test/arch/unix/../../arch/unix/gwin_x11.c:76: undefined type, found `Window'
/usr/src/freetype-build/freetype-1.3.1/test/arch/unix/../../arch/unix/gwin_x11.c:77: undefined type, found `GC'

[etc.]

Anyone have any insight? Anyone make it all the way through the install process? I think all I really want make to do is to forego X11 or xfs support, but I don't want to mess with the makefile until I ask the tribe for wisdom.

Much appreciated,
Matt Holford / billbaloney
 

howardm4

Registered
It certainly looks like it wants X11.

You should './configure --help' and see if there is an
option like '--with-x11' or '--disable-x11' or something like that.
That would be the cleanest way.

I dont have access to the GD stuff right now to see if it absolutely
requires X11.
 

chrisp

Registered
Yes, FreeType 1.x needs X11. FreeType 2.x doesn't. And actually, you should be using FreeType 2, since the current version of GD (1.8.4) requires FreeType 2, not FreeType 1, for font rendering support.

-chrisp
 

norwood

Registered
I am running Mac OSX 10.3, and php 5.0.4.
I'm trying to configure PHP with freetype2. I installed freetype2 from FINK, but can't figure out what config path to use for freetype2.

If freetype2 doesn't need X11, then what should the config path be?
 

Viro

Registered
If you've installed Freetype from Fink, it will be installed in /sw. Try passing that to the config script and it usually works.
 

norwood

Registered
Hi Viro

Thanks for replying so quickly.

I've just done this configure:

./configure --with-zlib-dir=/usr/local --with-gd --enable-gd-native-ttf --with-jpeg-dir=/sw --with-png-dir=/sw --with-t1lib=/sw --with-freetype-dir=/sw --with-xpm --with-apxs

and get back...

"checking for FreeType 1.x support... no
checking for FreeType 2... /sw
checking for T1lib support... /sw
checking whether to enable truetype string function in GD... yes
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
checking for jpeg_read_header in -ljpeg... yes
checking for png_write_image in -lpng... yes
If configure fails try --with-xpm-dir=<DIR>
configure: error: freetype2 not found!"

any ideas?
 

billbaloney

House pianist
I think Fink installs Freetype versions in non-standard places. Try

% ls -l /sw/lib/ | grep freetype

and you should see

freetype219/

If this is the case, you *might* want to try

--with-freetype-dir=/sw/freetype219

And see whether that gets the same complaint.
 

norwood

Registered
Hi Matt,

When I do:
% ls -l /sw/lib/ | grep freetype

I get...

-rwxr-xr-x 1 root admin 1512060 23 Apr 2005 libfreetype.6.3.2.dylib
lrwxr-xr-x 1 root admin 23 19 Sep 16:15 libfreetype.6.dylib -> libfreetype.6.3.2.dylib

This is the version of freetype I get when I specify:
fink install freetype2

As I'm running Mac OSX 10.3.9 I can't install freetype219 (according to the FINK website)

I'm still stuck ...
 

Viro

Registered
"checking for FreeType 1.x support... no
checking for FreeType 2... /sw
checking for T1lib support... /sw
checking whether to enable truetype string function in GD... yes
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
checking for jpeg_read_header in -ljpeg... yes
checking for png_write_image in -lpng... yes
If configure fails try --with-xpm-dir=<DIR>
configure: error: freetype2 not found!"

any ideas?
My guess is that you need to install the development files for freetype. Try installing freetype2-dev (and maybe even freetype2-hinting-dev?) and see if that helps.
 

norwood

Registered
Hi Viro

You've fixed it! Thanks so much, I can't believe it's working. I'd like to buy you a beer!

Here's my instructions/howto for the next poor soul who gets stuck with this problem:
---
Get Freetype2 - to add Freetype2 support to GD

To list all fink sw packages:
fink list -i

Don't install freetype1!!!

FINK: We need to install the development files for freetype2. Install freetype2-dev and freetype2-hinting-dev.

FINK install freetype2
FINK install freetype2-dev
FINK install freetype2-hinting-dev - said it failed, but it did install freetype2-shlibs (version 2.1.3-22) and this seems to have done the trick.

ls -l /sw/lib/ | grep freetype
drwxr-xr-x 5 root admin 170 19 Sep 17:47 freetype2
-rwxr-xr-x 1 root admin 1512060 23 Apr 2005 libfreetype.6.3.2.dylib
lrwxr-xr-x 1 root admin 23 19 Sep 16:15 libfreetype.6.dylib -> libfreetype.6.3.2.dylib

Configure:

% cd /usr/local/php5
sudo rm config.cache

for freetype2:
./configure --with-zlib-dir=/usr/local --with-gd --enable-gd-native-ttf --with-jpeg-dir=/sw --with-png-dir=/sw --with-t1lib=/sw --with-freetype-dir=/sw/lib/freetype2 --with-apxs

% make clean
% make
% sudo make install
 
Top