Suzuki, Toshiya (鈴木俊哉) | bfe872d | 2006-10-14 13:08:05 +0000 | [diff] [blame] | 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 |
| 4 | INSTALL.UNIX for required tools and the basic self-building procedure. |
| 5 | |
| 6 | |
| 7 | 1. Required Tools |
| 8 | ----------------- |
| 9 | |
| 10 | For self-building the FreeType library on a Unix system, GNU Make |
Werner Lemberg | 4e33f9e | 2008-07-05 06:35:28 +0000 | [diff] [blame] | 11 | 3.80 or newer is required. INSTALL.UNIX contains hints how to |
Suzuki, Toshiya (鈴木俊哉) | bfe872d | 2006-10-14 13:08:05 +0000 | [diff] [blame] | 12 | check the installed `make'. |
| 13 | |
| 14 | The GNU C compiler to cross-build the target system is required. |
| 15 | At present, using non-GNU cross compiler is not tested. The cross |
| 16 | compiler is expected to be installed with a system prefix. For |
| 17 | example, if your building system is FreeBSD/i386 and the target |
| 18 | system is Linux/MIPS, the cross compiler should be installed with |
| 19 | the name `mips-ip22-linuxelf-gcc'. |
| 20 | |
| 21 | A C compiler for a self-build is required also, to build a tool |
| 22 | that is executed during the building procedure. Non-GNU self |
| 23 | compilers are acceptable, but such a setup is not tested yet. |
| 24 | |
| 25 | |
| 26 | 2. Configuration |
| 27 | ---------------- |
| 28 | |
| 29 | 2.1. Building and target system |
| 30 | |
| 31 | To configure for cross-build, the options `--host=<system>' and |
| 32 | `--build=<system>' must be passed to configure. For example, if |
| 33 | your building system is FreeBSD/i386 and the target system is |
| 34 | Linux/MIPS, say |
| 35 | |
| 36 | ./configure \ |
| 37 | --build=i386-unknown-freebsd \ |
| 38 | --host=mips-ip22-linuxelf \ |
| 39 | [other options] |
| 40 | |
| 41 | It should be noted that `--host=<system>' specifies the system |
| 42 | where the built binaries will be executed, not the system where |
| 43 | the build actually happens. Older versions of GNU autoconf use |
| 44 | the option pair `--host=' and `--target='. This is broken and |
| 45 | doesn't work. Similarly, an explicit CC specification like |
| 46 | |
Del Merritt | 74e6a1f | 2012-11-30 15:29:33 +0100 | [diff] [blame] | 47 | env CC=mips-ip22-linux-gcc ./configure # BAD |
Suzuki, Toshiya (鈴木俊哉) | bfe872d | 2006-10-14 13:08:05 +0000 | [diff] [blame] | 48 | |
| 49 | or |
| 50 | |
Del Merritt | 74e6a1f | 2012-11-30 15:29:33 +0100 | [diff] [blame] | 51 | env CC=/usr/local/mips-ip22-linux/bin/gcc ./configure # BAD |
Suzuki, Toshiya (鈴木俊哉) | bfe872d | 2006-10-14 13:08:05 +0000 | [diff] [blame] | 52 | |
| 53 | doesn't work either; such a configuration confuses the |
| 54 | `configure' script while trying to find the cross and native C |
| 55 | compilers. |
| 56 | |
| 57 | |
| 58 | 2.2. The prefix to install FreeType2 |
| 59 | |
| 60 | Setting `--prefix=<prefix>' properly is important. The prefix |
| 61 | to install FreeType2 is written into the freetype-config script |
| 62 | and freetype2.pc configuration file. |
| 63 | |
| 64 | If the built FreeType 2 library is used as a part of the |
| 65 | cross-building system, the prefix is expected to be different |
| 66 | from the self-building system. For example, configuration with |
| 67 | `--prefix=/usr/local' installs binaries into the system wide |
| 68 | `/usr/local' directory which then can't be executed. This |
| 69 | causes confusion in configuration of all applications which use |
| 70 | FreeType2. Instead, use a prefix to install the cross-build |
| 71 | into a separate system tree, for example, |
| 72 | `--prefix=/usr/local/mips-ip22-linux/'. |
| 73 | |
| 74 | On the other hand, if the built FreeType2 is used as a part of |
| 75 | the target system, the prefix to install should reflect the file |
| 76 | system structure of the target system. |
| 77 | |
| 78 | |
| 79 | 3. Building command |
| 80 | ------------------- |
| 81 | |
Werner Lemberg | b4142d5 | 2007-01-17 12:45:26 +0000 | [diff] [blame] | 82 | If the configuration finishes successfully, invoking GNU make |
| 83 | builds FreeType2. Just say |
Suzuki, Toshiya (鈴木俊哉) | bfe872d | 2006-10-14 13:08:05 +0000 | [diff] [blame] | 84 | |
| 85 | make |
| 86 | |
| 87 | or |
| 88 | |
| 89 | gmake |
| 90 | |
| 91 | depending on the name the GNU make binary actually has. |
| 92 | |
| 93 | |
| 94 | 4. Installation |
| 95 | --------------- |
| 96 | |
| 97 | Saying |
| 98 | |
| 99 | make install |
| 100 | |
| 101 | as usual to install FreeType2 into the directory tree specified by |
| 102 | the argument of the `--prefix' option. |
| 103 | |
| 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 | |
| 110 | make DESTDIR=/mnt/target_system_root/ install |
| 111 | |
| 112 | the built FreeType2 library files are installed into the directory |
| 113 | `/mnt/target_system_root/<prefix_in_configure>/lib'. |
| 114 | |
| 115 | |
| 116 | 5. TODO |
| 117 | ------- |
| 118 | |
| 119 | Cross building between Cygwin (or MSys) and Unix must be tested. |
| 120 | |
| 121 | |
| 122 | ---------------------------------------------------------------------- |
| 123 | |
Del Merritt | 74e6a1f | 2012-11-30 15:29:33 +0100 | [diff] [blame] | 124 | Copyright 2006, 2008, 2012 by suzuki toshiya |
Suzuki, Toshiya (鈴木俊哉) | bfe872d | 2006-10-14 13:08:05 +0000 | [diff] [blame] | 125 | David Turner, Robert Wilhelm, and Werner Lemberg. |
| 126 | |
| 127 | |
| 128 | This file is part of the FreeType project, and may only be used, |
| 129 | modified, and distributed under the terms of the FreeType project |
| 130 | license, LICENSE.TXT. By continuing to use, modify, or distribute |
| 131 | this file you indicate that you have read the license and understand |
| 132 | and accept it fully. |
| 133 | |
| 134 | |
| 135 | --- end of INSTALL.CROSS --- |