[Dovecot] Dovecot 2.1 with custom OpenSSL fails to build
Andreas M. Kirchwitz
amk at krell.zikzak.de
Fri Feb 24 03:22:47 EET 2012
Hello Dovecot users!
There seems to be a new dependency in some modules (eg, lib-storage,
libdovecot-lda, libdovecot-ssl) on OpenSSL. In Dovecot 2.0, those
modules didn't require OpenSSL, but 2.1 does.
For the linking process the path to the OpenSSL library isn't
specified properly (SSL_LIBS). Dovecot fails to build if OpenSSL
is in a non-standard path. (Haven't checked if SSL_CFLAGS isn't
properly used as well.)
Example for lib-storage:
env SSL_CFLAGS="-I/usr/local/ssl/include" SSL_LIBS="-L/usr/local/ssl/lib -Wl,-R/usr/local/ssl/lib -lcrypto -lssl" ./configure --prefix=/usr/local/${DOVECOTVER} --with-ssl=openssl --with-ssldir=/usr/local/${DOVECOTVER}/etc/dovecot/certs
make
gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src/lib -I../../src/lib-master -I../../src/lib-settings -I../../src/lib-mail -I../../src/lib-storage -DPKG_RUNDIR=\""/usr/local/Dovecot-2.1.1/var/run/dovecot"\" -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 -I/usr/local/ssl/include -MT master-connection.o -MD -MP -MF .deps/master-connection.Tpo -c -o master-connection.o master-connection.c
mv -f .deps/master-connection.Tpo .deps/master-connection.Po
/bin/sh ../../libtool --tag=CC --mode=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 -I/usr/local/ssl/include -no-undefined -Wl,--as-needed -o indexer-worker indexer-worker.o indexer-worker-settings.o master-connection.o ../../src/lib-storage/libdovecot-storage.la ../../src/lib-dovecot/libdovecot.la -export-dynamic -ldl -lrt
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 -I/usr/local/ssl/include -Wl,--as-needed -o .libs/indexer-worker indexer-worker.o indexer-worker-settings.o master-connection.o -Wl,--export-dynamic ../../src/lib-storage/.libs/libdovecot-storage.so ../../src/lib-dovecot/.libs/libdovecot.so -ldl -lrt -Wl,-rpath -Wl,/usr/local/Dovecot-2.1.1/lib/dovecot
/usr/bin/ld: warning: libcrypto.so.1.0.0, needed by ../../src/lib-storage/.libs/libdovecot-storage.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libssl.so.1.0.0, needed by ../../src/lib-storage/.libs/libdovecot-storage.so, not found (try using -rpath or -rpath-link)
../../src/lib-storage/.libs/libdovecot-storage.so: undefined reference to `OBJ_txt2nid'
../../src/lib-storage/.libs/libdovecot-storage.so: undefined reference to `SSL_set_ex_data'
[...]
# ldd src/lib*/.libs/*.so
src/lib-dovecot/.libs/libdovecot.so:
linux-gate.so.1 => (0x00979000)
libdl.so.2 => /lib/libdl.so.2 (0x00c31000)
librt.so.1 => /lib/librt.so.1 (0x009ed000)
libc.so.6 => /lib/libc.so.6 (0x0054d000)
/lib/ld-linux.so.2 (0x00c12000)
libpthread.so.0 => /lib/libpthread.so.0 (0x008f4000)
src/lib-lda/.libs/libdovecot-lda.so:
linux-gate.so.1 => (0x0096d000)
libdovecot-storage.so.0 => /usr/local/src/dovecot-2.1.1/src/lib-storage/.libs/libdovecot-storage.so.0 (0x00ae4000)
libdovecot.so.0 => /usr/local/src/dovecot-2.1.1/src/lib-dovecot/.libs/libdovecot.so.0 (0x00110000)
librt.so.1 => /lib/librt.so.1 (0x00189000)
libc.so.6 => /lib/libc.so.6 (0x00192000)
libcrypto.so.1.0.0 => not found
libssl.so.1.0.0 => not found
libdl.so.2 => /lib/libdl.so.2 (0x0031c000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00ebc000)
/lib/ld-linux.so.2 (0x003f8000)
src/lib-sql/.libs/libdovecot-sql.so:
linux-gate.so.1 => (0x00a95000)
libdovecot.so.0 => /usr/local/src/dovecot-2.1.1/src/lib-dovecot/.libs/libdovecot.so.0 (0x002b6000)
libdl.so.2 => /lib/libdl.so.2 (0x00ab8000)
librt.so.1 => /lib/librt.so.1 (0x0072a000)
libc.so.6 => /lib/libc.so.6 (0x008f7000)
/lib/ld-linux.so.2 (0x00ebd000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00619000)
src/lib-ssl-iostream/.libs/libdovecot-ssl.so:
linux-gate.so.1 => (0x00da6000)
libcrypto.so.1.0.0 => not found
libssl.so.1.0.0 => not found
libdl.so.2 => /lib/libdl.so.2 (0x00df0000)
librt.so.1 => /lib/librt.so.1 (0x00112000)
libc.so.6 => /lib/libc.so.6 (0x00b5e000)
/lib/ld-linux.so.2 (0x00e76000)
libpthread.so.0 => /lib/libpthread.so.0 (0x005a6000)
src/lib-storage/.libs/libdovecot-storage.so:
linux-gate.so.1 => (0x006ed000)
libcrypto.so.1.0.0 => not found
libssl.so.1.0.0 => not found
libdovecot.so.0 => /usr/local/src/dovecot-2.1.1/src/lib-dovecot/.libs/libdovecot.so.0 (0x00c66000)
libdl.so.2 => /lib/libdl.so.2 (0x00491000)
librt.so.1 => /lib/librt.so.1 (0x00be2000)
libc.so.6 => /lib/libc.so.6 (0x00110000)
/lib/ld-linux.so.2 (0x0036b000)
libpthread.so.0 => /lib/libpthread.so.0 (0x0029a000)
Without SSL_CFLAGS and SSL_LIBS but just PKG_CONFIG_PATH,
it also won't work.
Help appreciated ... Andreas
More information about the dovecot
mailing list