[RFC] libreplace (was: Re: svn commit: samba r17738 - in branches/SAMBA_4_0/source/lib/ldb: . ldb_tdb)

Jelmer Vernooij jelmer at samba.org
Sat Aug 26 19:03:10 GMT 2006

Hi Tridge (and others interested),

On Fri, 2006-08-25 at 11:27 +1000, tridge at samba.org wrote:
>  > There already is a Samba libreplace. The discussion here is merely
>  > about whether it's contents should be spread out over various subsystems in 
>  > Samba.
> yep, and I agree with you that it is better in one place. I'll try a
> couple of different varients and see if I put together something that
> can be reasonably used by all the different components. You're
> suggestion to use rep_XXX everywhere is worth a try I think.
> We should probably also move a lot of the system dependent configure
> code in there as well. For example, I notice that we have some m4 to
> set the -c99 flag on the IRIX compiler in the Samba4 build. If I moved
> that into libreplace and it was used by ldb, tdb etc, then it might
> solve the problem of C99 initialisers on IRIX.
> The trick will be to do this without depending on m4 macros which are
> specific to the Samba4 build system. The Samba4 build system has a lot
> of advantages, but I don't think we want it for the standalone ldb and
> tdb builds.
I've implemented most of the changes we discussed on IRC yesterday in
the bzr branch at http://people.samba.org/bzr/jelmer/samba/4.0-replace:

 * Added ability to build libreplace standalone
 * lib/ldb/replace integrated back into lib/replace
 * Prefix replacement function symbols with "rep_" so they don't clash
with replacements defined by other libraries
 * Added SMB_REPLACE() m4 macro that looks for libreplace in ".",
"replace" and "../replace" and allows specifying a location using

I've added a SMB_REPLACE_FUNCS() call that checks to make sure its
argument functions are provided by either the system or libreplace. This
would allow building without libreplace on "sane" systems such as Linux
and FreeBSD that have all the required functions. The only drawback is
that it means that just including replace.h won't be sufficient in some
cases (we'll have to have ifdefs for system headers as well again).
Would this be worth it? 

I'll now have a look at adding some sort of test suite to libreplace.
Once that's done, I'd like to merge this branch into Subversion.



Jelmer Vernooij <jelmer at samba.org> - http://samba.org/~jelmer/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20060826/220f0619/attachment.bin

More information about the samba-technical mailing list