~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/extras/FreeType/howto/msdos.txt

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
               The FreeType MS-DOS Compilation HowTo
 
2
 
 
3
Contents
 
4
 
 
5
Introduction
 
6
I.   Building the library
 
7
  1. Quick Compilation
 
8
  2. Manual compilation
 
9
  3. Notes
 
10
II.  Building other parts of the package
 
11
  1. Test programs
 
12
  2. Other contribs
 
13
III. Special issues of 16-bit MS-DOS
 
14
 
 
15
 
 
16
 
 
17
Introduction
 
18
============
 
19
 
 
20
This file  describes the  compilation of the  FreeType package  on a
 
21
MS-DOS system.  It comes with Makefiles for the following compilers:
 
22
 
 
23
  - gcc/emx and gcc/djgpp with GNU make (32 bit)
 
24
 
 
25
  - wcc386 with wmake (Watcom -- tried with 10.6)
 
26
 
 
27
  - gcc/emx with dmake (32 bit)
 
28
 
 
29
  - cl with nmake (16-bit Microsoft C -- tried with 7 and VC++ 1.5x)
 
30
 
 
31
  - bcc/tcc with make (16-bit Borland C++ and Turbo C)
 
32
 
 
33
NOTE:
 
34
 
 
35
  You are  advised to jump  to section II.1  if you want to  run the
 
36
  FreeType test/demo programs as quick as possible.
 
37
 
 
38
 
 
39
 
 
40
I. Building the library
 
41
=======================
 
42
 
 
43
 
 
44
1. Quick Compilation
 
45
--------------------
 
46
 
 
47
  The easiest way  to compile the library on MS-DOS is  to go to the
 
48
  directory `freetype/lib'.  Then type, depending on your compiler:
 
49
 
 
50
    gcc/emx,
 
51
    gcc/djgpp:   make  -f arch/msdos/Makefile.gcc
 
52
    gcc/dmake:   dmake -r -f arch/msdos/Makefile.dm
 
53
 
 
54
    wcc386:      wmake -f=arch\msdos\Makefile.wat
 
55
 
 
56
    cl:          nmake /f arch\msdos\Makefile.MS  (for version 7)
 
57
    cl:          nmake /f arch\msdos\Makefile.VC  (for Visual C++ 1.x)
 
58
 
 
59
    tcc:         make  -farch/msdos/Makefile.TC
 
60
    bcc:         make  -farch/msdos/Makefile.BC
 
61
 
 
62
  This should build the `libttf.a' or `libttf.lib' library files.
 
63
 
 
64
  You can also use the following targets:
 
65
 
 
66
    clean     - Cleans all intermediate  object files created during
 
67
                compilation.  Keeps  all library and  executables in
 
68
                place.
 
69
 
 
70
    distclean - Cleans everything,  leaving the directories  as they
 
71
                were before the compilation.
 
72
 
 
73
    debug     - Makes  a development version  of the  library.  Only
 
74
                useful for FreeType developers and hackers.
 
75
 
 
76
    Note that you  can also select to use  the `debugging' flags for
 
77
    your compiler  (instead of  the `optimizing' ones),  by defining
 
78
    the `DEBUG' symbol, like in
 
79
 
 
80
      nmake /f arch\msdos\Makefile.MS DEBUG=1
 
81
      make -farch/msdos/Makefile.BC /DDEBUG
 
82
      etc.
 
83
 
 
84
    Doing so  will automatically select the debug  target instead of
 
85
    the normal mode.
 
86
 
 
87
    For 16-bit compilers, you  can also try defining  the `BIGFONTS'
 
88
    symbol, to  enable  the  use of  the `huge  pointers'  needed to
 
89
    handle some big fonts.  More on this at the end of this file.
 
90
 
 
91
 
 
92
2. Manual compilation
 
93
---------------------
 
94
 
 
95
  Here  are explained  the steps  that are  required to  compile the
 
96
  FreeType _library_ (and only this one) by hand.
 
97
 
 
98
  Unlike previous  versions, FreeType 1.1 and above  can be compiled
 
99
  in two modes, called `debug mode' and `single object mode'.
 
100
 
 
101
  Debug mode is simply the normal way of compiling C programs, i.e.,
 
102
  each  `*.c' file  is compiled  into an  individual  `*.obj' object
 
