blob: 0dab2c60a1b9f289b57ef1081072edf5524118cb [file] [log] [blame]
Werner Lemberg59939242006-01-31 20:17:42 +00001This document contains instructions on how to build the FreeType
2library on Unix systems. This also works for emulations like Cygwin
3or MSys on Win32:
David Turner66cbc202003-03-20 07:04:40 +00004
5
Werner Lemberga16c4a72003-04-21 13:30:27 +00006 1. Ensure that you are using GNU Make
David Turner66cbc202003-03-20 07:04:40 +00007 -------------------------------------
8
Werner Lemberg59939242006-01-31 20:17:42 +00009 The FreeType build system _exclusively_ works with GNU Make. You
10 will not be able to compile the library with the instructions
11 below using any other alternative (including BSD Make).
David Turner66cbc202003-03-20 07:04:40 +000012
David Turner9750fcb2007-01-04 23:14:48 +000013 Check that you have GNU make by running the command:
Werner Lemberga7235262005-08-30 00:22:46 +000014
David Turner9750fcb2007-01-04 23:14:48 +000015 make -v
Werner Lemberga7235262005-08-30 00:22:46 +000016
David Turner9750fcb2007-01-04 23:14:48 +000017 This should dump some text that begins with:
Werner Lemberga16c4a72003-04-21 13:30:27 +000018
David Turner9750fcb2007-01-04 23:14:48 +000019 GNU Make <version number>
20 Copyright (C) <year> Free Software Foundation Inc.
David Turner66cbc202003-03-20 07:04:40 +000021
Werner Lemberg4e33f9e2008-07-05 06:35:28 +000022 Note that version 3.80 or higher is *required* or the build will
David Turner9750fcb2007-01-04 23:14:48 +000023 fail.
David Turner66cbc202003-03-20 07:04:40 +000024
Werner Lemberg4ea0a7f2007-01-05 09:03:31 +000025 It is also fine to have GNU Make under another name (e.g. 'gmake')
Werner Lemberg6f1e3452013-03-21 09:00:27 +010026 if you use the MAKE variable as described below.
David Turner9750fcb2007-01-04 23:14:48 +000027
Werner Lemberg4ea0a7f2007-01-05 09:03:31 +000028 As a special exception, 'makepp' can also be used to build
29 FreeType 2. See the file docs/MAKEPP for details.
David Turner66cbc202003-03-20 07:04:40 +000030
31
Werner Lemberg4ea0a7f2007-01-05 09:03:31 +000032 2. Regenerate the configure script if needed
33 --------------------------------------------
David Turner9750fcb2007-01-04 23:14:48 +000034
John Tytgat391c7932010-11-23 16:27:26 +010035 This only applies if you are building a git snapshot or checkout,
Werner Lemberg4ea0a7f2007-01-05 09:03:31 +000036 *not* if you grabbed the sources of an official release.
David Turner9750fcb2007-01-04 23:14:48 +000037
Werner Lemberg4ea0a7f2007-01-05 09:03:31 +000038 You need to invoke the `autogen.sh' script in the top-level
39 directory in order to create the `configure' script for your
40 platform. Normally, this simply means typing:
David Turner9750fcb2007-01-04 23:14:48 +000041
Werner Lemberg4ea0a7f2007-01-05 09:03:31 +000042 sh autogen.sh
David Turner9750fcb2007-01-04 23:14:48 +000043
Werner Lemberg4ea0a7f2007-01-05 09:03:31 +000044 In case of problems, you may need to install or upgrade Automake,
John Tytgat391c7932010-11-23 16:27:26 +010045 Autoconf or Libtool. See README.git in the top-level directory
Werner Lemberg4ea0a7f2007-01-05 09:03:31 +000046 for more information.
47
David Turner9750fcb2007-01-04 23:14:48 +000048
49 3. Build and install the library
Werner Lemberga16c4a72003-04-21 13:30:27 +000050 --------------------------------
David Turner66cbc202003-03-20 07:04:40 +000051
Werner Lemberg59939242006-01-31 20:17:42 +000052 The following should work on all Unix systems where the `make'
David Turner66cbc202003-03-20 07:04:40 +000053 command invokes GNU Make:
54
Werner Lemberga16c4a72003-04-21 13:30:27 +000055 ./configure [options]
David Turner66cbc202003-03-20 07:04:40 +000056 make
57 make install (as root)
58
Werner Lemberg59939242006-01-31 20:17:42 +000059 The default installation path is `/usr/local'. It can be changed
Werner Lemberga16c4a72003-04-21 13:30:27 +000060 with the `--prefix=<path>' option. Example:
David Turner66cbc202003-03-20 07:04:40 +000061
Werner Lemberga16c4a72003-04-21 13:30:27 +000062 ./configure --prefix=/usr
63
Werner Lemberg6f1e3452013-03-21 09:00:27 +010064 When using a different command to invoke GNU Make, use the MAKE
Werner Lemberg59939242006-01-31 20:17:42 +000065 variable. For example, if `gmake' is the command to use on your
David Turner66cbc202003-03-20 07:04:40 +000066 system, do something like:
67
Werner Lemberg6f1e3452013-03-21 09:00:27 +010068 MAKE=gmake ./configure [options]
David Turner66cbc202003-03-20 07:04:40 +000069 gmake
70 gmake install (as root)
71
Werner Lemberg59939242006-01-31 20:17:42 +000072 If this still doesn't work, there must be a problem with your
73 system (e.g., you are using a very old version of GNU Make).
Werner Lemberga16c4a72003-04-21 13:30:27 +000074
Werner Lemberg59939242006-01-31 20:17:42 +000075 It is possible to compile FreeType in a different directory.
76 Assuming the FreeType source files in directory `/src/freetype' a
Werner Lemberga16c4a72003-04-21 13:30:27 +000077 compilation in directory `foo' works as follows:
78
79 cd foo
80 /src/freetype/configure [options]
81 make
82 make install
David Turner66cbc202003-03-20 07:04:40 +000083
Werner Lemberg86026a42014-03-01 06:57:19 +010084
85 3.1 Interdependency with HarfBuzz
86 .................................
87
88 Note that there is a chicken-and-egg problem currently since the
89 HarfBuzz library (used by the auto-hinter to improve support of
90 OpenType fonts) depends on FreeType, which can be solved as
91 follows in case HarfBuzz is not yet installed on your system.
92
Werner Lemberg476a7662014-03-01 16:26:05 +010093 1. Call FreeType's `configure' script with option
Werner Lemberg86026a42014-03-01 06:57:19 +010094 `--without-harfbuzz', then compile and install FreeType.
95
96 2. Compile and install HarfBuzz.
97
Werner Lemberg476a7662014-03-01 16:26:05 +010098 3. Call FreeType's `configure' script without option
99 `--without-harfbuzz' (after executing `make distclean'), then
100 compile and install FreeType again.
Werner Lemberg86026a42014-03-01 06:57:19 +0100101
102
Werner Lemberg59939242006-01-31 20:17:42 +0000103----------------------------------------------------------------------
David Turner66cbc202003-03-20 07:04:40 +0000104
Werner Lembergf57fc592015-01-17 20:41:43 +0100105Copyright 2003-2015 by
Werner Lemberg56c368c2005-06-04 23:00:25 +0000106David Turner, Robert Wilhelm, and Werner Lemberg.
107
Werner Lemberg59939242006-01-31 20:17:42 +0000108This file is part of the FreeType project, and may only be used,
109modified, and distributed under the terms of the FreeType project
110license, LICENSE.TXT. By continuing to use, modify, or distribute
111this file you indicate that you have read the license and understand
112and accept it fully.
Werner Lemberg56c368c2005-06-04 23:00:25 +0000113
114
Werner Lemberg82a07e92006-10-12 06:20:44 +0000115--- end of INSTALL.UNIX ---