blob: cd2208ec5a72ad70e49f23ac6af06c509217e68e [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 Lemberga16c4a72003-04-21 13:30:27 +000014 Because GNU Make is the only Make tool supported to compile
David Turner66cbc202003-03-20 07:04:40 +000015 FreeType 2, you should install it on your machine.
16
Werner Lemberga16c4a72003-04-21 13:30:27 +000017 The FreeType 2 build system relies on many features special to GNU
18 Make -- trying to build the library with any other Make tool will
David Turner66cbc202003-03-20 07:04:40 +000019 *fail*.
20
Werner Lemberga16c4a72003-04-21 13:30:27 +000021 NEARLY ALL OTHER MAKE TOOLS WILL FAIL, INCLUDING "BSD MAKE", SO
David Turner66cbc202003-03-20 07:04:40 +000022 REALLY INSTALL A RECENT VERSION OF GNU MAKE ON YOUR SYSTEM!
23
Werner Lemberga16c4a72003-04-21 13:30:27 +000024 Note that make++, a make tool written in Perl, supports enough
25 features of GNU make to compile FreeType. See
Werner Lemberg26eccb42004-04-13 08:35:05 +000026 http://makepp.sourceforge.net for more information; you need version
27 1.19 or newer, and you must pass option `--norc-substitution'.
Werner Lemberga16c4a72003-04-21 13:30:27 +000028
29 Make sure that you are invoking GNU Make from the command line, by
David Turner66cbc202003-03-20 07:04:40 +000030 typing something like:
31
Werner Lemberga16c4a72003-04-21 13:30:27 +000032 make -v
David Turner66cbc202003-03-20 07:04:40 +000033
34 to display its version number.
35
36 VERSION 3.78.1 OR NEWER IS NEEDED!
37
38
Werner Lemberga16c4a72003-04-21 13:30:27 +000039 2. Invoke 'make'
40 ----------------
David Turner66cbc202003-03-20 07:04:40 +000041
Werner Lemberga16c4a72003-04-21 13:30:27 +000042 Go to the root directory of FreeType 2, then simply invoke GNU Make
43 from the command line. This will launch the FreeType 2 host
44 platform detection routines. A summary will be displayed, for
David Turner66cbc202003-03-20 07:04:40 +000045 example, on Win32:
46
47
Werner Lemberga16c4a72003-04-21 13:30:27 +000048 ==============================================================
49 FreeType build system -- automatic system detection
David Turner66cbc202003-03-20 07:04:40 +000050
Werner Lemberga16c4a72003-04-21 13:30:27 +000051 The following settings are used:
David Turner66cbc202003-03-20 07:04:40 +000052
Werner Lemberga16c4a72003-04-21 13:30:27 +000053 platform win32
54 compiler gcc
55 configuration directory ./builds/win32
56 configuration rules ./builds/win32/w32-gcc.mk
David Turner66cbc202003-03-20 07:04:40 +000057
Werner Lemberga16c4a72003-04-21 13:30:27 +000058 If this does not correspond to your system or settings please
59 remove the file 'config.mk' from this directory then read the
60 INSTALL file for help.
David Turner66cbc202003-03-20 07:04:40 +000061
Werner Lemberga16c4a72003-04-21 13:30:27 +000062 Otherwise, simply type 'make' again to build the library.
63 =============================================================
David Turner66cbc202003-03-20 07:04:40 +000064
65
Werner Lemberga16c4a72003-04-21 13:30:27 +000066 If the detected settings correspond to your platform and compiler,
67 skip to step 5. Note that if your platform is completely alien to
David Turner66cbc202003-03-20 07:04:40 +000068 the build system, the detected platform will be 'ansi'.
69
70
Werner Lemberga16c4a72003-04-21 13:30:27 +000071 3. Configure the build system for a different compiler
72 ------------------------------------------------------
David Turner66cbc202003-03-20 07:04:40 +000073
Werner Lemberga16c4a72003-04-21 13:30:27 +000074 If the build system correctly detected your platform, but you want
75 to use a different compiler than the one specified in the summary
76 (for most platforms, gcc is the defaut compiler), invoke GNU Make
David Turner66cbc202003-03-20 07:04:40 +000077 with
78
Werner Lemberga16c4a72003-04-21 13:30:27 +000079 make setup <compiler>
David Turner66cbc202003-03-20 07:04:40 +000080
Werner Lemberga16c4a72003-04-21 13:30:27 +000081 Examples:
David Turner66cbc202003-03-20 07:04:40 +000082
Werner Lemberga16c4a72003-04-21 13:30:27 +000083 to use Visual C++ on Win32, type: "make setup visualc"
84 to use Borland C++ on Win32, type "make setup bcc32"
85 to use Watcom C++ on Win32, type "make setup watcom"
86 to use Intel C++ on Win32, type "make setup intelc"
87 to use LCC-Win32 on Win32, type: "make setup lcc"
88 to use Watcom C++ on OS/2, type "make setup watcom"
89 to use VisualAge C++ on OS/2, type "make setup visualage"
David Turner66cbc202003-03-20 07:04:40 +000090
Werner Lemberga16c4a72003-04-21 13:30:27 +000091 The <compiler> name to use is platform-dependent. The list of
92 available compilers for your system is available in the file
David Turner66cbc202003-03-20 07:04:40 +000093 `builds/<system>/detect.mk'
94
Werner Lemberga16c4a72003-04-21 13:30:27 +000095 If you are satisfied by the new configuration summary, skip to
96 step 5.
David Turner66cbc202003-03-20 07:04:40 +000097
David Turner66cbc202003-03-20 07:04:40 +000098
Werner Lemberga16c4a72003-04-21 13:30:27 +000099 4. Configure the build system for an unknown platform/compiler
100 --------------------------------------------------------------
David Turner66cbc202003-03-20 07:04:40 +0000101
Werner Lemberga16c4a72003-04-21 13:30:27 +0000102 The auto-detection/setup phase of the build system copies a file to
103 the current directory under the name `config.mk'.
104
105 For example, on OS/2+gcc, it would simply copy
David Turner66cbc202003-03-20 07:04:40 +0000106 `builds/os2/os2-gcc.mk' to `./config.mk'.
107
Werner Lemberga16c4a72003-04-21 13:30:27 +0000108 If for some reason your platform isn't correctly detected, copy
109 manually the configuration sub-makefile to `./config.mk' and go to
110 step 5.
David Turner66cbc202003-03-20 07:04:40 +0000111
Werner Lemberga16c4a72003-04-21 13:30:27 +0000112 Note that this file is a sub-Makefile used to specify Make variables
113 for compiler and linker invocation during the build. You can easily
114 create your own version from one of the existing configuration
115 files, then copy it to the current directory under the name
116 `./config.mk'.
David Turner66cbc202003-03-20 07:04:40 +0000117
David Turner66cbc202003-03-20 07:04:40 +0000118
Werner Lemberga16c4a72003-04-21 13:30:27 +0000119 5. Build the library
120 --------------------
121
122 The auto-detection/setup phase should have copied a file in the
123 current directory, called `./config.mk'. This file contains
124 definitions of various Make variables used to invoke the compiler
David Turner66cbc202003-03-20 07:04:40 +0000125 and linker during the build.
126
Werner Lemberga16c4a72003-04-21 13:30:27 +0000127 To launch the build, simply invoke GNU Make again: The top Makefile
128 will detect the configuration file and run the build with it.
David Turner66cbc202003-03-20 07:04:40 +0000129
130
Werner Lemberga16c4a72003-04-21 13:30:27 +0000131 Final note
David Turner66cbc202003-03-20 07:04:40 +0000132
Werner Lemberga16c4a72003-04-21 13:30:27 +0000133 The build system builds a statically linked library of the font
134 engine in the "objs" directory. It does _not_ support the build of
135 DLLs on Windows and OS/2. If you need these, you have to either use
136 a IDE-specific project file, or follow the instructions in
David Turner66cbc202003-03-20 07:04:40 +0000137 "INSTALL.ANY" to create your own Makefiles.
Werner Lemberga16c4a72003-04-21 13:30:27 +0000138
Werner Lemberg56c368c2005-06-04 23:00:25 +0000139------------------------------------------------------------------------
140
141Copyright 2003, 2004 by
142David Turner, Robert Wilhelm, and Werner Lemberg.
143
144This file is part of the FreeType project, and may only be used,
145modified, and distributed under the terms of the FreeType project
146license, LICENSE.TXT. By continuing to use, modify, or distribute this
147file you indicate that you have read the license and understand and
148accept it fully.
149
Werner Lemberga16c4a72003-04-21 13:30:27 +0000150
151--- end of INSTALL.GNU ---