Thursday, August 24, 2006

How to Cross-Compile FreeType

I've been using BlogPlatrol to monitor the meagre hits to my page, and among other things it tells me how people got here, and it seems that rather a lot of you are typing things like "cross-compile freetype apinames". I did the same search myself and found out that my off-hand mention of troubles cross-compiling FreeType is the very first result Google reports. Go figure.

So I figure this must be a real problem, and that there's no good solution out there right now. In the interests of attracting even more hits, and maybe even helping out a few people, here's a more detailed description of what you need to do to successfully cross-compile FreeType.

Presumably if you're doing a search similar to the one I mentioned you already have the FreeType sources and a cross-compiler installed, and you've probably even run FreeType's 'configure' script, seemingly successfully. Just to give you the warm fuzzies, here's what I did:

[funaho ~/freetype-2.2.1]% ./configure --host=arm-linux

when you run 'make', everything purrs along until it tries to run 'apinames' and fails. What you have to do at this point is:

[funaho ~/freetype-2.2.1]% cd src/tools
[funaho ~/freetype-2.2.1/src/tools]% gcc apinames.c -o apinames
[funaho ~/freetype-2.2.1/src/tools]% cp apinames ../../objs
[funaho ~/freetype-2.2.1/src/tools]% cd ../..
[funaho ~/freetype-2.2.1]% make

make should resume where it left off, trying to run apinames, only this time it will succeed. Hope that helps folks.

Labels: