freetype2/docs/CUSTOMIZE

137 lines
4.5 KiB
Plaintext
Raw Normal View History

How to customize the compilation of the library:
================================================
FreeType is highly customizable to fit various needs, and this
document describes how it is possible to select options and components
at compilation time.
I. Configuration macros
The file found in "include/freetype/config/ftoption.h" contains a list
of commented configuration macros that can be toggled by developers to
indicate which features should be active while building the library.
These options range from debug level to availability of certain
features, like native TrueType hinting through a bytecode interpreter.
We invite you to read this file for more information. You can change
the file's content to suit your needs, or override it with one of the
techniques described below.
II. Modules list
The file found in "include/freetype/config/ftmodule.h" contains a list
of names corresponding to the modules and font drivers to be
statically compiled in the FreeType library during the build.
You can change it to suit your own preferences. Be aware that certain
modules depend on others, as described by the file "modules.txt" in
this directory.
You can modify the file's content to suit your needs, or override it
at compile time with one of the methods described below.
III. System interface
FreeType's default interface to the system (i.e., the parts that deal
with memory management and i/o streams) is located in
"src/base/ftsystem.c".
The current implementation uses standard C library calls to manage
memory and to read font files. It is however possible to write custom
implementations to suit specific systems.
To tell the GNU Make-based build system to use a custom system
interface, you have to define the environment variable FTSYS_SRC to
point to the relevant implementation:
on Unix:
./configure <your options>
export FTSYS_SRC=foo/my_ftsystem.c
make
make install
on Windows:
make setup <compiler>
set FTSYS_SRC=foo/my_ftsystem.c
make
IV. Overriding default configuration and module headers
It is possible to override the default configuration and module
headers without changing the original files. There are two ways to do
that:
1. Using the C include path
Use the C include path to ensure that your own versions of the files
are used at compile time when the lines
#include FT_CONFIG_OPTIONS_H
#include FT_CONFIG_MODULES_H
are compiled. Their default values being
<freetype/config/ftoption.h> and <freetype/config/ftmodule.h>, you
can do something like:
custom/
freetype/
config/
ftoption.h => custom options header
ftmodule.h => custom modules list
include/ => normal FreeType 2 include
freetype/
...
then change the C include path to always give the path to "custom"
before the FreeType 2 "include".
2. Re-defining FT_CONFIG_OPTIONS_H and FT_CONFIG_MODULES_H
Another way to do the same thing is to redefine the macros used to
name the configuration headers. To do so, you need a custom
"ft2build.h" whose content can be as simple as:
* Version 2.1.7 released. ========================= * builds/unix/ft2unix.h: Fix comments. * builds/unix/ftconfig.in: Synchronized with ANSI version. Use `#undef' in templates as recommended in the autoconf documentation. Since real `#undef' lines don't survive during configuration, use `/undef' instead; the postprocessing facility of the AC_CONFIG_HEADERS autoconf macro converts them to `#undef'. * builds/unix/install.mk (install): Install Unix version of `ftconfig.h'. * builds/unix/unix-cc.in (CFLAGS): Set FT_CONFIG_CONFIG_H macro to include the correct `ftconfig.h' file. * builds/unix/ft-munmap.m4 (FT_MUNMAP_DECL): Removed. (FT_MUNMAP_PARAM): Updated syntax to autoconf 2.59. * builds/unix/freetype2.m4: Updated syntax to autoconf 2.59. * builds/unix/configure.ac: Use AC_CONFIG_HEADERS instead of AC_CONFIG_HEADER to create ftconfig.h, and use second argument to replace `/undef' with `#undef'. Don't use FT_MUNMAP_DECL but AC_CHECK_DECLS to check for munmap. Use AS_HELP_STRING in AC_ARG_WITH. Update syntax to autoconf 2.59. * builds/unix/ltmain.sh: Regenerated with `libtoolize --force --copy' from libtool 1.5. * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from automake 1.7.8. * builds/unix/configure: Regenerated with autoconf 2.59. * builds/unix/config.guess, builds/unix/config.sub: Updated from `config' CVS module at subversions.gnu.org * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from `texinfo' CVS module at subversions.gnu.org. * builds/vms/ftconfig.h: Synchronized with ANSI version. * docs/CUSTOMIZE: Fix documentation error. * docs/CHANGES, docs/VERSION.DLL, docs/release: Updated. * builds/freetype.mk (refdoc): Updated --title.
2003-11-09 09:37:14 +01:00
#ifndef __FT2_BUILD_MY_PLATFORM_H__
#define __FT2_BUILD_MY_PLATFORM_H__
* Version 2.1.7 released. ========================= * builds/unix/ft2unix.h: Fix comments. * builds/unix/ftconfig.in: Synchronized with ANSI version. Use `#undef' in templates as recommended in the autoconf documentation. Since real `#undef' lines don't survive during configuration, use `/undef' instead; the postprocessing facility of the AC_CONFIG_HEADERS autoconf macro converts them to `#undef'. * builds/unix/install.mk (install): Install Unix version of `ftconfig.h'. * builds/unix/unix-cc.in (CFLAGS): Set FT_CONFIG_CONFIG_H macro to include the correct `ftconfig.h' file. * builds/unix/ft-munmap.m4 (FT_MUNMAP_DECL): Removed. (FT_MUNMAP_PARAM): Updated syntax to autoconf 2.59. * builds/unix/freetype2.m4: Updated syntax to autoconf 2.59. * builds/unix/configure.ac: Use AC_CONFIG_HEADERS instead of AC_CONFIG_HEADER to create ftconfig.h, and use second argument to replace `/undef' with `#undef'. Don't use FT_MUNMAP_DECL but AC_CHECK_DECLS to check for munmap. Use AS_HELP_STRING in AC_ARG_WITH. Update syntax to autoconf 2.59. * builds/unix/ltmain.sh: Regenerated with `libtoolize --force --copy' from libtool 1.5. * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from automake 1.7.8. * builds/unix/configure: Regenerated with autoconf 2.59. * builds/unix/config.guess, builds/unix/config.sub: Updated from `config' CVS module at subversions.gnu.org * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from `texinfo' CVS module at subversions.gnu.org. * builds/vms/ftconfig.h: Synchronized with ANSI version. * docs/CUSTOMIZE: Fix documentation error. * docs/CHANGES, docs/VERSION.DLL, docs/release: Updated. * builds/freetype.mk (refdoc): Updated --title.
2003-11-09 09:37:14 +01:00
#define FT_CONFIG_OPTIONS_H <custom/my-ftoption.h>
#define FT_CONFIG_MODULES_H <custom/my-ftmodule.h>
#include <freetype/config/ftheader.h>
* Version 2.1.7 released. ========================= * builds/unix/ft2unix.h: Fix comments. * builds/unix/ftconfig.in: Synchronized with ANSI version. Use `#undef' in templates as recommended in the autoconf documentation. Since real `#undef' lines don't survive during configuration, use `/undef' instead; the postprocessing facility of the AC_CONFIG_HEADERS autoconf macro converts them to `#undef'. * builds/unix/install.mk (install): Install Unix version of `ftconfig.h'. * builds/unix/unix-cc.in (CFLAGS): Set FT_CONFIG_CONFIG_H macro to include the correct `ftconfig.h' file. * builds/unix/ft-munmap.m4 (FT_MUNMAP_DECL): Removed. (FT_MUNMAP_PARAM): Updated syntax to autoconf 2.59. * builds/unix/freetype2.m4: Updated syntax to autoconf 2.59. * builds/unix/configure.ac: Use AC_CONFIG_HEADERS instead of AC_CONFIG_HEADER to create ftconfig.h, and use second argument to replace `/undef' with `#undef'. Don't use FT_MUNMAP_DECL but AC_CHECK_DECLS to check for munmap. Use AS_HELP_STRING in AC_ARG_WITH. Update syntax to autoconf 2.59. * builds/unix/ltmain.sh: Regenerated with `libtoolize --force --copy' from libtool 1.5. * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from automake 1.7.8. * builds/unix/configure: Regenerated with autoconf 2.59. * builds/unix/config.guess, builds/unix/config.sub: Updated from `config' CVS module at subversions.gnu.org * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from `texinfo' CVS module at subversions.gnu.org. * builds/vms/ftconfig.h: Synchronized with ANSI version. * docs/CUSTOMIZE: Fix documentation error. * docs/CHANGES, docs/VERSION.DLL, docs/release: Updated. * builds/freetype.mk (refdoc): Updated --title.
2003-11-09 09:37:14 +01:00
#endif /* __FT2_BUILD_MY_PLATFORM_H__ */
Place those files in a separate directory, e.g.:
custom/
ft2build.h => custom version described above
my-ftoption.h => custom options header
my-ftmodule.h => custom modules list header
and change the C include path to ensure that "custom" is always
placed before the FT2 "include" during compilation.
------------------------------------------------------------------------
Copyright 2003 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
modified, and distributed under the terms of the FreeType project
license, LICENSE.TXT. By continuing to use, modify, or distribute this
file you indicate that you have read the license and understand and
accept it fully.
--- end of CUSTOMIZE ---