Dovecot fails to compile --with-cdb (and attempted fix)

Jeffrey 'jf' Lim jfs.world at gmail.com
Mon Mar 9 18:15:29 UTC 2015


Dovecot version: 2.2.15
Tinycdb: 0.78

I'm attempting to compile dovecot --with-cdb, but keep getting into a
problem with cdb:
========================
libtool: link: gcc -std=gnu99 -g -O2 -Wall -W -Wmissing-prototypes
-Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2
-Wbad-function-cast -fno-builtin-strftime -Wstrict-aliasing=2
-Wl,--as-needed -o .libs/anvil main.o anvil-connection.o anvil-settings.o
connect-limit.o penalty.o -Wl,--export-dynamic
../../src/lib-dovecot/.libs/libdovecot.so -ldl -lrt -Wl,-rpath
-Wl,/usr/local/lib/dovecot
../../src/lib-dovecot/.libs/libdovecot.so: undefined reference to `cdb_read'
../../src/lib-dovecot/.libs/libdovecot.so: undefined reference to `cdb_find'
../../src/lib-dovecot/.libs/libdovecot.so: undefined reference to `cdb_free'
../../src/lib-dovecot/.libs/libdovecot.so: undefined reference to `cdb_init'
collect2: ld returned 1 exit status
make[3]: *** [anvil] Error 1
make[3]: Leaving directory `/home/jf/dovecot-2.2.15/src/anvil'
==========================

After some troubleshooting, I've finally managed to get dovecot to compile,
albeit with a hack:

--- src/lib-dovecot/Makefile.old    2015-03-09 17:36:15.690179802 +0000
+++ src/lib-dovecot/Makefile    2015-03-09 18:01:43.075719700 +0000
@@ -230,7 +230,7 @@
 LIBDOVECOT_STORAGE_DEPS = $(top_builddir)/src/lib-storage/
libdovecot-storage.la $(top_builddir)/src/lib-imap-storage/
libimap-storage.la
 LIBICONV =
 LIBOBJS =
-LIBS = -lrt
+LIBS = -lrt -lcdb
 LIBTOOL = $(SHELL) $(top_builddir)/libtool
 LIBWRAP_LIBS =
 LINKED_STORAGE_LDADD =

This isn't the best fix, admittedly (I wish I were more familiar with
autotools), but I'll say that the configure process isn't right yet for
cdb. Can anybody produce a better fix? Would love to learn more.

thanks,
-jf

--
He who settles on the idea of the intelligent man as a static entity only
shows himself to be a fool.

Mensan / Full-Stack Technical Polymath / System Administrator
12 years over the entire web stack: Performance, Sysadmin, Ruby and Frontend


More information about the dovecot mailing list