RFC: static / dynamic linking in samba3

Michael Adam obnox at samba.org
Fri Apr 3 15:44:56 GMT 2009

Hi Jerry,

jerry wrote:
> Michael Adam wrote:
> > * I would also like to (re-)unify the configuration of libwbclient
> >   with the other libs (libtalloc, libtdb, libnetapi, ...) to be
> >   configured with SMB_LIBRARY().
> >   This means that it will also be possible again to build and link
> >   libwbclient statically, removing the restriction imposed when
> >   libsmbclient was originally created that it should only be
> >   possible to build/link libwbclient statically with
> >   --enable-develper. I think this is artificial. Sometimes you just
> >   want to link a library statically. Vendors are patching the sources
> >   to allow for building and linking statically anyways.
> ...
> >   A scheme for building (that is basically also what samba4 does)
> >   initially discussed with Jelmer and Lars (among others)
> >   on irc could be the following:
> > 
> >   - check wheter libfoo is in the system
> >     and check whether it suits our version requirements
> >     (current checks use pkg-config for this)
> > 
> >   - if libfoo is available and version is ok, then
> >     adapt compile / link flags according to pkg-config to
> >     link against that library
> > 
> >   - if either the library is not found or version is not ok,
> >     then build libfoo internally and link it in _statically_
> Michael,
> Would you clarify one thing for me.  By default, will smbd
> link with libwbcliebnt.a or libwbclient.so?

This could be discussed, but _I_ would say that by default
libwbclient.so would be linked in, because to my understanding,
libwbclient will by default be provided by the samba packages
for some time.

This is different for libtalloc (and libtdb), which have found
their way into debian's distribution, others following.

So my proposal is to link libtalloc and libtdb statically
when no system library is found and set the defaults for
the other libs individually. Sounds reasonable?
People (like you, Jerry) with more experience in the
static vs. shared libs business should comment. I may
be missing vital points here.

Recently, an option has been added to link against an external

Cheers - Michael

Michael Adam <ma at sernet.de>  <obnox at samba.org>
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.SerNet.DE, mailto: Info @ SerNet.DE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 206 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20090403/d6099673/attachment.bin

More information about the samba-technical mailing list