
  Modifications to DeskLib to enable generation of dynamically linked
  -
  libraries (DLLs), using the Straylight Dynamic Linking System (SDLS)
  



Because DeskLib source has to be compiled with different flags,
depending on whether it is going to be used in a DLL or static linking,
or as a static library linked into a DLL, there are now two or three
sets of .o files for each of DeskLib's sublibraries.

This is the reason for the rather complicated directory structure of
each sublibrary directory. Also, To enable auto-generation of makefiles,
I have also put a zero-length 'IsDLL' file in those sublibraries which
have a DLL version.

For a description of what each of the files/dirs are for, see
'!DLSources.!Help'.

Here is some random info on some of the more obscure things:


Meta-Dlls
---------

Because of a buglet in the SDLS, a client has to include the stubs of
*all* the DLLs which it uses, even if it doesn't call the DLL directly.
For example, a DeskLib client might use the Event sublibrary's DLL.
Unknown to the client (and Link), the Event DLL will use the DLLPoll
DLL. This causes problems for the SDLS when another client starts up and
tries to use these DLLs itself.

To solve this problem, we need to ensure that the stubs for DLLPoll is
automatically included whenever the Event stubs is linked into a client.

To do this, the Event (for eg) library's stubs file is actually made from the
normal SDLS stubs file '...Event.DLL.PlainStubs' (created with cdll as per
the SDLS docs) and a small .o file '...Event.DLL.OSObj' which is an
assembled version of the file '...Event.OtherStubs'. These two files are
partially linked together to form the final stubs file
'...Event.DLL.Stubs'. All of this is taken care of by the 'MakeStubsOs'
makefile.


Building the complete DLL DeskLib
---------------------------------

Unlike building the normal (statically-linkable) DeskLib, the DLL
DeskLib has to be made in a number of stages. 

This is because each DLL is a self-contained program (created using
Link) - because most of the DeskLib DLLs refer to other parts of
DeskLib, they can only be made after the DeskLib library has been
created.

There are, in fact, three different DeskLib libraries:

'DeskLib:o.DeskLib' - the normal one for static linking with
applications.

'DeskLib:o.DLLClient'
This contains Stubs files for all DLL DeskLib sublibraries, plus all the
.o files from the other DeskLib sublibraries. This library is linked
with normal client applications.

'DeskLib:o.DLLDLL'
This is the same as DLLClient, except that the .o files from the non-DLL
sublibraries have been compiled with 'cc -zM', so that they will be
suitable for use in a DLL enviroment. Also, any Stubs files needed by
a DLL result in just the 'PlainStubs' being included, without the
'OSObj' object file. This is because only applications, not DLLs, need
to include the stubs of any indirectly included DLLs. This library is
linked into each of the the final DeskLib DLLs.

To see exactly what files are in each of the three DeskLib:o.* files,
look at the three text files in '!DeskLib_Sources.ObjLists'. These are
created before calling LibFile, and then used with LibFile's -v option.


Everything is done by the Obey file '!DLSources.Scripts.DLL.MakeAll'.
This runs the following:

'RunStubsOs' - this makes .o files in each DLL sublibrary suitable
for use in a DLL, and also makes the DLL Stubs files. Then it makes .o
files in each non-DLL sublibrary suitable for static linking into DLLs.

'RunClientO' - this makes .o files in each non-DLL sublibrary suitable
for linking into a DLL client application.

'MakeDLibs - this uses LibFile to make the two DLL-libraries in the main
!DeskLib application, 'DeskLib:o.DLLDLL' and 'DeskLib:o.DLLClient'. NB
this involves automatically generating lists of .o files in
'!DLSources.ObjLists'.

'RunDLL' - This links the final DLLs and puts them in
'!DeskLib.!DLLs.DeskLib'.

