[PATCH] standalone build enhancements for tdb, talloc, events, ldb

simo idra at samba.org
Fri Sep 5 18:01:58 GMT 2008


On Fri, 2008-09-05 at 19:04 +0200, Stefan (metze) Metzmacher wrote:
> simo schrieb:
> > On Wed, 2008-09-03 at 20:29 +0000, simo wrote:
> >> I have been working on patch to make it possible to build
> >> talloc,tdb,events and ldb standalone in a way that allows to build them
> >> as shared objects and have events use libtalloc.so and ldb use
> >> libtalloc.so libtdb.so and libevents.so
> >>
> >> This will allow to avoid code duplication, fat binaries and most
> >> importantly bad behaviors when using the same code linked multiple time
> >> into binaries because of dependencies (we had lot of troubles at the
> >> last sambaXp conference because the events code was linked in multiple
> >> times).
> >>
> >> Next step would be to make it possible to build libreplace.a only once
> >> and not in each subsystem again and again.
> >>
> >> To test this work correctly I used the following approach:
> >>
> >> for each subsystem in this order: (tdb,talloc,events,ldb)
> >>
> >> cd $subdir;
> >> ./autogen.sh
> >> ./configure --prefix=/foo/bar --with-build-install-dir=../build
> >> make build-install
> >>
> >>
> >> Using the new option --with-build-install-dir and the new target
> >> build-install the make files build the code and then just install .a/.so
> >> libriaries (and headers) into ../build/[include|lib]
> >> ../build/include is also added to CFLAGS and ..build/lib to LIBS so that
> >> when you build, say events, it will find the libtalloc.so file
> >> in ../build/lib
> >> if --with-build-install-dir is not used --with-talloc=/foo/bar (etc..)
> >> can be used to specify exactly where an already installed library can be
> >> found (if not available in the standard path (/usr/lib), this will allow
> >> distributions and others to build specific versions of libraries and
> >> link to those if preferred).
> >>
> >>
> >> I tried to apply the patch on top of v4-0-test and recompiled, it seem
> >> it doesn't break a normal static version of samba4, make test seem
> >> happy.
> >>
> > 
> > After some discussion with Jelmer (he didn't like the --with-<submodule>
> > stuff) here it is another patch that seem to work fine in my tests.
> 
> Hi Simo,
> 
> why one large patch?

Just to give the sense of the change.

>  Each subsystem should have it's own commit.

Yes I will break down into separate patches if I get the go to commit

> What repo are you working with (the source/lib/ prefix is missing...)?

To make sure they can really build standalone I copied
replace,events,talloc,tdb,ldb off tree and tested they really build
stanalone w/o any other source from samba).

> Why the tdb.h change? Why should be include "signal.h"?

It wasn't building standalone otherwise.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Senior Software Engineer at Red Hat Inc. <simo at redhat.com>



More information about the samba-technical mailing list