Commit b1aabf4c5ea25bdd1a41705c6c5ac98b2df9b056

David Turner 2000-11-30T23:48:22

- added support for the free command-line Borland C++ compiler in the "builds" directory - modified a few files because BCC32 didn't like certain comparisons (UInt compared with a UShort, apparently the UShort is promoted to an Int) - updated the INSTALL file to include IDE compilation, prevent against BSD Make, and clarify the use of "make setup" (instead of "make") for build configuration

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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
diff --git a/ChangeLog b/ChangeLog
index c96e9f4..90ab3ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2000-11-30  David Turner  <david.turner@freetype.ogr>
 
+	* INSTALL: slightly updated the quick starter documentation to
+	include IDE compilation, prevent agains BSD Make, and specify
+	"make setup" instead of a single "make" for build configuration.
+
 	* include/config/ftbuild.h, include/internal/internal.h: added
 	a new configuration file used to determine where are all public,
 	configuration and internal header files for FreeType 2. I also
@@ -7,9 +11,18 @@
 	change. Note that we still need to change the library source 
 	files themselves though..
 
-	* include/freetype.h: modified all public, configuration and
-	internal header files to use the new
-	
+	* builds/compiler/bcc.mk, builds/compiler/bcc-dev.mk,
+	builds/win32/w32-bcc.mk, builds/win32/w32-bccd.mk,
+	builds/win32/detect.mk: added new files to support compilation with
+	the free Borland C++ command-line compiler. Modified the detection
+	rules to recognize the new "bcc32" target in "make setup bcc32"
+
+	* src/sfnt/ttcmap.c, src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
+	src/truetype/ttobjs.c, src/truetype/ttgload.c, src/truetype/ttinterp.c:
+	fixed a few comparisons that Borland C++ didn't really like. Basically,
+	this compiler complains when a FT_UInt is compared to a FT_UShort
+	(apparently, it promotes the UShort to an Int in these cases)
+
 2000-11-30  Tom Kacvinsky  <tjk@ams.org>
 
 	* t2objs.c (T2_Init_Face): Added calculation of `face->height' for
diff --git a/INSTALL b/INSTALL
index 151ae8e..c9492ea 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,33 +1,90 @@
 In order to build the library, read the `BUILD' document in the `docs'
