blob: 5e161ad943edba8722303da9afd77d1e4cfa4e1f [file] [log] [blame]
Werner Lemberg6a7df622013-07-20 10:48:37 +02001This 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.
David Turner66cbc202003-03-20 07:04:40 +00005
6
Werner Lemberg59939242006-01-31 20:17:42 +00007 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.
David Turner66cbc202003-03-20 07:04:40 +000010
Werner Lemberga16c4a72003-04-21 13:30:27 +000011 1. Install GNU Make
12 -------------------
David Turner66cbc202003-03-20 07:04:40 +000013
Werner Lemberg59939242006-01-31 20:17:42 +000014 The FreeType 2 build system relies on many features special to GNU
Werner Lemberga7235262005-08-30 00:22:46 +000015 Make.
David Turner66cbc202003-03-20 07:04:40 +000016
Werner Lemberg59939242006-01-31 20:17:42 +000017 NEARLY ALL OTHER MAKE TOOLS FAIL, INCLUDING `BSD MAKE', SO REALLY
Werner Lemberga7235262005-08-30 00:22:46 +000018 INSTALL A RECENT VERSION OF GNU MAKE ON YOUR SYSTEM!
David Turner66cbc202003-03-20 07:04:40 +000019
Werner Lemberg59939242006-01-31 20:17:42 +000020 Note that make++, a make tool written in Perl, supports enough
Werner Lemberga7235262005-08-30 00:22:46 +000021 features of GNU make to compile FreeType. See
Werner Lemberg9b774e22007-01-16 06:11:27 +000022
Werner Lembergafa043d2018-12-25 22:44:05 +010023 https://makepp.sourceforge.net
Werner Lemberga7235262005-08-30 00:22:46 +000024
Alexei Podtelezhnikov843193b2018-04-15 16:27:10 -040025 for more information; you need version 2.0 or newer, and you must
Werner Lemberga7235262005-08-30 00:22:46 +000026 pass option `--norc-substitution'.
Werner Lemberga16c4a72003-04-21 13:30:27 +000027
Werner Lemberg59939242006-01-31 20:17:42 +000028 Make sure that you are invoking GNU Make from the command line, by
David Turner66cbc202003-03-20 07:04:40 +000029 typing something like:
30
Werner Lemberga16c4a72003-04-21 13:30:27 +000031 make -v
David Turner66cbc202003-03-20 07:04:40 +000032
33 to display its version number.
34
Alexei Podtelezhnikov843193b2018-04-15 16:27:10 -040035 VERSION 3.81 OR NEWER IS NEEDED!
David Turner66cbc202003-03-20 07:04:40 +000036
37
Werner Lemberga7235262005-08-30 00:22:46 +000038 2. Invoke `make'
Werner Lemberga16c4a72003-04-21 13:30:27 +000039 ----------------
David Turner66cbc202003-03-20 07:04:40 +000040
Werner Lemberg59939242006-01-31 20:17:42 +000041 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.
David Turner66cbc202003-03-20 07:04:40 +000045
46
Werner Lemberga16c4a72003-04-21 13:30:27 +000047 ==============================================================
48 FreeType build system -- automatic system detection
David Turner66cbc202003-03-20 07:04:40 +000049
Werner Lemberga16c4a72003-04-21 13:30:27 +000050 The following settings are used:
David Turner66cbc202003-03-20 07:04:40 +000051
Werner Lembergab98c5e2014-02-08 11:34:33 +010052 platform windows
Werner Lemberga16c4a72003-04-21 13:30:27 +000053 compiler gcc
Kenneth Miller4d87ac82013-10-23 20:10:56 +020054 configuration directory .\builds\windows
55 configuration rules .\builds\windows\w32-gcc.mk
David Turner66cbc202003-03-20 07:04:40 +000056
Werner Lemberga16c4a72003-04-21 13:30:27 +000057 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.
David Turner66cbc202003-03-20 07:04:40 +000060
Werner Lemberga7235262005-08-30 00:22:46 +000061 Otherwise, simply type 'make' again to build the library
62 or 'make refdoc' to build the API reference (the latter needs
Nikhil Ramakrishnan1fd31482020-03-21 20:17:17 +053063 Python >= 3.5).
Werner Lemberga16c4a72003-04-21 13:30:27 +000064 =============================================================
David Turner66cbc202003-03-20 07:04:40 +000065
66
Werner Lemberg59939242006-01-31 20:17:42 +000067 If the detected settings correspond to your platform and compiler,
68 skip to step 5. Note that if your platform is completely alien to
Werner Lemberga7235262005-08-30 00:22:46 +000069 the build system, the detected platform will be `ansi'.
David Turner66cbc202003-03-20 07:04:40 +000070
71
Werner Lemberga16c4a72003-04-21 13:30:27 +000072 3. Configure the build system for a different compiler
73 ------------------------------------------------------
David Turner66cbc202003-03-20 07:04:40 +000074
Werner Lemberg59939242006-01-31 20:17:42 +000075 If the build system correctly detected your platform, but you want
76 to use a different compiler than the one specified in the summary
Werner Lembergb4142d52007-01-17 12:45:26 +000077 (for most platforms, gcc is the default compiler), invoke GNU Make
David Turner66cbc202003-03-20 07:04:40 +000078 with
79
Werner Lemberga16c4a72003-04-21 13:30:27 +000080 make setup <compiler>
David Turner66cbc202003-03-20 07:04:40 +000081
Werner Lemberga16c4a72003-04-21 13:30:27 +000082 Examples:
David Turner66cbc202003-03-20 07:04:40 +000083
Werner Lemberg59939242006-01-31 20:17:42 +000084 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'
David Turner66cbc202003-03-20 07:04:40 +000091
Werner Lemberg59939242006-01-31 20:17:42 +000092 The <compiler> name to use is platform-dependent. The list of
93 available compilers for your system is available in the file
Werner Lemberga7235262005-08-30 00:22:46 +000094 `builds/<system>/detect.mk'.
David Turner66cbc202003-03-20 07:04:40 +000095
Werner Lemberga7235262005-08-30 00:22:46 +000096 If you are satisfied by the new configuration summary, skip to
Werner Lemberga16c4a72003-04-21 13:30:27 +000097 step 5.
David Turner66cbc202003-03-20 07:04:40 +000098
David Turner66cbc202003-03-20 07:04:40 +000099
Werner Lembergd5869272021-06-08 17:44:34 +0200100 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
Werner Lemberga16c4a72003-04-21 13:30:27 +0000122 4. Configure the build system for an unknown platform/compiler
123 --------------------------------------------------------------
David Turner66cbc202003-03-20 07:04:40 +0000124
Werner Lemberg59939242006-01-31 20:17:42 +0000125 The auto-detection/setup phase of the build system copies a file
126 to the current directory under the name `config.mk'.
Werner Lemberga16c4a72003-04-21 13:30:27 +0000127
Werner Lemberg59939242006-01-31 20:17:42 +0000128 For example, on OS/2+gcc, it would simply copy
David Turner66cbc202003-03-20 07:04:40 +0000129 `builds/os2/os2-gcc.mk' to `./config.mk'.
130
Werner Lemberg59939242006-01-31 20:17:42 +0000131 If for some reason your platform isn't correctly detected, copy
132 manually the configuration sub-makefile to `./config.mk' and go to
Werner Lemberga16c4a72003-04-21 13:30:27 +0000133 step 5.
David Turner66cbc202003-03-20 07:04:40 +0000134
Werner Lemberg59939242006-01-31 20:17:42 +0000135 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'.
David Turner66cbc202003-03-20 07:04:40 +0000140
David Turner66cbc202003-03-20 07:04:40 +0000141
Werner Lemberga16c4a72003-04-21 13:30:27 +0000142 5. Build the library
143 --------------------
144
Werner Lemberg59939242006-01-31 20:17:42 +0000145 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.]
David Turner66cbc202003-03-20 07:04:40 +0000152
Werner Lemberg59939242006-01-31 20:17:42 +0000153 To launch the build, simply invoke GNU Make again: The top
154 Makefile will detect the configuration file and run the build with
Werner Lemberg801cd842021-07-18 07:53:57 +0200155 it. If you have used variables in step 3, you must use the same
Werner Lembergd5869272021-06-08 17:44:34 +0200156 variables here, too.
David Turner66cbc202003-03-20 07:04:40 +0000157
158
Werner Lemberga16c4a72003-04-21 13:30:27 +0000159 Final note
Werner Lemberg9b774e22007-01-16 06:11:27 +0000160
Werner Lemberg6a7df622013-07-20 10:48:37 +0200161 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++
Kenneth Miller4d87ac82013-10-23 20:10:56 +0200165 project files; see the subdirectories of `builds/windows'. For
Werner Lemberg6a7df622013-07-20 10:48:37 +0200166 everything else, you are on your own, and you might follow the
Werner Lemberg59939242006-01-31 20:17:42 +0000167 instructions in `INSTALL.ANY' to create your own Makefiles.
Werner Lemberga16c4a72003-04-21 13:30:27 +0000168
Werner Lemberg59939242006-01-31 20:17:42 +0000169----------------------------------------------------------------------
Werner Lemberg56c368c2005-06-04 23:00:25 +0000170
Werner Lembergd0cfb4e2022-01-11 10:54:10 +0100171Copyright (C) 2003-2022 by
Werner Lemberg56c368c2005-06-04 23:00:25 +0000172David Turner, Robert Wilhelm, and Werner Lemberg.
173
Werner Lemberg59939242006-01-31 20:17:42 +0000174This 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.
Werner Lemberg56c368c2005-06-04 23:00:25 +0000179
Werner Lemberga16c4a72003-04-21 13:30:27 +0000180
181--- end of INSTALL.GNU ---