🛠️🐜 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.

177 lines
6.5 KiB

  1. This document contains instructions on how to cross-build the FreeType
  2. library on Unix systems, for example, building binaries for Linux/MIPS
  3. on FreeBSD/i386. Before reading this document, please consult the
  4. file `INSTALL.UNIX' for required tools and the basic self-building
  5. procedure.
  6. 1. Required Tools
  7. -----------------
  8. For self-building the FreeType library on a Unix system, GNU Make
  9. 3.81 or newer is required. `INSTALL.UNIX' contains hints how to
  10. check the installed `make'.
  11. The GNU C compiler to cross-build the target system is required.
  12. Currently, using a non-GNU cross compiler is untested. The cross
  13. compiler is expected to be installed with a system prefix. For
  14. example, if your building system is FreeBSD/i386 and the target
  15. system is Linux/MIPS, the cross compiler should be installed with
  16. the name `mips-ip22-linuxelf-gcc'.
  17. A C compiler for a self-build is required also, to build a tool
  18. (`apinames') that is executed during the build procedure. Non-GNU
  19. self compilers are acceptable, but such a setup is untested.
  20. 2. Configuration
  21. ----------------
  22. 2.1. Building and target system
  23. To configure a cross-build, the options `--host=<system>' and
  24. `--build=<system>' must be passed to the `configure' script.
  25. For example, if your build system is FreeBSD/i386 and the target
  26. system is Linux/MIPS, say
  27. ./configure \
  28. --build=i386-unknown-freebsd \
  29. --host=mips-ip22-linuxelf \
  30. [other options]
  31. It should be noted that `--host=<system>' specifies the system
  32. where the built binaries will be executed, not the system where
  33. the build actually happens. Older versions of GNU autoconf use
  34. the option pair `--host=' and `--target='. This is broken and
  35. doesn't work. Similarly, an explicit CC specification like
  36. env CC=mips-ip22-linux-gcc ./configure # BAD
  37. or
  38. env CC=/usr/local/mips-ip22-linux/bin/gcc ./configure # BAD
  39. doesn't work either; such a configuration confuses the
  40. `configure' script while trying to find the cross and native C
  41. compilers.
  42. 2.2. The prefix to install FreeType2
  43. Setting `--prefix=<prefix>' properly is important. The prefix
  44. to install FreeType2 is written into the `freetype-config'
  45. script and `freetype2.pc' configuration file.
  46. If the built FreeType 2 library is used as a part of the
  47. cross-building system, the prefix is expected to be different
  48. from the self-building system. For example, a configuration
  49. with `--prefix=/usr/local' installs binaries into the
  50. system-wide `/usr/local' directory, which then can't be executed
  51. due to the incorrect architecture. This causes confusion in
  52. configuration of all applications that use FreeType2. Instead,
  53. use a prefix to install the cross-build into a separate system
  54. tree, for example, `--prefix=/usr/local/mips-ip22-linux/'.
  55. On the other hand, if the built FreeType 2 library is used as a
  56. part of the target system, the prefix to install should reflect
  57. the file system structure of the target system.
  58. 2.3. Library dependencies
  59. FreeType normally depends on external libraries like `libpng' or
  60. `libharfbuzz'. The easiest case is to deactivate all such
  61. dependencies using the `--without-XXX' configuration options.
  62. However, if you want to use those libraries, you should ensure
  63. that they are available both on the target system and as
  64. (cross-compiled) libraries on the build system.
  65. FreeType uses `pkg-config' to find most of the libraries; the
  66. other libraries it links to are expected in the standard system
  67. directories. Since the default pkg-config's meta-information
  68. files (like `harfbuzz.pc') of the build platform don't work, use
  69. one of the two possible solutions below.
  70. o Use pkg-config's meta-information files that are adjusted to
  71. cross-compile and cross-link with the target platform's
  72. libraries. Make sure those files are found before the build
  73. system's default files. Example:
  74. ./configure \
  75. --build=i386-unknown-freebsd \
  76. --host=mips-ip22-linuxelf \
  77. PKG_CONFIG_LIBDIR="/usr/local/mips-ip22-linux/lib/pkgconfig" \
  78. [other options]
  79. See the manpage of `pkg-config' for more details.
  80. o Set variables like LIBPNG_LIBS as additional options to the
  81. `configure' script, overriding the values `pkg-config' would
  82. provide. `configure --help' shows the available environment
  83. variables. Example:
  84. ./configure \
  85. --build=i386-unknown-freebsd \
  86. --host=mips-ip22-linuxelf \
  87. LIBPNG_CFLAGS="-I/usr/local/mips-ip22-linux/include" \
  88. LIBPNG_LIBS="-L/usr/local/mips-ip22-linux/lib -lpng12" \
  89. [other options]
  90. 3. Building command
  91. -------------------
  92. If the configuration finishes successfully, invoking GNU make
  93. builds FreeType2. Just say
  94. make
  95. or
  96. gmake
  97. depending on the name the GNU make binary actually has.
  98. 4. Installation
  99. ---------------
  100. Saying
  101. make install
  102. as usual to install FreeType2 into the directory tree specified by
  103. the argument of the `--prefix' option.
  104. As noted in section 2.2, FreeType2 is sometimes configured to be
  105. installed into the system directory of the target system, and
  106. should not be installed in the cross-building system. In such
  107. cases, the make variable `DESTDIR' is useful to change the root
  108. directory in the installation. For example, after
  109. make DESTDIR=/mnt/target_system_root/ install
  110. the built FreeType2 library files are installed into the directory
  111. `/mnt/target_system_root/<prefix_in_configure>/lib'.
  112. 5. TODO
  113. -------
  114. Cross building between Cygwin (or MSys) and Unix must be tested.
  115. ----------------------------------------------------------------------
  116. Copyright (C) 2006-2021 by
  117. suzuki toshiya, David Turner, Robert Wilhelm, and Werner Lemberg.
  118. This file is part of the FreeType project, and may only be used,
  119. modified, and distributed under the terms of the FreeType project
  120. license, LICENSE.TXT. By continuing to use, modify, or distribute
  121. this file you indicate that you have read the license and understand
  122. and accept it fully.
  123. --- end of INSTALL.CROSS ---