1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
The FreeType Unix Compilation HOWTO
Contents
Introduction
I. Building the library
1. Quick Compilation
2. Manual compilation
3. Notes
II. Building other parts of the package
1. Test programs
2. Other contribs
III. Successful Build Reports
Introduction
============
This file describes the compilation of the FreeType package on a
Unix system. Using the `configure' script it should be rather easy
to build the library. However, detailed instructions on how to
compile the library manually are given later in this document.
I. Building the library
=======================
1. Quick Compilation
--------------------
The easiest way to compile the library on a Unix system is by
using the `configure' script that comes with it. Simply go to the
root directory of the FreeType package, then type
./configure
to run a script that will probe your system and detect various
configuration issues, which are explained later in this document.
From there, you can simply type
make
to invoke compilation of the whole package. You can also use the
following commands:
make debug - Make a development version of the library.
Only useful for FreeType developers and
hackers. The default build should come with
`-g' (i.e., debug info in the object file)
already.
make clean - Clean all intermediate object files created
during compilation. Keeps all library and
executables in place.
make distclean - Clean everything, leaving the directories as
they were before the compilation. You'll need
to run `./configure' again to be able to
re-build it.
make install - Install the library files libttf.a, libttf.la
or libttf.so to your system library path
(`/usr/local/lib' by default). The path can be
set manually with ./configure.
make uninstall - Undo a `make install'.
Note that the Makefile uses nested variables which causes problems
with BSD make. Use GNU make instead.
2. Trouble-shooting and simple customization
--------------------------------------------
The make build seems to fail on some Solaris systems. This is
mainly due to the fact that the test programs (not the font
library itself) try to use certain libraries and/or utilities if
they find them on your system. In some cases, the Sun versions
are incompatible to the GNU ones. If you encounter such problems,
please report them to us so we can try to fix it.
The configure script and makefiles that it generates can/make use
of the following things:
- gettext - In order to compile the internationalized error
message string extension, which isn't part of the
core library. You can disable this and get a
clean compile with
./configure --disable-nls
- libtool - Used to generate shared libraries. You can
disable it by typing
./configure --disable-shared
which will generate and link the FreeType engine
as a static library.
By default, static compilation is disabled if the
configure script detects that your compiler
and/or operating system supports shared
libraries. You can ask for static libraries with
./configure --enable-static
For more configuration options, type `./configure --help' to see a
summary of what is possible. The option to change the library
installation path for `make install' is, as usual,
`--prefix=<path>'. Example:
./configure --prefix=${HOME}/local/lib --disable-shared
to install a static library (libttf.a) in `~/local/lib' (after a
`make install')
3. Manual compilation
---------------------
Here are explained the steps that are required to compile the
FreeType _library_ (and only this one) by hand.
a. Generate a configuration file named `ft_conf.h'
This file contains a certain number of configuration macro
declarations which must fit your system. The configure script
generates it automatically for you, but you can also take the
template file `freetype/ft_conf.h.in' and change it by hand,
then save it as `freetype/ft_conf.h'.
b. Choose your compilation mode
Unlike previous versions, FreeType 1.1 and above can be compiled
in two modes, called `debug mode' and `single object mode'.
Debug mode is simply the normal way of compiling C programs,
i.e., each *.c file is compiled into an individual *.o object
file, and all of them are linked together into an archive (i.e.,
a *.a library).
Single object mode is slightly different: All C files are
included in a single source file during compilation, resulting
in a single final object file for the core library. This has
the advantage of letting optimizing compilers do more global
work, as well as getting rid of all external symbols which are
used solely for the purpose of components interfacing.
In both modes, you need to include the following paths to your
makefile/command line:
. the location of the `ft_conf.h' file
. the location of all `tt*.[hc]' files
. the location of system-specific files, i.e., `ttmmap.c' on
Unix.
For example, if you are compiling from the `freetype/lib'
directory, you can type for debug mode something like
gcc -c -I.. -I. -Iarch/unix tt*.c arch/unix/ttmmap.c
to compile all required files. Then assemble them in a library
with `ar' (and run `runlib' if necessary).
In single object mode, you only need to compile the file named
`freetype.c' which is located in `freetype/lib/arch/unix'. From
the same directory as before, one would type:
gcc -c -I.. -I. -Iarch/unix arch/unix/freetype.c
You can also compile the extensions located in
`freetype/lib/extend' separately from the base engine. You'll
need to include the same paths as before, though.
II. Building other parts of the package
=======================================
1. Test programs
----------------
All test programs are located in `freetype/test'. Most of them
use a tiny graphics sub-system which simply display bitmaps and
pixmaps in a windows on a variety of platforms. Of course, the
Unix version uses X11.
The default `make' builds all tests programs automatically. Just
go the `freetype/test' and launch the programs when you are there.
Documentation on the test programs can be found in the file
`freetype/README'.
NOTE:
For now, the graphical test programs only run on the following
platforms: Unix, OS/2, Dos, Amiga, and Windows.
The library, being pure ANSI-C, can be used on any system to
generate bitmaps and pixmaps.
2. Other contributions
----------------------
You may find some other contributions to the FreeType project in
the `freetype/contrib' directory. Each of these programs should
have their own makefiles and documentations. Also check their
licenses, as they are not necessarily distributed under the
FreeType one.
III. Successful Build Reports
=============================
Nelson H. F. Beebe <beebe@math.utah.edu> and others report the
following successfully builds (with gcc 2.8.1) of freetype-1.1 on
DEC Alpha 2100-5/250: OSF/1 3.2
HP 9000/735: HP-UX 10.01
Intel Pentium (200MHz MMX): Linux 2.0.30
SGI Challenge L: IRIX 5.3
Sun SPARC 20/512: Solaris 2.6
Sun SPARC Ultra-2: SunOS 5.5.1
IBM RS/6000: AIX 4.1
Chances are good the the current release will build on the same
machines and platforms.
There are build problems reported on SunOs 4.x which have the form
ld: /usr/tmp/cca07291.o: assert pure-text failed:
reference to [offset] at f754 in /usr/tmp/cca07291.o
This may be a compiler bug in gcc 2.8.1.
You can work around by just building a static library with
./configure --disable-shared --enable-static --disable-nls
Maybe `make debug' will help here too (untested).
Other successful builds:
Sun SPARC Solaris 2.5 with Sun C compiler+linker
For updated build reports, please consult our web site:
http://www.freetype.org
--- end of unix.txt ---
|