Adriaan van Os wrote:
The included patch adds --compile-and-link to gp. I hope it's acceptable. It nicely creates a dynamic library on Mac OS X from a unit (while passing some extra needed options of course). Even better, the problem that I encountered this morning while trying this with gpc (.o files of compiled units weren't linked in) doesn't occur with gp !
Looks alright. Though you might want to add a note in the documentation that linking will usually fail, unless the module/unit or something it uses provides a `main' function, or you're creating a dynamic library which requires additional options.
Waldek Hebisch wrote:
As far as I know, the opposite switch is not available, namely to compile *and link* a unit. This is useful when compiling a unit into a shared library, while still using the specs file instead of a separate ld run (which could be less compatible).
Why do not you link shared library as a program (using `-fgpc-main=' option)? At first glance this should avoid most problems with shared libraries.
At first sight, that looks somewhat strange (conceptually), because a library is a collection of routines, like a unit, not a program. Still, I will experiment with it, thanks for the hint.
I also wonder if you (Waldek) misunderstood this option. It does not tell gp to compile and link. Instead it changes the linker name of the main program. I don't think it's applicable here.
Frank