1This document contains instructions how to build the FreeType library 2on non-Unix systems with the help of GNU Make. Note that if you are 3running Cygwin or MinGW/MSYS in Windows, you should follow the 4instructions in the file `INSTALL.UNIX' 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 1. Install GNU Make 12 ------------------- 13 14 The FreeType 2 build system relies on many features special to GNU 15 Make. 16 17 NEARLY ALL OTHER MAKE TOOLS FAIL, INCLUDING `BSD MAKE', SO REALLY 18 INSTALL A RECENT VERSION OF GNU MAKE ON YOUR SYSTEM! 19 20 Note that make++, a make tool written in Perl, supports enough 21 features of GNU make to compile FreeType. See 22 23 https://makepp.sourceforge.net 24 25 for more information; you need version 2.0 or newer, and you must 26 pass option `--norc-substitution'. 27 28 Make sure that you are invoking GNU Make from the command line, by 29 typing something like: 30 31 make -v 32 33 to display its version number. 34 35 VERSION 3.81 OR NEWER IS NEEDED! 36 37 38 2. Invoke `make' 39 ---------------- 40 41 Go to the root directory of FreeType 2, then simply invoke GNU 42 Make from the command line. This will launch the FreeType 2 host 43 platform detection routines. A summary will be displayed, for 44 example, on Win32. 45 46 47 ============================================================== 48 FreeType build system -- automatic system detection 49 50 The following settings are used: 51 52 platform windows 53 compiler gcc 54 configuration directory .\builds\windows 55 configuration rules .\builds\windows\w32-gcc.mk 56 57 If this does not correspond to your system or settings please 58 remove the file 'config.mk' from this directory then read the 59 INSTALL file for help. 60 61 Otherwise, simply type 'make' again to build the library 62 or 'make refdoc' to build the API reference (the latter needs 63 Python >= 3.5). 64 ============================================================= 65 66 67 If the detected settings correspond to your platform and compiler, 68 skip to step 5. Note that if your platform is completely alien to 69 the build system, the detected platform will be `ansi'. 70 71 72 3. Configure the build system for a different compiler 73 ------------------------------------------------------ 74 75 If the build system correctly detected your platform, but you want 76 to use a different compiler than the one specified in the summary 77 (for most platforms, gcc is the default compiler), invoke GNU Make 78 with 79 80 make setup <compiler> 81 82 Examples: 83 84 to use Visual C++ on Win32, type: `make setup visualc' 85 to use Borland C++ on Win32, type `make setup bcc32' 86 to use Watcom C++ on Win32, type `make setup watcom' 87 to use Intel C++ on Win32, type `make setup intelc' 88 to use LCC-Win32 on Win32, type: `make setup lcc' 89 to use Watcom C++ on OS/2, type `make setup watcom' 90 to use VisualAge C++ on OS/2, type `make setup visualage' 91 92 The <compiler> name to use is platform-dependent. The list of 93 available compilers for your system is available in the file 94 `builds/<system>/detect.mk'. 95 96 If you are satisfied by the new configuration summary, skip to 97 step 5. 98 99 100 3a. Use clang instead of gcc 101 ---------------------------- 102 103 The `clang' compiler can use FreeType's setup for `gcc'; it is 104 sufficient to set the `CC' variable, for example 105 106 make CC=clang 107 108 109 3b. Compiling with a C++ compiler 110 --------------------------------- 111 112 FreeType can be built with a C++ compiler, for example 113 114 make CC="g++" 115 116 If `clang++' should be used it is necessary to also override the 117 `ANSIFLAGS' variable: 118 119 make CC="clang++" ANSIFLAGS="" 120 121 122 4. Configure the build system for an unknown platform/compiler 123 -------------------------------------------------------------- 124 125 The auto-detection/setup phase of the build system copies a file 126 to the current directory under the name `config.mk'. 127 128 For example, on OS/2+gcc, it would simply copy 129 `builds/os2/os2-gcc.mk' to `./config.mk'. 130 131 If for some reason your platform isn't correctly detected, copy 132 manually the configuration sub-makefile to `./config.mk' and go to 133 step 5. 134 135 Note that this file is a sub-Makefile used to specify Make 136 variables for compiler and linker invocation during the build. 137 You can easily create your own version from one of the existing 138 configuration files, then copy it to the current directory under 139 the name `./config.mk'. 140 141 142 5. Build the library 143 -------------------- 144 145 The auto-detection/setup phase should have copied a file in the 146 current directory, called `./config.mk'. This file contains 147 definitions of various Make variables used to invoke the compiler 148 and linker during the build. [It has also generated a file called 149 `ftmodule.h' in the objects directory (which is normally 150 `<toplevel>/objs/'); please read the file `docs/CUSTOMIZE' for 151 customization of FreeType.] 152 153 To launch the build, simply invoke GNU Make again: The top 154 Makefile will detect the configuration file and run the build with 155 it. If you have used variables in step 3, you must use the same 156 variables here, too. 157 158 159 Final note 160 161 The above instructions build a _statically_ linked library of the 162 font engine in the `objs' directory. On Windows, you can build a 163 DLL either with MinGW (within an MSYS shell, following the 164 instructions in `INSTALL.UNIX'), or you use one of the Visual C++ 165 project files; see the subdirectories of `builds/windows'. For 166 everything else, you are on your own, and you might follow the 167 instructions in `INSTALL.ANY' to create your own Makefiles. 168 169---------------------------------------------------------------------- 170 171Copyright (C) 2003-2021 by 172David Turner, Robert Wilhelm, and Werner Lemberg. 173 174This file is part of the FreeType project, and may only be used, 175modified, and distributed under the terms of the FreeType project 176license, LICENSE.TXT. By continuing to use, modify, or distribute 177this file you indicate that you have read the license and understand 178and accept it fully. 179 180 181--- end of INSTALL.GNU --- 182