1 example.library V37.15 (16.8.97)
3 An Amiga shared library in 100 % C language - coming with sources.
5 Compiler Checklist: Compiler Support
6 -------------------------------
7 (see README.<compiler> SAS/C 6.5x yes
8 for more information) MaxonC 3.x yes
15 OS Checklist: Operating Sustem Support
16 -------------------------------
21 Original SAS/C and StormC version (C) 1996-97 by Andreas R. Kleinert,
22 MaxonC version changes done 1996 by Helmut Hummel.
23 GCC version changes done 1997 by Stefan Fuchs and Gunter Nikl.
24 AROS source tree done 1997 by Aaron Digulla.
26 ----------------------------------------------------------------------
27 This sample library intends to make Amiga shared library sources
28 compileable with any available Amiga C compiler - without any
29 changes to the source code.
30 And maybe in the future also running under any Amiga compatible
31 operating system with any CPU.
33 The first goal seams to be easily done: nearly any noticeable compiler
34 for the Amiga does support generation of libraries by special
35 linker commands and pre-generated object files.
37 But when looking into the details, one will find out, that these
38 linker functionality just reduces the influence of the programmer
39 on how his sources are handled, that the pre-generated object
40 files just originally were done in Assembler, and that each compiler
41 does define its own interface definitions and usage rules.
43 But as a programmer, it is important to have control over the _complete_
44 source code and to be able to compile it _anywhere_ with only
45 minor changes, even better without any changes.
47 Since most Amiga system modules - noticeable Libraries, Devices and
48 Resources - do have startup-modules and other larger parts completely
49 written in Assembler language, the most important task for getting
50 inter-compiler and operating system independant sources in my opinion
51 is, to completely migrate the interfaces to C language (but different
52 to AROS, for example, it is most important, to keep the sources running
53 under the current 68k AmigaOS in the _first_ place).
55 This goal basically has been reached already, still missing of
56 course are some of the less Amiga-native compilers and of course
57 tests with any kind of "AmigaOS for PowerPC".
59 But since Assembler is nearly as portability-hostile as BCPL _today_
60 we may come quite close to the goal defined above by just moving
63 Translate your 68k-assembler library startup-codes smartly
64 to C by simply using this source-code as an advice how to do it.
66 For testing: install the (re)compiled example.library to LIBS: and
67 start the test program - it should pop up a requester, then.
69 If you can submit adjustments for the other compilers as mentioned
70 above: feel free to send these.
72 Feel free to use this source for own projects.
74 It is allowed to be spread and distributed anywhere, as far
75 as my consent is concerned.
77 Amiga International, or the current owner of the technologie,
78 is allowed to always put this source on their newest
81 Thanks and credits will always be appreciated - for example,
82 you MAY, but NEED NOT:
83 give me credits in your program's docs, send me keyfiles for
84 your programs using the library, and so on.
85 But that's simply voluntarily.
87 _________________________________________________________
88 | You may reach me the following way. |
89 | Send bug-reports, money or whatever to: |
90 |---------------------------------------------------------|
91 | * SuperView Development & Registration * |
92 | * DRAFU Development & Registration * |
93 | * Image Engineer Registration Site Europe * |
96 | PerSuaSiVe SoftWorX |
98 | Andreas R. Kleinert |
103 | Any snail mail to the old address will still be routed. |
105 | Phone: +49-271-22869 also FAX + AM |
108 | Weekdays after 17.00h. |
110 | When calling via phone you may leave a message, |
111 | if I'm not available - but don't expect me |
112 | calling back to USA, Australia, ... since |
113 | german phone rates are HIGHLY expensive. |
114 |_________________________________________________________|
116 http://home.t-online.de/home/Andreas_Kleinert/
120 Please send binaries via ARK@News.wwbnet.de, and keep
121 them smaller than 16 KB. Please think twice before
122 sending them - my postbox is not unlimited in size.
124 - Fido Andreas Kleinert 2:2457/350.18
126 Andreas_Kleinert@superview.ftn.neckar-alb.de (Fido-Gate)
127 Andreas_Kleinert@t-online.de (T-Online)
128 ARK@News.wwbnet.de (Z-Netz)
129 ARK@amigaworld.com (AmigaWorld)
131 - If nothing else works, try one of these public
132 Fido-Usenet gateways:
135 Andreas_Kleinert@p18.f350.n2457.z2.fido.sub.org
137 From USA or elsewhere:
138 Andreas_Kleinert@p18.f350.n2457.z2.fidonet.org
141 Known Bugs: - some versions of DOpus and all Installer versions
142 can't fetch the version information from the
143 library binary due to some bugs in their code.
144 Newer DOpus versions have this fixed and C:Version
145 for example did that task always.
150 V37.15 (16.8.97) : - merged AmigaOS and AROS version
151 (-> Aaron Digulla, Andreas R. Kleinert)
152 - updated email addresses
155 V37.14 (13.8.97) : - AROS: - the LH1_ to LH2_ macro replacements in
156 "compiler.h" had been wrongly defined
157 - "BPTR" type only was available under AROS,
158 now using "struct SegList *"
159 - AROS version now does compile under AmigaOS
161 - "APTR seglist" now "struct SegList *"
163 V37.13 (19.7.97) : - GNU makefile had lost its TABs
166 V37.12 (29.6.97) : - fixed memory bug-fix (argh)
168 - changed/applied GCC adjustments
169 (-> diffs by Gunter Nikl)
171 V37.11 (24.6.97) : - added "known bugs" section
172 - LibInit now delocates library base on error
175 - added AROS version, and created an additional
176 source tree for it, since I did not get it compiled
177 with SAS/C 6.57 and there's perhaps additional
178 #ifdef stuf to be done. Anyone likes to merge these ?
181 V37.10 (6.4.97) : - added GCC version by Stefan Fuchs, snfuchs@sokrates.franken.de.
183 - some small changes to docs, includes and comments
184 - still missing: DICE, Aztec, vbcc. Who does it ?
185 - fixed ftn email address
187 V37.6 (27.3.97) : - finetuning
189 V37.5 (24.1.97) : - rewrote docs
190 - added basic support for compiler independent
191 register naming and SAS/C keyword replacements
192 (compiler.h). Thus sources now should be easily
193 adaptable for GCC as well.
195 V37.4 (8.1.97) : - added FD file
196 - added new pragma file (and dir) as
197 include/pragma/example_lib.h
198 which works with Aztec, Maxon, Storm,
199 DICE and SAS C compilers.
200 Thanks to fd2pragma and Dirk Stoecker.
201 - some fixes to the readme files
204 V37.3 (3.1.97) : - slightly changed SCOPTIONS
205 - fixed some style things (APTR and library casts)
206 - changed note about library opening at L_OpenLibs()
207 - now compileable with StormC 2.0 as well
208 (not tested with 1.1) - see readme file for StormC
209 - added project file for StormC 2.0, smakefile still
210 present - select, which one you'd like to use
212 V37.2 (12.12.96) : - applied some more changes and fixes
213 (-> suggested by Helmut Hummel)
215 (-> from Helmut Hummel)
217 V37.1 (4.12.96) : - bumped version to V37
218 - added MaxonC 3.x version by applying changes
219 to the SAS/C sources and adding Maxon
220 specific make and configuration files
221 (-> all done by Helmut Hummel, see Readme.MAXON)
222 - added StormC support
223 - yet missing: DICE, Aztec, GNU. Who does it ?
225 V1.4 (30.11.96) : - added SAS/C specific Ctrl-C disabling code
226 - made some workarounds compiler sensitive
227 - redone all with SAS/C V6.57
230 V1.3 (13.9.96) : - when starting lib as executable, -1 must be returned
231 - now caching SysBase
232 - added some comments, where changes should not
234 - added note about sharing library bases
235 - documented and modified sample function,
236 so that correct a0/a1/d0/d1 and a6 usage becomes
237 more obviously and verbose
238 - still 940 bytes ;-)
240 V1.2 (5.9.96) : - fixed some things resulting out of a
243 V1.1 (1.9.96) : - small changes in style
244 (only bumped versions of changed modules):
245 o moved "examplebase.h" to include/example/
246 (so also adjusted LibInit.c, StartUp.c
247 and SCOPTIONS for reflecting that)
248 o SampleFuncs.h did contain wrong prototype
249 (did not matter, since only used for
250 ULONG function table within StartUp.c)
251 o explicitely __aligned ROMTag structure
253 V1.0 (14.8.96) : - first release
257 All mentioned trademarks are subject to their owners.