David Turner | 66cbc20 | 2003-03-20 07:04:40 +0000 | [diff] [blame^] | 1 | This document contains instructions on how to build the FreeType library |
| 2 | on non-Unix systems with the help of GNU Make. Note that if you're running |
| 3 | Cygwin or MSys in Windows, you should follow the instructions of INSTALL.UNX |
| 4 | instead. |
| 5 | |
| 6 | |
| 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 |
| 9 | command line. To do so, just follow these simple instructions: |
| 10 | |
| 11 | a. Install GNU Make |
| 12 | |
| 13 | Because GNU Make is the only Make tool supported to compile |
| 14 | FreeType 2, you should install it on your machine. |
| 15 | |
| 16 | The FreeType 2 build system relies on many features special to GNU |
| 17 | Make -- trying to build the library with any other Make tool will |
| 18 | *fail*. |
| 19 | |
| 20 | NEARLY ALL OTHER MAKE TOOLS WILL FAIL, INCLUDING "BSD MAKE", SO |
| 21 | REALLY INSTALL A RECENT VERSION OF GNU MAKE ON YOUR SYSTEM! |
| 22 | |
| 23 | Make sure that you are invoking GNU Make from the command line, by |
| 24 | typing something like: |
| 25 | |
| 26 | make -v |
| 27 | |
| 28 | to display its version number. |
| 29 | |
| 30 | VERSION 3.78.1 OR NEWER IS NEEDED! |
| 31 | |
| 32 | |
| 33 | |
| 34 | b. Invoke 'make' |
| 35 | |
| 36 | Go to the root directory of FreeType 2, then simply invoke GNU |
| 37 | Make from the command line. This will launch the FreeType 2 host |
| 38 | platform detection routines. A summary will be displayed, for |
| 39 | example, on Win32: |
| 40 | |
| 41 | |
| 42 | ============================================================== |
| 43 | FreeType build system -- automatic system detection |
| 44 | |
| 45 | The following settings are used: |
| 46 | |
| 47 | platform win32 |
| 48 | compiler gcc |
| 49 | configuration directory ./builds/win32 |
| 50 | configuration rules ./builds/win32/w32-gcc.mk |
| 51 | |
| 52 | If this does not correspond to your system or settings please |
| 53 | remove the file 'config.mk' from this directory then read the |
| 54 | INSTALL file for help. |
| 55 | |
| 56 | Otherwise, simply type 'make' again to build the library. |
| 57 | ============================================================= |
| 58 | |
| 59 | |
| 60 | If the detected settings correspond to your platform and compiler, |
| 61 | skip to step e. Note that if your platform is completely alien to |
| 62 | the build system, the detected platform will be 'ansi'. |
| 63 | |
| 64 | |
| 65 | c. Configure the build system for a different compiler |
| 66 | |
| 67 | If the build system correctly detected your platform, but you want |
| 68 | to use a different compiler than the one specified in the summary |
| 69 | (for most platforms, gcc is the defaut compiler), invoke GNU Make |
| 70 | with |
| 71 | |
| 72 | make setup <compiler> |
| 73 | |
| 74 | For example: |
| 75 | |
| 76 | to use Visual C++ on Win32, type: "make setup visualc" |
| 77 | to use Borland C++ on Win32, type "make setup bcc32" |
| 78 | to use Watcom C++ on Win32, type "make setup watcom" |
| 79 | to use Intel C++ on Win32, type "make setup intelc" |
| 80 | to use LCC-Win32 on Win32, type: "make setup lcc" |
| 81 | to use Watcom C++ on OS/2, type "make setup watcom" |
| 82 | to use VisualAge C++ on OS/2, type "make setup visualage" |
| 83 | |
| 84 | The <compiler> name to use is platform-dependent. The list of |
| 85 | available compilers for your system is available in the file |
| 86 | `builds/<system>/detect.mk' |
| 87 | |
| 88 | If you are satisfied by the new configuration summary, skip to |
| 89 | step e. |
| 90 | |
| 91 | d. Configure the build system for an unknown platform/compiler |
| 92 | |
| 93 | The auto-detection/setup phase of the build system copies a file |
| 94 | to the current directory under the name `config.mk'. |
| 95 | |
| 96 | For example, on OS/2+gcc, it would simply copy |
| 97 | `builds/os2/os2-gcc.mk' to `./config.mk'. |
| 98 | |
| 99 | If for some reason your platform isn't correctly detected, copy |
| 100 | manually the configuration sub-makefile to `./config.mk' and go to |
| 101 | step e. |
| 102 | |
| 103 | Note that this file is a sub-Makefile used to specify Make |
| 104 | variables for compiler and linker invocation during the build. |
| 105 | You can easily create your own version from one of the existing |
| 106 | configuration files, then copy it to the current directory under |
| 107 | the name `./config.mk'. |
| 108 | |
| 109 | e. Build the library |
| 110 | |
| 111 | The auto-detection/setup phase should have copied a file in the |
| 112 | current directory, called `./config.mk'. This file contains |
| 113 | definitions of various Make variables used to invoke the compiler |
| 114 | and linker during the build. |
| 115 | |
| 116 | To launch the build, simply invoke GNU Make again: The top |
| 117 | Makefile will detect the configuration file and run the build with |
| 118 | it. |
| 119 | |
| 120 | |
| 121 | |
| 122 | Final note: |
| 123 | |
| 124 | the build system builds a statically linked library of the font engine |
| 125 | in the "objs" directory. It does _not_ support the build of DLLs on |
| 126 | Windows and OS/2, if you need these, you'll have to either use |
| 127 | a IDE-specific project file, or follow the instructions in |
| 128 | "INSTALL.ANY" to create your own Makefiles. |