Berkeley DB detection problems

Adrian Buciuman impersonala at gmail.com
Thu Dec 15 18:29:56 EST 2005


> Not exactly what you want, but on a Slackware 10.2 system, I use these
> options:
>
>  ./configure --prefix=/usr \
>    --with-bdb-libdir=DIR=/usr/lib \
>    --with-bdb-incdir=/usr/include/db4
>

I know this works . However, I use db3.3.

Cyrus should not impose me to use a particular version of berkeley db.
Neither should it require patches in order to compile in common
scenarios. My impression is that some packages are patching cyrus to
select the right bdb. If true, this is bad. Selection of bdb version
should be done by configure options, not by configure-like patches.

I've come with this issue because I think it is the right time now,
before 2.3.x become used in (many) distributions/ports packages.

How to fix things? I'm not a programmer, so I can only give suggestions.
In my opinion, when configure is trying to guess with which ldb
library to link, it should always check that the version from the db.h
exactly matches the one returned by the library (including patch
level, since there is no sense in not using the exact header, and
matching exactly allows different patch levels to coexist) . If the
versions don't match, then simply skip over that db library name.


Supposing that the libraries are in standard places and no
--with-bdb-libdir is needed, one would be able to use
--with-bdb-incdir=/usr/include/db42 to link with a matching db-4.2,
--with-bdb-incdir=/usr/include/db4.1 to link db-4.1 and so on.

The idea is that linking should always be done with a library that has
the same version as the header. Today this is not always the case.

bdb-libdir will determine -L linker option, while bdb-incdir will
determine -I (uppercase i) option  and indirectly, via version in the
header, -l (lowercase L) option, the version known internally by cyrus
and optionally rpath.

Regards,
Adrian Buciuman



More information about the Info-cyrus mailing list