🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
5.2 KiB

  1. How to customize the compilation of the library
  2. ===============================================
  3. FreeType is highly customizable to fit various needs, and this
  4. document describes how it is possible to select options and
  5. components at compilation time.
  6. I. Configuration macros
  7. The file `include/freetype/config/ftoption.h' contains a list of
  8. commented configuration macros that can be toggled by developers to
  9. indicate which features should be active while building the library.
  10. These options range from debug level to availability of certain
  11. features, like native TrueType hinting through a bytecode
  12. interpreter.
  13. We invite you to read this file for more information. You can
  14. change the file's content to suit your needs, or override it with
  15. one of the techniques described below.
  16. II. Modules list
  17. If you use GNU make please edit the top-level file `modules.cfg'.
  18. It contains a list of available FreeType modules and extensions to
  19. be compiled. Change it to suit your own preferences. Be aware that
  20. certain modules depend on others, as described in the file. GNU
  21. make uses `modules.cfg' to generate `ftmodule.h' (in the object
  22. directory).
  23. If you build FreeType in a directory separate from the source files,
  24. put your customized `modules.cfg' in that directory; that way you
  25. can keep the source files `clean'.
  26. If you don't use GNU make you have to manually edit the file
  27. `include/freetype/config/ftmodule.h' (which is *not* used with if
  28. compiled with GNU make) to add or remove the drivers and components
  29. you want to compile into the library. See `INSTALL.ANY' for more
  30. information.
  31. III. System interface
  32. FreeType's default interface to the system (i.e., the parts that
  33. deal with memory management and i/o streams) is located in
  34. `src/base/ftsystem.c'.
  35. The current implementation uses standard C library calls to manage
  36. memory and to read font files. It is however possible to write
  37. custom implementations to suit specific systems.
  38. To tell the GNU Make-based build system to use a custom system
  39. interface, you have to define the environment variable FTSYS_SRC to
  40. point to the relevant implementation:
  41. on Unix:
  42. ./configure <your options>
  43. export FTSYS_SRC=foo/my_ftsystem.c
  44. make
  45. make install
  46. on Windows:
  47. make setup <compiler>
  48. set FTSYS_SRC=foo/my_ftsystem.c
  49. make
  50. IV. Overriding default configuration and module headers
  51. It is possible to override the default configuration and module
  52. headers without changing the original files. There are three ways
  53. to do that:
  54. 1. With GNU make
  55. [This is actually a combination of method 2 and 3.]
  56. Just put your custom `ftoption.h' file into the objects directory
  57. (normally `<topdir>/objs' if you build in the source tree, or the
  58. directory where you invoke configure if you build in a separate
  59. directory), which GNU make prefers over the standard location. No
  60. action is needed for `ftmodule.h' because it is generated
  61. automatically in the objects directory.
  62. 2. Using the C include path
  63. Use the C include path to ensure that your own versions of the
  64. files are used at compile time when the lines
  65. #include FT_CONFIG_OPTIONS_H
  66. #include FT_CONFIG_MODULES_H
  67. are compiled. Their default values being
  68. <freetype/config/ftoption.h> and <freetype/config/ftmodule.h>, you
  69. can do something like:
  70. custom/
  71. config/
  72. ftoption.h => custom options header
  73. ftmodule.h => custom modules list
  74. include/ => normal FreeType 2 include
  75. ...
  76. then change the C include path to always give the path to `custom'
  77. before the FreeType 2 `include'.
  78. 3. Redefining FT_CONFIG_OPTIONS_H and FT_CONFIG_MODULES_H
  79. Another way to do the same thing is to redefine the macros used to
  80. name the configuration headers. To do so, you need a custom
  81. `ft2build.h' whose content can be as simple as:
  82. #ifndef FT2_BUILD_MY_PLATFORM_H_
  83. #define FT2_BUILD_MY_PLATFORM_H_
  84. #define FT_CONFIG_OPTIONS_H <custom/my-ftoption.h>
  85. #define FT_CONFIG_MODULES_H <custom/my-ftmodule.h>
  86. #include <freetype/config/ftheader.h>
  87. #endif /* FT2_BUILD_MY_PLATFORM_H_ */
  88. Place those files in a separate directory, e.g.,
  89. custom/
  90. ft2build.h => custom version described above
  91. my-ftoption.h => custom options header
  92. my-ftmodule.h => custom modules list header
  93. and change the C include path to ensure that `custom' is always
  94. placed before the FT2 `include' during compilation.
  95. ----------------------------------------------------------------------
  96. Copyright (C) 2003-2021 by
  97. David Turner, Robert Wilhelm, and Werner Lemberg.
  98. This file is part of the FreeType project, and may only be used,
  99. modified, and distributed under the terms of the FreeType project
  100. license, LICENSE.TXT. By continuing to use, modify, or distribute
  101. this file you indicate that you have read the license and understand
  102. and accept it fully.
  103. --- end of CUSTOMIZE ---