From 288ce1430339d2642aabc7c22a998babe1126e38 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 8 Jun 2005 11:56:55 +0000 Subject: [PATCH] * builds/amiga/*: Added copyright notes, reworked some comments. --- ChangeLog | 4 + builds/amiga/README | 109 ++++++++++-------- .../amiga/include/freetype/config/ftconfig.h | 51 ++++++-- .../amiga/include/freetype/config/ftmodule.h | 37 +++++- builds/amiga/makefile | 17 +++ builds/amiga/makefile.os4 | 16 +++ builds/amiga/smakefile | 16 +++ builds/amiga/src/base/ftdebug.c | 55 +++++---- builds/amiga/src/base/ftsystem.c | 29 +++-- include/freetype/config/ftoption.h | 2 +- 10 files changed, 245 insertions(+), 91 deletions(-) diff --git a/ChangeLog b/ChangeLog index d1eea97d2..e10793349 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-06-07 Detlef Würkner + + * builds/amiga/*: Added copyright notes, reworked some comments. + 2005-06-05 Werner Lemberg * Add copyright notices to all files which don't have one. diff --git a/builds/amiga/README b/builds/amiga/README index 772705176..bef27a897 100644 --- a/builds/amiga/README +++ b/builds/amiga/README @@ -1,93 +1,110 @@ -The makefile.os4 is for the AmigaOS4 SDK. To use it, type + +README for the builds/amiga subdirectory. + +Copyright 2005 by +Werner Lemberg and Detlef Würkner. + +This file is part of the FreeType project, and may only be used, modified, +and distributed under the terms of the FreeType project license, +LICENSE.TXT. By continuing to use, modify, or distribute this file you +indicate that you have read the license and understand and accept it +fully. + + +The makefile.os4 is for the AmigaOS4 SDK. To use it, type "make -f makefile.os4", it produces a link library libft2_ppc.a. -The makefile is for ppc-morphos-gcc-2.95.3-bin.tgz (gcc 2.95.3 hosted -on 68k-Amiga producing MorphOS-PPC-binaries from -http://www.morphos.de). To use it, type "make assign", then "make"; -it produces a link library libft2_ppc.a. +The makefile is for ppc-morphos-gcc-2.95.3-bin.tgz (gcc 2.95.3 hosted on +68k-Amiga producing MorphOS-PPC-binaries from http://www.morphos.de). +To use it, type "make assign", then "make"; it produces a link library +libft2_ppc.a. The smakefile is a makefile for Amiga SAS/C 6.58 (no longer available, -latest sold version was 6.50, updates can be found in Aminet). It is -based on the version found in the sourcecode of ttf.library 0.83b for -FreeType 1.3.1 from Richard Griffith (ragriffi@sprynet.com, +latest sold version was 6.50, updates can be found in Aminet). It is +based on the version found in the sourcecode of ttf.library 0.83b for +FreeType 1.3.1 from Richard Griffith (ragriffi@sprynet.com, http://ragriffi.home.sprynet.com). -You will also need the latest include files and amiga.lib from the -Amiga web site (http://www.amiga.com/3.9/download/NDK3.9.lha) for +You will also need the latest include files and amiga.lib from the +Amiga web site (http://www.amiga.com/3.9/download/NDK3.9.lha) for AmigaOS 3.9; the generated code should work under AmigaOS 2.04 and up. -To use it, call "smake assign" and then "smake" from the builds/amiga +To use it, call "smake assign" and then "smake" from the builds/amiga directory. The results are: -- A link library "ft2_680x0.lib" (where x depends on the setting of - the CPU entry in the smakefile) containing all FreeType2 parts - except of the init code, debugging code, and the system interface +- A link library "ft2_680x0.lib" (where x depends on the setting of + the CPU entry in the smakefile) containing all FreeType2 parts + except of the init code, debugging code, and the system interface code. -- ftsystem.o, an object module containing the standard version of the - system interface code which uses fopen() fclose() fread() fseek() +- ftsystem.o, an object module containing the standard version of the + system interface code which uses fopen() fclose() fread() fseek() ftell() malloc() realloc() and free() from lib:sc.lib (not pure). -- ftsystempure.o, an object module containing the pure version of the - system interface code which uses Open() Close() Read() Seek() - ExamineFH() AsmAllocPooled() AsmFreePooled() etc. This version can - be used in both normal programs and in Amiga run-time shared system - librarys (can be linked with lib:libinit.o, no copying of DATA and - BSS hunks for each OpenLibrary() necessary). Source code is in +- ftsystempure.o, an object module containing the pure version of the + system interface code which uses Open() Close() Read() Seek() + ExamineFH() AsmAllocPooled() AsmFreePooled() etc. This version can + be used in both normal programs and in Amiga run-time shared system + librarys (can be linked with lib:libinit.o, no copying of DATA and + BSS hunks for each OpenLibrary() necessary). Source code is in src/base/ftsystem.c. -- ftdebug.o, an object module containing the standard version of the - debugging code which uses vprintf() and exit() (not pure). - Debugging can be turned on in FT:include/freetype/config/ftoption.h +- ftdebug.o, an object module containing the standard version of the + debugging code which uses vprintf() and exit() (not pure). + Debugging can be turned on in FT:include/freetype/config/ftoption.h and with FT_SetTraceLevel(). -- ftdebugpure.o, an object module containing the pure version of the - debugging code which uses KVPrintf() from lib:debug.lib and no - exit(). For debugging of Amiga run-time shared system libraries. +- ftdebugpure.o, an object module containing the pure version of the + debugging code which uses KVPrintf() from lib:debug.lib and no + exit(). For debugging of Amiga run-time shared system libraries. Source code is in src/base/ftdebug.c. -- NO ftinit.o. Because linking with a link library should result in - linking only the needed object modules in it, but standard - ftsystem.o would force ALL FreeType2 modules to be linked to your - program, I decided to use a different scheme: You must #include - FT:src/base/ftinit.c in your sourcecode and specify with #define - statements which modules you need. See +- NO ftinit.o. Because linking with a link library should result in + linking only the needed object modules in it, but standard + ftsystem.o would force ALL FreeType2 modules to be linked to your + program, I decided to use a different scheme: You must #include + FT:src/base/ftinit.c in your sourcecode and specify with #define + statements which modules you need. See include/freetype/config/ftmodule.h. To use in your own programs: -- Insert the #define and #include statements from top of +- Insert the #define and #include statements from top of include/freetype/config/ftmodule.h in your source code and uncomment the #define statements for the FreeType2 modules you need. -- You can use either PARAMETERS=REGISTER or PARAMETERS=STACK for - calling the FreeType2 functions, because the link library and the +- You can use either PARAMETERS=REGISTER or PARAMETERS=STACK for + calling the FreeType2 functions, because the link library and the object files are compiled with PARAMETERS=BOTH. - "smake assign" (assign "FT:" to the FreeType2 main directory). - Compile your program. -- Link with either ftsystem.o or ftsystempure.o, if debugging enabled +- Link with either ftsystem.o or ftsystempure.o, if debugging enabled with either ftdebug.o or (ftdebugpure.o and lib:debug.lib), and with ft2_680x0.lib as link library. To adapt to other compilers: -- The standard ANSI C maximum length of 31 significant characters in +- The standard ANSI C maximum length of 31 significant characters in identifiers is not enough for FreeType2. Check if your compiler has - a minimum length of 40 significant characters or can be switched to - it. "idlen=40" is the option for SAS/C. Setting #define + a minimum length of 40 significant characters or can be switched to + it. "idlen=40" is the option for SAS/C. Setting #define HAVE_LIMIT_ON_IDENTS in an include file may also work (not tested). -- Make sure that the include directory in builds/amiga is searched - before the normal FreeType2 include directory, so you are able to +- Make sure that the include directory in builds/amiga is searched + before the normal FreeType2 include directory, so you are able to replace problematic include files with your own version (same may be useful for the src directory). -- An example of how to replace/workaround a problematic include file - is include/config/ftconfig.h; it changes a #define that would - prevent SAS/C from generating XDEF's where it should do that and +- An example of how to replace/workaround a problematic include file + is include/config/ftconfig.h; it changes a #define that would + prevent SAS/C from generating XDEF's where it should do that and then includes the standard FreeType2 include file. + +Local Variables: +coding: latin-1 +End: diff --git a/builds/amiga/include/freetype/config/ftconfig.h b/builds/amiga/include/freetype/config/ftconfig.h index 73749fa89..23d2edab2 100644 --- a/builds/amiga/include/freetype/config/ftconfig.h +++ b/builds/amiga/include/freetype/config/ftconfig.h @@ -1,13 +1,41 @@ -// TetiSoft: We must change FT_BASE_DEF and FT_EXPORT_DEF +/***************************************************************************/ +/* */ +/* ftconfig.h */ +/* */ +/* Amiga-specific configuration file (specification only). */ +/* */ +/* Copyright 2005 by */ +/* Werner Lemberg and Detlef Würkner. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/* + * This is an example how to override the default FreeType2 header files + * with Amiga-specific changes. When the compiler searches this directory + * before the default directory, we can do some modifications. + * + * Here we must change FT_BASE_DEF and FT_EXPORT_DEF so that SAS/C does + * generate the needed XDEFs. + */ + +#if 0 +#define FT_BASE_DEF( x ) extern x +#define FT_EXPORT_DEF( x ) extern x +#endif -//#define FT_BASE_DEF( x ) extern x // SAS/C wouldn't generate an XDEF -//#define FT_EXPORT_DEF( x ) extern x // SAS/C wouldn't generate an XDEF #undef FT_BASE_DEF #define FT_BASE_DEF( x ) x + #undef FT_EXPORT_DEF #define FT_EXPORT_DEF( x ) x -// TetiSoft: now include original file +/* Now include the original file */ #ifndef __MORPHOS__ #ifdef __SASC #include "FT:include/freetype/config/ftconfig.h" @@ -15,10 +43,17 @@ #include "/FT/include/freetype/config/ftconfig.h" #endif #else -// We must define that, it seems that -// lib/gcc-lib/ppc-morphos/2.95.3/include/syslimits.h is missing in -// ppc-morphos-gcc-2.95.3-bin.tgz (gcc for 68k producing MorphOS PPC elf -// binaries from http://www.morphos.de) +/* We must define that, it seems that + * lib/gcc-lib/ppc-morphos/2.95.3/include/syslimits.h is missing in + * ppc-morphos-gcc-2.95.3-bin.tgz (gcc for 68k producing MorphOS PPC elf + * binaries from http://www.morphos.de) + */ #define _LIBC_LIMITS_H_ #include "/FT/include/freetype/config/ftconfig.h" #endif + +/* +Local Variables: +coding: latin-1 +End: +*/ diff --git a/builds/amiga/include/freetype/config/ftmodule.h b/builds/amiga/include/freetype/config/ftmodule.h index 29f682c73..59a188aeb 100644 --- a/builds/amiga/include/freetype/config/ftmodule.h +++ b/builds/amiga/include/freetype/config/ftmodule.h @@ -1,6 +1,26 @@ -// To specify which modules you need, -// insert the following in your source file and uncomment as needed: +/***************************************************************************/ +/* */ +/* ftmodule.h */ +/* */ +/* Amiga-specific FreeType module selection. */ +/* */ +/* Copyright 2005 by */ +/* Werner Lemberg and Detlef Würkner. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ +/* + * To avoid that all your programs include all FreeType modules, + * you copy the following piece of source code into your own + * source file and specify which modules you really need in your + * application by uncommenting the appropriate lines. + */ /* //#define FT_USE_AUTOFIT // autofitter //#define FT_USE_RASTER // monochrome rasterizer @@ -18,8 +38,9 @@ #include "FT:src/base/ftinit.c" */ -// Make sure that needed support modules are built in. -// Dependencies can be found by searching for FT_Get_Module. +/* Make sure that the needed support modules are built in. + * Dependencies can be found by searching for FT_Get_Module. + */ #ifdef FT_USE_T42 #define FT_USE_TT @@ -55,7 +76,7 @@ #define FT_USE_PSNAMES #endif -// Now include the modules +/* Now include the modules */ #ifdef FT_USE_AUTOFIT FT_USE_MODULE(autofit_module_class) @@ -126,3 +147,9 @@ FT_USE_MODULE(otv_module_class) #ifdef FT_USE_BDF FT_USE_MODULE(bdf_driver_class) #endif + +/* +Local Variables: +coding: latin-1 +End: +*/ diff --git a/builds/amiga/makefile b/builds/amiga/makefile index 4b8e64968..6af1eab65 100644 --- a/builds/amiga/makefile +++ b/builds/amiga/makefile @@ -2,6 +2,19 @@ # Makefile for FreeType2 link library using ppc-morphos-gcc-2.95.3-bin.tgz # (gcc 2.95.3 hosted on 68k-Amiga producing MorphOS-PPC-binaries from # http://www.morphos.de) +# + + +# Copyright 2005 by +# Werner Lemberg and Detlef Würkner. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + # # to build from the builds/amiga directory call # @@ -246,3 +259,7 @@ FONTDPPC = cff.ppc.o type1.ppc.o type42.ppc.o type1cid.ppc.o truetype.ppc.o\ libft2_ppc.a: $(BASEPPC) $(AFITPPC) $(OTVPPC) $(PSPPC) $(RASTERPPC) sfnt.ppc.o ftcache.ppc.o $(FONTDPPC) gzip.ppc.o lzw.ppc.o $(AR) $@ $(BASEPPC) $(AFITPPC) $(OTVPPC) $(PSPPC) $(RASTERPPC) sfnt.ppc.o ftcache.ppc.o $(FONTDPPC) gzip.ppc.o lzw.ppc.o -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 + +#Local Variables: +#coding: latin-1 +#End: diff --git a/builds/amiga/makefile.os4 b/builds/amiga/makefile.os4 index a3e6f823f..858e1bb9a 100644 --- a/builds/amiga/makefile.os4 +++ b/builds/amiga/makefile.os4 @@ -2,6 +2,18 @@ # Makefile for FreeType2 link library using gcc 3.4.3 from the # AmigaOS4 SDK # + + +# Copyright 2005 by +# Werner Lemberg and Detlef Würkner. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + # to build from the builds/amiga directory call # # make @@ -252,3 +264,7 @@ FONTD = cff.ppc.o type1.ppc.o type42.ppc.o type1cid.ppc.o truetype.ppc.o\ libft2_ppc.a: $(BASE) $(AFIT) $(OTV) $(PS) $(RASTER) sfnt.ppc.o ftcache.ppc.o $(FONTD) gzip.ppc.o lzw.ppc.o $(AR) r $@ $(BASE) $(AFIT) $(OTV) $(PS) $(RASTER) sfnt.ppc.o ftcache.ppc.o $(FONTD) gzip.ppc.o lzw.ppc.o $(RANLIB) $@ + +#Local Variables: +#coding: latin-1 +#End: diff --git a/builds/amiga/smakefile b/builds/amiga/smakefile index 8bc27bd16..1d7a2d7ed 100644 --- a/builds/amiga/smakefile +++ b/builds/amiga/smakefile @@ -1,6 +1,18 @@ # # Makefile for FreeType2 link library using Amiga SAS/C 6.58 # + + +# Copyright 2005 by +# Werner Lemberg and Detlef Würkner. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + # to build from the builds/amiga directory call # # smake assign @@ -257,3 +269,7 @@ winfnt.o: $(CORE)winfonts/winfnt.c # otvalid.o: $(CORE)otvalid/otvalid.c sc $(SCFLAGS) objname=$@ $< + +#Local Variables: +#coding: latin-1 +#End: diff --git a/builds/amiga/src/base/ftdebug.c b/builds/amiga/src/base/ftdebug.c index 0f4b81a16..75cc66dca 100644 --- a/builds/amiga/src/base/ftdebug.c +++ b/builds/amiga/src/base/ftdebug.c @@ -1,32 +1,11 @@ -/* - * TetiSoft: replaced vprintf() with KVPrintF(), commented out exit(), - * and replaced getenv() with GetVar() - */ - -#include -#include -#include -#include -#define __NOLIBBASE__ -#define __NOLOBALIFACE__ -#define __USE_INLINE__ -#include -#include - -#ifndef __amigaos4__ -extern struct Library *DOSBase; -#else -extern struct DOSIFace *IDOS; -#endif - /***************************************************************************/ /* */ /* ftdebug.c */ /* */ /* Debugging and logging component (body). */ /* */ -/* Copyright 1996-2001, 2002, 2004 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* Copyright 1996-2001, 2002, 2004, 2005 by */ +/* David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ @@ -62,6 +41,30 @@ extern struct DOSIFace *IDOS; /*************************************************************************/ +/* + * Based on the default ftdebug.c, + * replaced vprintf() with KVPrintF(), + * commented out exit(), + * replaced getenv() with GetVar(). + */ + +#include +#include +#include +#include +#define __NOLIBBASE__ +#define __NOLOBALIFACE__ +#define __USE_INLINE__ +#include +#include + +#ifndef __amigaos4__ +extern struct Library *DOSBase; +#else +extern struct DOSIFace *IDOS; +#endif + + #include #include FT_FREETYPE_H #include FT_INTERNAL_DEBUG_H @@ -268,5 +271,9 @@ extern struct DOSIFace *IDOS; #endif /* !FT_DEBUG_LEVEL_TRACE */ - +/* +Local Variables: +coding: latin-1 +End: +*/ /* END */ diff --git a/builds/amiga/src/base/ftsystem.c b/builds/amiga/src/base/ftsystem.c index 2e4dff31e..00ee3d55b 100644 --- a/builds/amiga/src/base/ftsystem.c +++ b/builds/amiga/src/base/ftsystem.c @@ -5,7 +5,7 @@ /* Amiga-specific FreeType low-level system interface (body). */ /* */ /* Copyright 1996-2001, 2002, 2005 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ @@ -24,12 +24,22 @@ /*************************************************************************/ -/* Maintained by Detlef Würkner */ - -/* TetiSoft: Modified to avoid fopen() fclose() fread() fseek() ftell() - * malloc() realloc() and free(). - * We need exec V39+ because we use AllocPooled() etc. - */ + /*************************************************************************/ + /* */ + /* Maintained by Detlef Würkner */ + /* */ + /* Based on the original ftsystem.c, */ + /* modified to avoid fopen(), fclose(), fread(), fseek(), ftell(), */ + /* malloc(), realloc(), and free(). */ + /* */ + /* Those C library functions are often not thread-safe or cant be */ + /* used in a shared Amiga library. If thats not a problem for you, */ + /* you can of course use the default ftsystem.c with C library calls */ + /* instead. */ + /* */ + /* This implementation needs exec V39+ because it uses AllocPooled() etc */ + /* */ + /*************************************************************************/ #define __NOLIBBASE__ #define __NOGLOBALIFACE__ @@ -504,4 +514,9 @@ Free_VecPooled( APTR poolHeader, FreeVec( memory ); } +/* +Local Variables: +coding: latin-1 +End: +*/ /* END */ diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h index 17d879736..42579ad83 100644 --- a/include/freetype/config/ftoption.h +++ b/include/freetype/config/ftoption.h @@ -446,7 +446,7 @@ FT_BEGIN_HEADER /* work-around hinting system. Note that for the moment, the algorithm */ /* is only used when selected at runtime through the parameter tag */ /* FT_PARAM_TAG_UNPATENTED_HINTING; or when the debug hook */ - /* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally actived. */ + /* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally activated. */ /* */ #define TT_CONFIG_OPTION_UNPATENTED_HINTING