-directory.  Quick starter: Go to `freetype2', then:
+directory. This is only a quick starter:
 
-  Unix + GNU Make:
+I. From the command line:
 
-     - make  (don't worry, this will invoke a configure script)
+  You need to have GNU Make installed on your system to compile the
+  library from the command line. This will _not_ work with other
+  Make tools (including the BSD ones !!)
+  
+  - Go to the 'freetype2' directory
+
+  - on Unix (any C compiler should work):
+
+     - make setup (don't worry, this will invoke a configure script)
      - make
      - make install
 
     alternatively, you can pass parameters to the configure script
     with the CFG variable, as in:
 
-     - make CFG="--prefix=/usr"
+     - make setup CFG="--prefix=/usr"
      - make
      - make install
 
+  - On Windows:
 
-  Windows + gcc + GNU Make:
+    we provide a version of GNU Make for Win32 on the FreeType site.
+    See http://www.freetype.org/download.html for details..
 
-     - make
-     - make
+    o if you're using gcc:
 
-  Windows + Visual C++ + GNU Make:
+       - make setup
+       - make
 
-     - make setup visualc
-     - make
+    o if you're using Visual C++:
+    
+       - make setup visualc
+       - make
+       
+    o if you're using Win32-lCC:
+    
+       - make setup lcc
+       - make
+       
+    o if you're using the Borland C++ Builder compiler:
+    
+       - make setup bcc32
+       - make
 
-  Windows + Win32-LCC + GNU Make:
 
-     - make setup lcc
-     - make
+II. In your own environment (IDE):
+
+  you need to add the directories "freetype2/include" and "freetype2/src"
+  to your include path when compiling the library.
+  
+  compile each library component through the following files:
+  
+     -- base components (required)
+     
+     src/base/ftsystem.c
+     src/base/ftinit.c
+     src/base/ftdebug.c
+     src/base/ftbase.c
+     src/base/ftglyph.c
+     src/base/ftbbox.c
+     src/base/ftmm.c
+     
+     src/base/ftmac.c   -- only on the Macintosh
+
+     -- other components are optional
+
+     src/autohint/autohint.c   -- auto hinting module
+     src/cache/ftcache.c       -- cache sub-system (in beta)
+     src/sfnt/sfnt.c           -- SFNT files support (TrueType & OpenType)
+     src/cff/cff.c             -- CFF/OpenType font driver
+     src/psnames/psnames.c     -- Postscript glyph names support
+     src/psaux/psaux.c         -- Postscript Type 1 parsing
+     src/truetype/truetype.c   -- TrueType font driver
+     src/type1/type1.c         -- Type 1 font driver
+     src/cid/type1cid.c        -- Type 1 CID-keyed font driver
+     src/winfonts/winfonts.c   -- Windows FONT / FNT font driver
+
+     note that:
+     
+         'truetype.c' needs  'sfnt.c' and 'psnames.c'
+	 'type1.c'    needs  'psaux.c' and 'psnames.c'
+	 'type1cid.c' needs  'psaux.c' and 'psnames.c'
+	 'cff.c'      needs  'sfnt.c', 'psaux.c' and 'psnames.c'
 
   etc.
diff --git a/builds/compiler/bcc-dev.mk b/builds/compiler/bcc-dev.mk
new file mode 100644
index 0000000..52b188c
--- /dev/null
+++ b/builds/compiler/bcc-dev.mk
@@ -0,0 +1,69 @@
+# Copyright 2000 David Turner
+#
+#  Borland C++-specific with NO OPTIMISATIONS + DEBUGGING
+#
+
+# Compiler command line name
+CC := bcc32
+
+# The object file extension (for standard and static libraries).  This can be
+# .o, .tco, .obj, etc., depending on the platform.
+#
+O  := obj
+SO := obj
+
+# The library file extension (for standard and static libraries).  This can
+# be .a, .lib, etc., depending on the platform.
+#
+A  := lib
+SA := lib
+
+
+# Path inclusion flag.  Some compilers use a different flag than `-I' to
+# specify an additional include path.  Examples are `/i=' or `-J'.
+#
+I := -I
+
+
+# C flag used to define a macro before the compilation of a given source
+# object.  Usually is `-D' like in `-DDEBUG'.
+#
+D := -D
+
+
+# The link flag used to specify a given library file on link.  Note that
+# this is only used to compile the demo programs, not the library itself.
+#
+L :=
+
+
+# Target flag. - no trailing space
+#
+T := -o
+
+
+# C flags
+#
+#   These should concern: debug output, optimization & warnings.
+#
+#   Use the ANSIFLAGS variable to define the compiler flags used to enfore
+#   ANSI compliance.
+#
+ifndef CFLAGS
+  CFLAGS := -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
+endif
+
+# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
+#
+ANSIFLAGS := -A
+
+
+# Library linking
+#
+ifndef CLEAN_LIBRARY
+CLEAN_LIBRARY = $(DELETE) $(subst $(SEP),$(HOSTSEP),$(PROJECT_LIBRARY)) $(NO_OUTPUT)
+endif
+TARGET_OBJECTS = $(subst $(SEP),\\,$(OBJECTS_LIST))
+LINK_LIBRARY  = tlib /u $(subst $(SEP),\\,$@) $(TARGET_OBJECTS:%=+%)
+
+# EOF
diff --git a/builds/compiler/bcc.mk b/builds/compiler/bcc.mk
new file mode 100644
index 0000000..2d70ffe
--- /dev/null
+++ b/builds/compiler/bcc.mk
@@ -0,0 +1,69 @@
+# Copyright 2000 David Turner
+#
+#  Borland C++-specific rules
+#
+
+# Compiler command line name
+CC := bcc32
+
+# The object file extension (for standard and static libraries).  This can be
+# .o, .tco, .obj, etc., depending on the platform.
+#
+O  := obj
+SO := obj
+
+# The library file extension (for standard and static libraries).  This can
+# be .a, .lib, etc., depending on the platform.
+#
+A  := lib
+SA := lib
+
+
+# Path inclusion flag.  Some compilers use a different flag than `-I' to
+# specify an additional include path.  Examples are `/i=' or `-J'.
+#
+I := -I
+
+
+# C flag used to define a macro before the compilation of a given source
+# object.  Usually is `-D' like in `-DDEBUG'.
+#
+D := -D
+
+
+# The link flag used to specify a given library file on link.  Note that
+# this is only used to compile the demo programs, not the library itself.
+#
+L :=
+
+
+# Target flag. - no trailing space
+#
+T := -o
+
+
+# C flags
+#
+#   These should concern: debug output, optimization & warnings.
+#
+#   Use the ANSIFLAGS variable to define the compiler flags used to enfore
+#   ANSI compliance.
+#
+ifndef CFLAGS
+  CFLAGS := -c -q -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
+endif
+
+# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
+#
+ANSIFLAGS := -A
+
+
+# Library linking
+#
+ifndef CLEAN_LIBRARY
+CLEAN_LIBRARY = $(DELETE) $(subst $(SEP),$(HOSTSEP),$(PROJECT_LIBRARY)) $(NO_OUTPUT)
+endif
+TARGET_OBJECTS = $(subst $(SEP),\\,$(OBJECTS_LIST))
+LINK_LIBRARY  = tlib /u $(subst $(SEP),\\,$@) $(TARGET_OBJECTS:%=+%)
+
+# EOF
diff --git a/builds/win32/detect.mk b/builds/win32/detect.mk
index 665a441..be6d3d9 100644
--- a/builds/win32/detect.mk
+++ b/builds/win32/detect.mk
@@ -89,6 +89,13 @@ ifeq ($(PLATFORM),ansi)
       mingw32: setup
     endif
 