103
  file, and all  of them are linked together  into an archive (i.e.,
 
104
  `*.lib' library).
 
105
 
 
106
  Single object mode is slightly different: All C files are included
 
107
  in a single source during compilation, resulting in a single final
 
108
  object  file for  the core  library.   This has  the advantage  of
 
109
  letting  optimizing compilers  do  more global  work,  as well  as
 
110
  getting rid of all external  which are used solely for the purpose
 
111
  of components interfacing.
 
112
 
 
113
  In both  modes, you  need to include  the following paths  to your
 
114
  makefile/command line:
 
115
 
 
116
    the location of all `tt*.[hc]' files
 
117
    the location of system-specific files
 
118
 
 
119
  For  example,  if  you   are  compiling  from  the  `freetype/lib'
 
120
  directory, you can type for debug mode something like
 
121
 
 
122
    gcc -c -I. -Iarch/msdos tt*.c
 
123
 
 
124
  to  compile all required  files into  object ones.   Then assemble
 
125
  them in a library with `ar', `lib', or `tlib'.
 
126
 
 
127
  In single  object mode,  you only need  to compile the  file named
 
128
  `freetype.c' which is  located in `freetype/lib/arch/msdos'.  From
 
129
  the same directory as before, one would type
 
130
 
 
131
    gcc -c -I. -Iarch/msdos arch/msdos/freetype.c
 
132
 
 
133
  You    can    also    compile    the   extensions    located    in
 
134
  `freetype/lib/extend' separately  from the base  engine.  You will
 
135
  need to include  the same paths as before, though;  be sure to add
 
136
  the path to the `extend' directory, like in
 
137
 
 
138
    gcc -c -I. -Iarch/msdos -Iextend extend/*.c
 
139
 
 
140
 
 
141
3. Notes
 
142
--------
 
143
 
 
144
  `char' is always `signed char' in the sources!
 
145
 
 
146
  `ttconfig.h'  relies heavily  on  a file  called `ft_conf.h'  that
 
147
  contains information  related to  the target platform,  located in
 
148
  the  `freetype/lib/arch/msdos/'   directory.   Depending  on  your
 
149
  compiler, you may need to slightly edit it.
 
150
 
 
151
  We use  gcc as  our reference compiler  for warnings.   This means
 
152
  that we use  the `-ansi -pedantic -Wall' flags and  try to get rid
 
153
  of warnings  in this situation.  If you're  compiling with another
 
154
  compiler, you  may encounter warnings, not errors.   Note that the
 
155
  Borland  compilers seem  to  produce lots  of irrelevant  warnings
 
156
  (like `potential loss of precision').
 
157
 
 
158
 
 
159
 
 
160
II. Building other parts of the package
 
161
=======================================
 
162
 
 
163
 
 
164
1. Test programs
 
165
----------------
 
166
 
 
167
  These are  located in  `freetype/test'.  Most of  them use  a tiny
 
168
  graphics sub-system  which is simply  used to display  bitmaps and
 
169
  pixmaps on a  variety of platforms.  The MS-DOS  version is a very
 
170
  basic one that only works in full-screen using standard VGA mode.
 
171
 
 
172
  To compile them, you must  be in the `freetype/test' directory and
 
173
  invoke the makefile in arch/msdos.  For example:
 
174
 
 
175
    nmake /f arch\msdos\Makefile.VC
 
176
 
 
177
 
 
178
  NOTE 1:
 
179
 
 
180
    This will automatically invoke the library makefile for you!
 
181
 
 
182
  NOTE 2:
 
183
 
 
184
    For now, the  graphical test programs only run  on the following
 
185
    platforms: Unix, OS/2, Dos, Amiga, and Windows.
 
186
 
 
187
    The library,  being pure  ANSI-C, can be  used on any  system to
 
188
    generate bitmaps and pixmaps.
 
189
 
 
190
 
 
191
2. Other contribs
 
192
-----------------
 
193
 
 
194
  You may find  some other contributions to the  FreeType project in
 
195
  the `freetype/contrib'  directory.  Each of  these programs should
 
196
  have  its  own Makefiles  and  documentations.   Also check  their
 
197
  licenses, as  the programs  are not necessarily  distributed under
 
198
  the FreeType one.
 
199
 
 
200
  Most of these contributions are targeted to Unix.  You are invited
 
201
  to port them to MS-DOS, and then contribute your improvements.
 
202
 
 
203
 
 
204
 
 
205
III. Special issues of 16-bit MS-DOS
 
206
====================================
 
207
 
 
208
  As usual, 16-bit MS-DOS have some limitations.
 
209
 
 
210
  First, and mainly, only the  large model is usable.  The small and
 
211
  medium models are  not usable, because the library  uses more than
 
212
  64kByte of data; and the  compact model is unusable as well, since
 
213
  the code of the library itself is slightly less than 64kByte, thus
 
214
  leaving very  small place  for the real  work.  The net  effect of
 
215
  that limitation  is that performances are not  very impressive, to
 
216
  say the  least (32-bit  DOS extenders  perform usually  three-time
 
217
  faster).
 
218
 
 
219
  Even  with the  large model,  the rasterizer  is still  limited in
 
220
  size, particularly with pixmaps  (that is, with anti-aliasing gray
 
221
  levels).
 
222
 
 
223
  Another annoying limitation exists with some East Asian fonts that
 
224
  have  16,383  glyphs  or   more,  since  an  internal  table  then
 
225
  overflows.  We  tried to overcome  this using the  so-called `huge
 
226
  pointers', but then good support for these in the run-time library
 
227
  is needed.  To enable  this support,  try defining  the `BIGFONTS'
 
228
  symbol with the makefile, like using
 
229
 
 
230
    nmake /f arch\msdos\makefile.MS BIGFONTS=1
 
231
    make -farch/msdos/makefile.BC /DBIGFONTS
 
232
    etc.
 
233
 
 
234
  The Makefiles for both Microsoft and Borland compilers depend on a
 
235
  special file,  `arch/msdos/depend.dos', which  is built by  a Unix
 
236
  script  named  `makedep'.  You  may  consider  editing  it if  you
 
237
  heavily modify the source files; or better yet, re-run the script,
 
238
  using any  clone of  the Bourne shell  and gcc, the  GNU compiler,
 
239
  with
 
240
 
 
241
    arch/msdos/makedep
 
242
 
 
243
  in both the `lib' and the `test' directories.
 
244
 
 
245
 
 
246
 
 
247
Good luck!
 
248
 
 
249
 
 
250
--- end of msdos.txt ---