blob: 72df50a4eacd643ca99c1d2caace32bec055c8ea [file] [log] [blame]
Werner Lemberg59939242006-01-31 20:17:42 +00001This 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 MSys in Windows, you should follow the instructions
Werner Lemberg82a07e92006-10-12 06:20:44 +00004in 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 Because GNU Make is the only Make tool supported to compile
15 FreeType 2, you should install it on your machine.
David Turner66cbc202003-03-20 07:04:40 +000016
Werner Lemberg59939242006-01-31 20:17:42 +000017 The FreeType 2 build system relies on many features special to GNU
Werner Lemberga7235262005-08-30 00:22:46 +000018 Make.
David Turner66cbc202003-03-20 07:04:40 +000019
Werner Lemberg59939242006-01-31 20:17:42 +000020 NEARLY ALL OTHER MAKE TOOLS FAIL, INCLUDING `BSD MAKE', SO REALLY
Werner Lemberga7235262005-08-30 00:22:46 +000021 INSTALL A RECENT VERSION OF GNU MAKE ON YOUR SYSTEM!
David Turner66cbc202003-03-20 07:04:40 +000022
Werner Lemberg59939242006-01-31 20:17:42 +000023 Note that make++, a make tool written in Perl, supports enough
Werner Lemberga7235262005-08-30 00:22:46 +000024 features of GNU make to compile FreeType. See
Werner Lemberg9b774e22007-01-16 06:11:27 +000025
Werner Lemberga7235262005-08-30 00:22:46 +000026 http://makepp.sourceforge.net
27
Werner Lemberg59939242006-01-31 20:17:42 +000028 for more information; you need version 1.19 or newer, and you must
Werner Lemberga7235262005-08-30 00:22:46 +000029 pass option `--norc-substitution'.
Werner Lemberga16c4a72003-04-21 13:30:27 +000030
Werner Lemberg59939242006-01-31 20:17:42 +000031 Make sure that you are invoking GNU Make from the command line, by
David Turner66cbc202003-03-20 07:04:40 +000032 typing something like:
33
Werner Lemberga16c4a72003-04-21 13:30:27 +000034 make -v
David Turner66cbc202003-03-20 07:04:40 +000035
36 to display its version number.
37
Werner Lemberg4e33f9e2008-07-05 06:35:28 +000038 VERSION 3.80 OR NEWER IS NEEDED!
David Turner66cbc202003-03-20 07:04:40 +000039
40
Werner Lemberga7235262005-08-30 00:22:46 +000041 2. Invoke `make'
Werner Lemberga16c4a72003-04-21 13:30:27 +000042 ----------------
David Turner66cbc202003-03-20 07:04:40 +000043
Werner Lemberg59939242006-01-31 20:17:42 +000044 Go to the root directory of FreeType 2, then simply invoke GNU
45 Make from the command line. This will launch the FreeType 2 host
46 platform detection routines. A summary will be displayed, for
47 example, on Win32.
David Turner66cbc202003-03-20 07:04:40 +000048
49
Werner Lemberga16c4a72003-04-21 13:30:27 +000050 ==============================================================
51 FreeType build system -- automatic system detection
David Turner66cbc202003-03-20 07:04:40 +000052
Werner Lemberga16c4a72003-04-21 13:30:27 +000053 The following settings are used:
David Turner66cbc202003-03-20 07:04:40 +000054
Werner Lemberga16c4a72003-04-21 13:30:27 +000055 platform win32
56 compiler gcc
Werner Lemberg59939242006-01-31 20:17:42 +000057 configuration directory .\builds\win32
58 configuration rules .\builds\win32\w32-gcc.mk
David Turner66cbc202003-03-20 07:04:40 +000059
Werner Lemberga16c4a72003-04-21 13:30:27 +000060 If this does not correspond to your system or settings please
61 remove the file 'config.mk' from this directory then read the
62 INSTALL file for help.
David Turner66cbc202003-03-20 07:04:40 +000063
Werner Lemberga7235262005-08-30 00:22:46 +000064 Otherwise, simply type 'make' again to build the library
65 or 'make refdoc' to build the API reference (the latter needs
66 python).
Werner Lemberga16c4a72003-04-21 13:30:27 +000067 =============================================================
David Turner66cbc202003-03-20 07:04:40 +000068
69
Werner Lemberg59939242006-01-31 20:17:42 +000070 If the detected settings correspond to your platform and compiler,
71 skip to step 5. Note that if your platform is completely alien to
Werner Lemberga7235262005-08-30 00:22:46 +000072 the build system, the detected platform will be `ansi'.
David Turner66cbc202003-03-20 07:04:40 +000073
74
Werner Lemberga16c4a72003-04-21 13:30:27 +000075 3. Configure the build system for a different compiler
76 ------------------------------------------------------
David Turner66cbc202003-03-20 07:04:40 +000077
Werner Lemberg59939242006-01-31 20:17:42 +000078 If the build system correctly detected your platform, but you want
79 to use a different compiler than the one specified in the summary
Werner Lembergb4142d52007-01-17 12:45:26 +000080 (for most platforms, gcc is the default compiler), invoke GNU Make
David Turner66cbc202003-03-20 07:04:40 +000081 with
82
Werner Lemberga16c4a72003-04-21 13:30:27 +000083 make setup <compiler>
David Turner66cbc202003-03-20 07:04:40 +000084
Werner Lemberga16c4a72003-04-21 13:30:27 +000085 Examples:
David Turner66cbc202003-03-20 07:04:40 +000086
Werner Lemberg59939242006-01-31 20:17:42 +000087 to use Visual C++ on Win32, type: `make setup visualc'
88 to use Borland C++ on Win32, type `make setup bcc32'
89 to use Watcom C++ on Win32, type `make setup watcom'
90 to use Intel C++ on Win32, type `make setup intelc'
91 to use LCC-Win32 on Win32, type: `make setup lcc'
92 to use Watcom C++ on OS/2, type `make setup watcom'
93 to use VisualAge C++ on OS/2, type `make setup visualage'
David Turner66cbc202003-03-20 07:04:40 +000094
Werner Lemberg59939242006-01-31 20:17:42 +000095 The <compiler> name to use is platform-dependent. The list of
96 available compilers for your system is available in the file
Werner Lemberga7235262005-08-30 00:22:46 +000097 `builds/<system>/detect.mk'.
David Turner66cbc202003-03-20 07:04:40 +000098
Werner Lemberga7235262005-08-30 00:22:46 +000099 If you are satisfied by the new configuration summary, skip to
Werner Lemberga16c4a72003-04-21 13:30:27 +0000100 step 5.
David Turner66cbc202003-03-20 07:04:40 +0000101
David Turner66cbc202003-03-20 07:04:40 +0000102
Werner Lemberga16c4a72003-04-21 13:30:27 +0000103 4. Configure the build system for an unknown platform/compiler
104 --------------------------------------------------------------
David Turner66cbc202003-03-20 07:04:40 +0000105
Werner Lemberg59939242006-01-31 20:17:42 +0000106 The auto-detection/setup phase of the build system copies a file
107 to the current directory under the name `config.mk'.
Werner Lemberga16c4a72003-04-21 13:30:27 +0000108
Werner Lemberg59939242006-01-31 20:17:42 +0000109 For example, on OS/2+gcc, it would simply copy
David Turner66cbc202003-03-20 07:04:40 +0000110 `builds/os2/os2-gcc.mk' to `./config.mk'.
111
Werner Lemberg59939242006-01-31 20:17:42 +0000112 If for some reason your platform isn't correctly detected, copy
113 manually the configuration sub-makefile to `./config.mk' and go to
Werner Lemberga16c4a72003-04-21 13:30:27 +0000114 step 5.
David Turner66cbc202003-03-20 07:04:40 +0000115
Werner Lemberg59939242006-01-31 20:17:42 +0000116 Note that this file is a sub-Makefile used to specify Make
117 variables for compiler and linker invocation during the build.
118 You can easily create your own version from one of the existing
119 configuration files, then copy it to the current directory under
120 the name `./config.mk'.
David Turner66cbc202003-03-20 07:04:40 +0000121
David Turner66cbc202003-03-20 07:04:40 +0000122
Werner Lemberga16c4a72003-04-21 13:30:27 +0000123 5. Build the library
124 --------------------
125
Werner Lemberg59939242006-01-31 20:17:42 +0000126 The auto-detection/setup phase should have copied a file in the
127 current directory, called `./config.mk'. This file contains
128 definitions of various Make variables used to invoke the compiler
129 and linker during the build. [It has also generated a file called
130 `ftmodule.h' in the objects directory (which is normally
131 `<toplevel>/objs/'); please read the file `docs/CUSTOMIZE' for
132 customization of FreeType.]
David Turner66cbc202003-03-20 07:04:40 +0000133
Werner Lemberg59939242006-01-31 20:17:42 +0000134 To launch the build, simply invoke GNU Make again: The top
135 Makefile will detect the configuration file and run the build with
136 it.
David Turner66cbc202003-03-20 07:04:40 +0000137
138
Werner Lemberga16c4a72003-04-21 13:30:27 +0000139 Final note
Werner Lemberg9b774e22007-01-16 06:11:27 +0000140
Werner Lemberg59939242006-01-31 20:17:42 +0000141 The build system builds a statically linked library of the font
142 engine in the `objs' directory. It does _not_ support the build
143 of DLLs on Windows and OS/2. If you need these, you have to
144 either use an IDE-specific project file, or follow the
145 instructions in `INSTALL.ANY' to create your own Makefiles.
Werner Lemberga16c4a72003-04-21 13:30:27 +0000146
Werner Lemberg59939242006-01-31 20:17:42 +0000147----------------------------------------------------------------------
Werner Lemberg56c368c2005-06-04 23:00:25 +0000148
Werner Lemberg4e33f9e2008-07-05 06:35:28 +0000149Copyright 2003, 2004, 2005, 2006, 2008 by
Werner Lemberg56c368c2005-06-04 23:00:25 +0000150David Turner, Robert Wilhelm, and Werner Lemberg.
151
Werner Lemberg59939242006-01-31 20:17:42 +0000152This file is part of the FreeType project, and may only be used,
153modified, and distributed under the terms of the FreeType project
154license, LICENSE.TXT. By continuing to use, modify, or distribute
155this file you indicate that you have read the license and understand
156and accept it fully.
Werner Lemberg56c368c2005-06-04 23:00:25 +0000157
Werner Lemberga16c4a72003-04-21 13:30:27 +0000158
159--- end of INSTALL.GNU ---