Version 2 (modified by lloydw, 7 years ago)
--

Building FreeType for iOS

The only dependencies libRocket has is on the FreeType library. The library has build configurations for most platforms, but unfortunately not iOS. This document describes how to build libfreetype.a as a universal binary for iOS and the Mac (i386, x86_64, arm6, arm7).

NOTE: You can download a prebuilt version of these libraries from the download section.

Download the Source

Download the latest freetype sourcecode from sourceforge.

Open a terminal and extract the archive:

$ tar -jxf libfreetype-2.4.2.tar.bz2
$ cd libfreetype-2.4.2

Compiling the library

We have to compile the library four times, once for each architecture.

i386

$ CC="g++ -arch -i386" ./configure;make

This forces configure to use the i386 architecture and build the library. The built library is located at objs/.libs/libfreetype.a. We copy this to our top level folder and build the next architecture.

$ cp objs/.libs/libfreetype.a libfreetype-i386.a

Similar build setup for x86_64, notice the addition of make clean, we want to completely remove the i386 code.

x86_64

$ CC="g++ -arch -i386" ./configure;make clean;make
$ cp objs/.libs/libfreetype.a libfreetype-x86_64.a