Prof A Olowofoyeku (The African Chief) wrote:
On 3 Mar 2003 at 13:14, Frank Heckenbach wrote:
[...]
As you know, in GCC, the difference between static and dynamic libraries is very small. You need some options to create a dynamic lib, and that's all. (When using them, you can force linking static ones with `-static', but otherwise the linker will find dynamic or static ones automatically.)
So if we implement a syntax for `libarary', it should not have any relevance to whether the object code is linked statically or dynamically (or perhaps even as a set of object files).
No, it shouldn't. But it should mean "generate a DLL (Windows) or a .so (Unix), as opposed to a .o".
Uhm, well, that's not exactly what I meant with "should *not*". Whether a static or a shared library is built should not affect the source code.
In fact, under Unix it's common for libraries to build both static and shared versions (and I think the same can be done under Windows), and of course, there should be no change required in the source code (just some different options used etc.).
In Windows, there would have to be linking as well, in order to produce the DLL. But I guess GPC can just assume that "library foo" means "GPC -shared foo ...." and let the system deal with the rest as appropriate.
It takes more. On many platforms (including IA32) code must be compiled with `-fPIC' to work reliably in shared libs. A `-Wl,-soname=...' option for linking is often useful, etc.
All this should not be the job of the compiler, but of the make system. I won't add it to automake anymore (since it's going to vanish, anyway), so it would be something for gp or another utility. That's in the future ...
Currently, we can discuss the syntax aspects, which might be close to what Peter wants to achieve with unit inheritance. Even if no linking provisions are made now, the "library" can be linked just as a set of object files. Later it can be made into a real libraray, without changing the Pascal syntax.
So I was talking more about the syntactical and semantical aspects of `library' in BP/Delphi, not the implementation details (which includes how to link them).
Ok.
So what are they like?
Frank