[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: self contained library
Re: self contained library
Fri, 14 Mar 2003 15:23:13 +0100 (CET)
On Fri, 14 Mar 2003, Philip Willoughby wrote:
> Today, Ronald Landheer-Cieslak wrote:
> >Do you mean by "self-contained" that it should even contain the C
> >library functions it uses?
> >If so, the only way I know of doing it is to make a static library
> >archive, and link it into a shared library, statically linking the C
> >library into it.
> Ah, straight from the `Do not do this book of software development'.
> It won't work everywhere, and it really shouldn't work anywhere.
> The only reliable way to make a shared library with no dependencies is
> to have source code with no dependencies.
As long as you compile your object files knowing they will become a shared
library, I see no problem with this approach..
> >I don't think Libtool knows how to do this, though (but you might get a
> >long way getting it to make you a shared library and re-linking it
> >statically to libc)
> Libtool won't do it because this is the kind of thing libtool was
> created to stop people having to do.
> If you're distributing a library, don't try and distribute a complete
> binary package, just make sure you clearly list _all_ of the
> dependencies on the download page. Unless they're extremely esoteric,
> most people will have access to them all in any case.
The case we're dealing with is obviously meant to be distributed in binay
form, as a single shared library file. Libtool was created to be able to
build and use shared and static libraries as transparently as possible,
and, in deed, wrongly assumes you can just send the code and expect the
user to have a compiler. Many, many systems that are used only by
end-users don't even have a compiler installed - and many don't want the
fuss of having to deal with installing anything but what they *obviously*
really want - without any added bells and jingles of stuff they don't know
how to use.
Hence, the library-without-external-dependencies kinda questions - which
is a problem I have to solve (from time to time) as well (and *I* can't
rely on any specific libc being there either..)
> If you're distributing a program, and you really, really want to do
> this, then why not link the entire program statically?
Because we're talking about a shared library - one used by JNI, for
> Remember that in the long run it's only packagers who need to compile
> your code, and they will want as small a package as possible. They'll
> also be used to dealing with dependant packages in a sensible way.
Depends on what you're working on. (So it might be right for the original
sender, but it's certainly not right for me).