The library can be compiled in various ways, and a detailed documentation
is available in the file "freetype2/docs/BUILD". However, we'll
summarize the process to a few cases:
a. by using the command-line 2 build system
The engine comes with a sophisticated build system that is used
to configure and compile a build of the library. You'll need
GNU Make installed on your platform (NOTE: It will not
work with other Make tools).
Basically, you'll need to invoke make a first time in the
top-level FreeType 2 directory in order to setup the build. This will
detect your current platform and choose a configuration sub-makefile to
drive the build. A specific compiler can be selected on some platforms
by providing an additional target. For example, on Win32:
- make visualc will select the Visual C++ compiler
- make lcc will select the Win32-lcc compiler
Note that on Unix, the first time make is called, a configure script
located in "freetype2/builds/unix" will be run in order to
automatically detect the platform & compiler.
A summary will be displayed showing the detected platform and compiler
selected. You'll then be able to start the build by invoking make
a second time. In case of problem, consult the BUILD document.
b. by direct compilation
You can also directly compile the library from the command line by
using these simple rules:
You should place the directories "freetype2/include" and
"freetype2/src" in your include path in order to compile
any component of the library. You can also add the system-specific
build directory (i.e. "builds/system/") in the
case where an alternate implementation of some of the components
is available there (e.g. the memory-mapped i/o implementation
on some Unix systems).
The components of the library are located in sub-directories of
"src", for example: "src/base",
"src/truetype", etc..
Each component is normally compiled through a single C file that
"wraps" other sources in the component's directory. For example,
your should compile the TrueType font driver by compiling the
file "src/truetype/truetype.c". The list of C files to
compile for a feature-complete build of the library is given in
the BUILD document.
c. in a graphical IDE
Well, the process is vastly similar to the one described in b.,
except that you need to set the include paths, source code paths,
etc.. in dialog boxes before running the compilation.