• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1This  document contains  instructions  on how  to  build the  FreeType
2library on Unix  systems.  This also works for  emulations like Cygwin
3or MSys on Win32:
4
5
6  1. Ensure that you are using GNU Make
7  -------------------------------------
8
9    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).
12
13    Check that you have GNU make by running the command:
14
15       make -v
16
17    This should dump some text that begins with:
18
19       GNU Make  <version number>
20       Copyright (C) <year> Free Software Foundation Inc.
21
22    Note that version  3.81 or higher is *required* or the  build will
23    fail.
24
25    It is also fine to have GNU Make under another name (e.g. 'gmake')
26    if you use the MAKE variable as described below.
27
28    As  a  special exception,  'makepp'  can  also  be used  to  build
29    FreeType 2.  See the file docs/MAKEPP for details.
30
31    For builds  with `cmake' please check file `CMakeLists.txt';  this
32    is a contributed file not directly supported by the FreeType team.
33
34
35  2. Regenerate the configure script if needed
36  --------------------------------------------
37
38    This only applies if you  are building a git snapshot or checkout,
39    *not* if you grabbed the sources of an official release.
40
41    You  need  to invoke  the  `autogen.sh'  script  in the  top-level
42    directory  in order  to  create the  `configure'  script for  your
43    platform.  Normally, this simply means typing:
44
45      sh autogen.sh
46
47    In case of problems, you may  need to install or upgrade Automake,
48    Autoconf or Libtool.  See  `README.git' in the top-level directory
49    for more information.
50
51
52  3. Build and install the library
53  --------------------------------
54
55    Say
56
57      ./configure --help
58
59    to see  the list of  possible configuration options  and important
60    environment  variables.  The ./configure script  will detect  some
61    prerequisite  system  libraries  (libpng, brotli, etc.)  if  their
62    headers are available at the default locations.
63
64    The following  should work  on all Unix  systems where  the `make'
65    command invokes GNU Make:
66
67      ./configure [options]
68      make
69      make install           (as root)
70
71    The default installation path  is `/usr/local'.  It can be changed
72    with the `--prefix=<path>' option.  Example:
73
74      ./configure --prefix=/usr
75
76    When using  a different command  to invoke GNU Make,  use the MAKE
77    variable.  For example,  if `gmake' is the command  to use on your
78    system, do something like:
79
80       MAKE=gmake ./configure [options]
81       gmake
82       gmake install            (as root)
83
84    If  this still doesn't  work, there  must be  a problem  with your
85    system (e.g., you are using a very old version of GNU Make).
86
87    For library identification, FreeType's `configure' script uses the
88    `pkg-config' interface: Assuming it  needs library `foo', it calls
89    the  `pkg-config' program  to find  information on  library `foo',
90    which in turn  looks for a `foo.pc' file installed  at the system.
91    Some platforms,  however, don't come with  `pkg-support'; you then
92    have  to  use environment  variables  as  described by  `configure
93    --help'.  Example:
94
95      LIBPNG_CFLAGS="-I/path/to/libpng/include/directory" \
96      LIBPNG_LIBS="-L/path/to/libpng/lib/directory" \
97      configure ...
98
99    It  is possible  to  compile FreeType  in  a different  directory.
100    Assuming the FreeType source  files in directory `/src/freetype' a
101    compilation in directory `foo' works as follows:
102
103      cd foo
104      /src/freetype/configure [options]
105      make
106      make install
107
108
109  3.1 Interdependency with HarfBuzz
110  .................................
111
112    Note that there  is a chicken-and-egg problem  currently since the
113    HarfBuzz library  (used by the  auto-hinter to improve  support of
114    OpenType  fonts)  depends on  FreeType,  which  can be  solved  as
115    follows in case HarfBuzz is not yet installed on your system.
116
117    1. Call    FreeType's     `configure'    script     with    option
118       `--without-harfbuzz', then compile and install FreeType.
119
120    2. Compile and install HarfBuzz.
121
122    3. Call    FreeType's    `configure'   script    without    option
123       `--without-harfbuzz' (after  executing `make  distclean'), then
124       compile and install FreeType again.
125
126
127----------------------------------------------------------------------
128
129Copyright (C) 2003-2022 by
130David Turner, Robert Wilhelm, and Werner Lemberg.
131
132This  file is  part of  the FreeType  project, and  may only  be used,
133modified,  and distributed  under the  terms of  the  FreeType project
134license,  LICENSE.TXT.  By  continuing to  use, modify,  or distribute
135this file you  indicate that you have read  the license and understand
136and accept it fully.
137
138
139--- end of INSTALL.UNIX ---
140