[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: self contained library

From: Philip Willoughby
Subject: Re: self contained library
Date: Fri, 14 Mar 2003 11:59:10 +0000 (GMT)

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.

>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.

If you're distributing a program, and you really, really want to do this, then
why not link the entire program statically?

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.


Philip Willoughby

Systems Programmer, Department of Computing, Imperial College, London, UK
echo address@hidden | tr "bizndfohces" "pwgd9ociaku"

Why reinvent the wheel?                      Because we can make it rounder...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]