+    ifneq ($(findstring bcc32,$(MAKECMDGOALS)),)         # Borland C++
+      CONFIG_FILE := w32-bcc.mk
+      SEP         := $(BACKSLASH)
+      CC          := bcc32
+      bcc32: setup
+    endif
+
     ifneq ($(findstring devel,$(MAKECMDGOALS)),)       # development target
       CONFIG_FILE := w32-dev.mk
       CC          := gcc
diff --git a/builds/win32/w32-bcc.mk b/builds/win32/w32-bcc.mk
new file mode 100644
index 0000000..76991a4
--- /dev/null
+++ b/builds/win32/w32-bcc.mk
@@ -0,0 +1,12 @@
+#
+#  Borland C++ on Win32
+#
+
+SEP := /
+include $(TOP)/builds/win32/win32-def.mk
+include $(TOP)/builds/compiler/bcc.mk
+
+# include linking instructions
+include $(TOP)/builds/link_dos.mk
+
+# EOF
diff --git a/builds/win32/w32-bccd.mk b/builds/win32/w32-bccd.mk
new file mode 100644
index 0000000..4c30716
--- /dev/null
+++ b/builds/win32/w32-bccd.mk
@@ -0,0 +1,12 @@
+#
+#  Borland C++ on Win32 + debugging
+#
+
+SEP := /
+include $(TOP)/builds/win32/win32-def.mk
+include $(TOP)/builds/compiler/bcc-dev.mk
+
+# include linking instructions
+include $(TOP)/builds/link_dos.mk
+
+# EOF
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index 1aa53e1..b62ec2c 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -417,10 +417,10 @@
         sh2      = cmap2->subHeaders + index1;
         char_lo -= sh2->firstCode;
 
-        if ( char_lo < sh2->entryCount )
+        if ( char_lo < (FT_UInt)sh2->entryCount )
         {
           offset = sh2->idRangeOffset / 2 + char_lo;
-          if ( offset < cmap2->numGlyphId )
+          if ( offset < (FT_UInt)cmap2->numGlyphId )
           {
             result = cmap2->glyphIdArray[offset];
             if ( result )
@@ -484,10 +484,10 @@
       /* the ranges are sorted in increasing order.  If we are out of */
       /* the range here, the char code isn't in the charmap, so exit. */
 
-      if ( charCode > seg4->endCount )
+      if ( charCode > (FT_UInt)seg4->endCount )
         continue;
 
-      if ( charCode >= seg4->startCount )
+      if ( charCode >= (FT_UInt)seg4->startCount )
         goto Found;
     }
     return 0;
@@ -508,7 +508,7 @@
                + ( seg4 - cmap4->segments )
                - segCount;
 
-      if ( index1 < cmap4->numGlyphId       &&
+      if ( index1 < (FT_UInt)cmap4->numGlyphId       &&
            cmap4->glyphIdArray[index1] != 0 )
         result = ( cmap4->glyphIdArray[index1] + seg4->idDelta ) & 0xFFFF;
     }
@@ -544,7 +544,7 @@
     result    = 0;
     charCode -= cmap6->firstCode;
 
-    if ( charCode < cmap6->entryCount )
+    if ( charCode < (FT_UInt)cmap6->entryCount )
       result =  cmap6->glyphIdArray[charCode];
 
     return result;
diff --git a/src/sfnt/ttpost.c b/src/sfnt/ttpost.c
index 2431569..6fe7e2b 100644
--- a/src/sfnt/ttpost.c
+++ b/src/sfnt/ttpost.c
@@ -500,7 +500,7 @@
             break;
         }
 
