blob: 096b4b5f6f7ae089b0a588c26c0ad016eb128c38 [file] [log] [blame]
Werner Lemberga16c4a72003-04-21 13:30:27 +00001This document contains instructions how to build the FreeType library on
2non-Unix systems with the help of GNU Make. Note that if you are
3running Cygwin or MSys in Windows, you should follow the instructions in
4the file INSTALL.UNX instead.
David Turner66cbc202003-03-20 07:04:40 +00005
6
Werner Lemberga16c4a72003-04-21 13:30:27 +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
David Turner66cbc202003-03-20 07:04:40 +00009 command line. To do so, just follow these simple instructions:
10
Werner Lemberga16c4a72003-04-21 13:30:27 +000011 1. Install GNU Make
12 -------------------
David Turner66cbc202003-03-20 07:04:40 +000013
Werner Lemberga7235262005-08-30 00:22:46 +000014 Because GNU Make is the only Make tool supported to compile FreeType
15 2, you should install it on your machine.
David Turner66cbc202003-03-20 07:04:40 +000016
Werner Lemberga16c4a72003-04-21 13:30:27 +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 Lemberga7235262005-08-30 00:22:46 +000020 NEARLY ALL OTHER MAKE TOOLS FAIL, INCLUDING `BSD MAKE', SO REALLY
21 INSTALL A RECENT VERSION OF GNU MAKE ON YOUR SYSTEM!
David Turner66cbc202003-03-20 07:04:40 +000022
Werner Lemberga16c4a72003-04-21 13:30:27 +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
25
26 http://makepp.sourceforge.net
27
28 for more information; you need version 1.19 or newer, and you must
29 pass option `--norc-substitution'.
Werner Lemberga16c4a72003-04-21 13:30:27 +000030
31 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
38 VERSION 3.78.1 OR NEWER IS NEEDED!
39
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 Lemberga16c4a72003-04-21 13:30:27 +000044 Go to the root directory of FreeType 2, then simply invoke GNU Make
45 from the command line. This will launch the FreeType 2 host
46 platform detection routines. A summary will be displayed, for
David Turner66cbc202003-03-20 07:04:40 +000047 example, on Win32:
48
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
57 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 Lemberga16c4a72003-04-21 13:30:27 +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 Lemberga16c4a72003-04-21 13:30:27 +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
80 (for most platforms, gcc is the defaut 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 Lemberga16c4a72003-04-21 13:30:27 +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 Lemberga16c4a72003-04-21 13:30:27 +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 Lemberga16c4a72003-04-21 13:30:27 +0000106 The auto-detection/setup phase of the build system copies a file to
107 the current directory under the name `config.mk'.
108
109 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 Lemberga16c4a72003-04-21 13:30:27 +0000112 If for some reason your platform isn't correctly detected, copy
113 manually the configuration sub-makefile to `./config.mk' and go to
114 step 5.
David Turner66cbc202003-03-20 07:04:40 +0000115
Werner Lemberga16c4a72003-04-21 13:30:27 +0000116 Note that this file is a sub-Makefile used to specify Make variables
117 for compiler and linker invocation during the build. You can easily
118 create your own version from one of the existing configuration
119 files, then copy it to the current directory under the name
120 `./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
126 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
David Turner66cbc202003-03-20 07:04:40 +0000129 and linker during the build.
130
Werner Lemberga16c4a72003-04-21 13:30:27 +0000131 To launch the build, simply invoke GNU Make again: The top Makefile
132 will detect the configuration file and run the build with it.
David Turner66cbc202003-03-20 07:04:40 +0000133
134
Werner Lemberga16c4a72003-04-21 13:30:27 +0000135 Final note
David Turner66cbc202003-03-20 07:04:40 +0000136
Werner Lemberga16c4a72003-04-21 13:30:27 +0000137 The build system builds a statically linked library of the font
Werner Lemberga7235262005-08-30 00:22:46 +0000138 engine in the `objs' directory. It does _not_ support the build of
Werner Lemberga16c4a72003-04-21 13:30:27 +0000139 DLLs on Windows and OS/2. If you need these, you have to either use
Werner Lemberga7235262005-08-30 00:22:46 +0000140 an IDE-specific project file, or follow the instructions in
141 `INSTALL.ANY' to create your own Makefiles.
Werner Lemberga16c4a72003-04-21 13:30:27 +0000142
Werner Lemberg56c368c2005-06-04 23:00:25 +0000143------------------------------------------------------------------------
144
Werner Lemberga7235262005-08-30 00:22:46 +0000145Copyright 2003, 2004, 2005 by
Werner Lemberg56c368c2005-06-04 23:00:25 +0000146David Turner, Robert Wilhelm, and Werner Lemberg.
147
Werner Lemberga7235262005-08-30 00:22:46 +0000148This file is part of the FreeType project, and may only be used,
149modified, and distributed under the terms of the FreeType project
150license, LICENSE.TXT. By continuing to use, modify, or distribute this
151file you indicate that you have read the license and understand and
Werner Lemberg56c368c2005-06-04 23:00:25 +0000152accept it fully.
153
Werner Lemberga16c4a72003-04-21 13:30:27 +0000154
155--- end of INSTALL.GNU ---