Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 1 | This document contains instructions how to build the FreeType library on |
| 2 | non-Unix systems with the help of GNU Make. Note that if you are |
| 3 | running Cygwin or MSys in Windows, you should follow the instructions in |
| 4 | the file INSTALL.UNX instead. |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 5 | |
| 6 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 7 | FreeType 2 includes a powerful and flexible build system that allows |
| 8 | you to easily compile it on a great variety of platforms from the |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 9 | command line. To do so, just follow these simple instructions: |
| 10 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 11 | 1. Install GNU Make |
| 12 | ------------------- |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 13 | |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame^] | 14 | Because GNU Make is the only Make tool supported to compile FreeType |
| 15 | 2, you should install it on your machine. |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 16 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 17 | The FreeType 2 build system relies on many features special to GNU |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame^] | 18 | Make. |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 19 | |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame^] | 20 | NEARLY ALL OTHER MAKE TOOLS FAIL, INCLUDING `BSD MAKE', SO REALLY |
| 21 | INSTALL A RECENT VERSION OF GNU MAKE ON YOUR SYSTEM! |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 22 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 23 | Note that make++, a make tool written in Perl, supports enough |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame^] | 24 | features of GNU make to compile FreeType. See |
| 25 | |
| 26 | http://makepp.sourceforge.net |
| 27 | |
| 28 | for more information; you need version 1.19 or newer, and you must |
| 29 | pass option `--norc-substitution'. |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 30 | |
| 31 | Make sure that you are invoking GNU Make from the command line, by |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 32 | typing something like: |
| 33 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 34 | make -v |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 35 | |
| 36 | to display its version number. |
| 37 | |
| 38 | VERSION 3.78.1 OR NEWER IS NEEDED! |
| 39 | |
| 40 | |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame^] | 41 | 2. Invoke `make' |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 42 | ---------------- |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 43 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 44 | Go to the root directory of FreeType 2, then simply invoke GNU Make |
| 45 | from the command line. This will launch the FreeType 2 host |
| 46 | platform detection routines. A summary will be displayed, for |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 47 | example, on Win32: |
| 48 | |
| 49 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 50 | ============================================================== |
| 51 | FreeType build system -- automatic system detection |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 52 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 53 | The following settings are used: |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 54 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 55 | platform win32 |
| 56 | compiler gcc |
| 57 | configuration directory ./builds/win32 |
| 58 | configuration rules ./builds/win32/w32-gcc.mk |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 59 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 60 | If this does not correspond to your system or settings please |
| 61 | remove the file 'config.mk' from this directory then read the |
| 62 | INSTALL file for help. |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 63 | |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame^] | 64 | Otherwise, simply type 'make' again to build the library |
| 65 | or 'make refdoc' to build the API reference (the latter needs |
| 66 | python). |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 67 | ============================================================= |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 68 | |
| 69 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 70 | If the detected settings correspond to your platform and compiler, |
| 71 | skip to step 5. Note that if your platform is completely alien to |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame^] | 72 | the build system, the detected platform will be `ansi'. |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 73 | |
| 74 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 75 | 3. Configure the build system for a different compiler |
| 76 | ------------------------------------------------------ |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 77 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 78 | If the build system correctly detected your platform, but you want |
| 79 | to use a different compiler than the one specified in the summary |
| 80 | (for most platforms, gcc is the defaut compiler), invoke GNU Make |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 81 | with |
| 82 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 83 | make setup <compiler> |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 84 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 85 | Examples: |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 86 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 87 | to use Visual C++ on Win32, type: "make setup visualc" |
| 88 | to use Borland C++ on Win32, type "make setup bcc32" |
| 89 | to use Watcom C++ on Win32, type "make setup watcom" |
| 90 | to use Intel C++ on Win32, type "make setup intelc" |
| 91 | to use LCC-Win32 on Win32, type: "make setup lcc" |
| 92 | to use Watcom C++ on OS/2, type "make setup watcom" |
| 93 | to use VisualAge C++ on OS/2, type "make setup visualage" |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 94 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 95 | The <compiler> name to use is platform-dependent. The list of |
| 96 | available compilers for your system is available in the file |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame^] | 97 | `builds/<system>/detect.mk'. |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 98 | |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame^] | 99 | If you are satisfied by the new configuration summary, skip to |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 100 | step 5. |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 101 | |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 102 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 103 | 4. Configure the build system for an unknown platform/compiler |
| 104 | -------------------------------------------------------------- |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 105 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 106 | The auto-detection/setup phase of the build system copies a file to |
| 107 | the current directory under the name `config.mk'. |
| 108 | |
| 109 | For example, on OS/2+gcc, it would simply copy |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 110 | `builds/os2/os2-gcc.mk' to `./config.mk'. |
| 111 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 112 | If for some reason your platform isn't correctly detected, copy |
| 113 | manually the configuration sub-makefile to `./config.mk' and go to |
| 114 | step 5. |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 115 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 116 | Note that this file is a sub-Makefile used to specify Make variables |
| 117 | for compiler and linker invocation during the build. You can easily |
| 118 | create your own version from one of the existing configuration |
| 119 | files, then copy it to the current directory under the name |
| 120 | `./config.mk'. |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 121 | |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 122 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 123 | 5. Build the library |
| 124 | -------------------- |
| 125 | |
| 126 | The auto-detection/setup phase should have copied a file in the |
| 127 | current directory, called `./config.mk'. This file contains |
| 128 | definitions of various Make variables used to invoke the compiler |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 129 | and linker during the build. |
| 130 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 131 | To launch the build, simply invoke GNU Make again: The top Makefile |
| 132 | will detect the configuration file and run the build with it. |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 133 | |
| 134 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 135 | Final note |
David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame] | 136 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 137 | The build system builds a statically linked library of the font |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame^] | 138 | engine in the `objs' directory. It does _not_ support the build of |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 139 | DLLs on Windows and OS/2. If you need these, you have to either use |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame^] | 140 | an IDE-specific project file, or follow the instructions in |
| 141 | `INSTALL.ANY' to create your own Makefiles. |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 142 | |
Werner Lemberg | 56c368c | 2005-06-04 23:00:25 +0000 | [diff] [blame] | 143 | ------------------------------------------------------------------------ |
| 144 | |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame^] | 145 | Copyright 2003, 2004, 2005 by |
Werner Lemberg | 56c368c | 2005-06-04 23:00:25 +0000 | [diff] [blame] | 146 | David Turner, Robert Wilhelm, and Werner Lemberg. |
| 147 | |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame^] | 148 | This file is part of the FreeType project, and may only be used, |
| 149 | modified, and distributed under the terms of the FreeType project |
| 150 | license, LICENSE.TXT. By continuing to use, modify, or distribute this |
| 151 | file you indicate that you have read the license and understand and |
Werner Lemberg | 56c368c | 2005-06-04 23:00:25 +0000 | [diff] [blame] | 152 | accept it fully. |
| 153 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 154 | |
| 155 | --- end of INSTALL.GNU --- |