-        if ( index < table->num_glyphs )
+        if ( index < (FT_UInt)table->num_glyphs )
         {
           FT_UShort  name_index = table->glyph_indices[index];
 
@@ -525,7 +525,7 @@
             break;
         }
 
-        if ( index < table->num_glyphs )    /* paranoid checking */
+        if ( index < (FT_UInt)table->num_glyphs )    /* paranoid checking */
         {
           index  += table->offsets[index];
           *PSname = MAC_NAME( index );
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index 505e44e..a31f6ed 100644
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -689,8 +689,8 @@
 
     /* check whether the glyph index is within this strike's */
     /* glyph range                                           */
-    if ( glyph_index < strike->start_glyph ||
-         glyph_index > strike->end_glyph   )
+    if ( glyph_index < (FT_UInt)strike->start_glyph ||
+         glyph_index > (FT_UInt)strike->end_glyph   )
       goto Fail;
 
     /* scan all ranges in strike */
@@ -701,8 +701,8 @@
 
     for ( ; range < range_limit; range++ )
     {
-      if ( glyph_index >= range->first_glyph &&
-           glyph_index <= range->last_glyph  )
+      if ( glyph_index >= (FT_UInt)range->first_glyph &&
+           glyph_index <= (FT_UInt)range->last_glyph  )
       {
         FT_UShort  delta = glyph_index - range->first_glyph;
 
@@ -727,7 +727,7 @@
 
             for ( n = 0; n < range->num_glyphs; n++ )
             {
-              if ( range->glyph_codes[n] == glyph_index )
+              if ( (FT_UInt)range->glyph_codes[n] == glyph_index )
               {
                 if ( range->index_format == 4 )
                   *aglyph_offset = range->glyph_offsets[n];
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index b414e2b..9bb313f 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -97,7 +97,7 @@
     FT_UShort        k = header->number_Of_HMetrics;
 
 
-    if ( index < k )
+    if ( index < (FT_UInt)k )
     {
       longs_m  = (TT_LongMetrics*)header->long_metrics + index;
       *bearing = longs_m->bearing;
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 1e9a399..e9dd074 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -6430,7 +6430,7 @@
 
     for ( ; def < limit; def++ )
     {
-      if ( def->opc == CUR.opcode && def->active )
+      if ( (FT_Byte)def->opc == CUR.opcode && def->active )
       {
         TT_CallRec*  call;
 
@@ -7414,7 +7414,7 @@
 
             for ( ; def < limit; def++ )
             {
-              if ( def->active && CUR.opcode == def->opc )
+              if ( def->active && CUR.opcode == (FT_Byte)def->opc )
               {
                 TT_CallRec*  callrec;
 
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index a1d1c35..0df6a95 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -602,7 +602,7 @@
         size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale );
 
       /* All twilight points are originally zero */
-      for ( j = 0; j < size->twilight.n_points; j++ )
+      for ( j = 0; j < (FT_UInt)size->twilight.n_points; j++ )
       {
         size->twilight.org[j].x = 0;
         size->twilight.org[j].y = 0;
@@ -611,7 +611,7 @@
       }
 
       /* clear storage area */
-      for ( i = 0; i < size->storage_size; i++ )
+      for ( i = 0; i < (FT_UInt)size->storage_size; i++ )
         size->storage[i] = 0;
 
       size->GS = tt_default_graphics_state;