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