Re: [Exim] GDBM

Inizio della pagina
Delete this message
Reply to this message
Autore: Philip Hazel
Data:  
To: Dave C.
CC: Gabor Z. Papp, exim-users
Oggetto: Re: [Exim] GDBM
On Mon, 28 Jan 2002, Dave C. wrote:

> I'm trying to compile an exim with GDBM on a system that has db1, db2,
> db3, and gdbm installed (RH72).. (I need gdbm for compatibility with
> something else that uses it)
>
> Exim appears to ALWAYS be following the "#elif defined USE_DB" , because
> I keep getting "undefined reference to `db_create'", and db_create is
> ONLY referenced from within this #elif section.


There is a problem that came to light recently, and which I've fixed for
Exim 4. You need to ensure that USE_DB is *not* set when you compile
with GDBM. Unfortunately, the Linux configuration files set it, and
Exim's pre-processing program (buildconfig) doesn't unset it.

> I don't seem to have a way to unset it without editing Makefile-Linux
> itself.


In the next pre-release of Exim 4 (I'm intending to release it tomorrow)
you will be able to set USE_GDBM=yes and it should work. For Exim 3, the
best thing is to edit config.h after Exim has built it.

> to allow for a setting of USE_DB=no (or even USE_DB=blah) preventing it
> from obeying that section


Yes, it's a mess. It needs even more tidying up (it's still very hacky).
I have it on my list for the future.

> On a related tangent - perhaps exim should support any/all DBM libraries
> that are installed, and have a specification for which type it should
> use for its own db files, and have a per-lookup way of specifying which
> type to use for that lookup ??


Quote from doc/dbm.discuss.txt:

------------------------------------------------------------------------
I have considered the possibility of calling different dbm libraries for
different functions from a single Exim binary. However, because all bar one of
the libraries provide ndbm compatibility interfaces (and therefore the same
function names) it would require a lot of complicated, error-prone trickery to
achieve this. Exim therefore uses a single library for all its dbm activities.

However, Exim does also support cdb (Constant Data Base), an efficient file
arrangement for indexed data that does not change incrementally (for example,
alias files). This is independent of any dbm library and can be used alongside
any of them.
------------------------------------------------------------------------


> Suppose two different closed-source apps, using two different db
> libraries, were writing data files that the same instance of exim
> needed to be able to access?


Perl manages to handle multiple DBM libraries, so it must be possible.
I'm ignorant about fine details of using multiple libraries that contain
identially-named functions. I would need to do some research to find out
how to implement this safely (so there was no confusion). I can't see
myself finding the time to do this in the near future, I'm afraid.

Philip

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.