dovecot-2.2: --without-shared-libs: Link Dovecot libraries with ...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Oct 12 03:08:37 EEST 2012
details: http://hg.dovecot.org/dovecot-2.2/rev/b0c7d2f8a185
changeset: 15205:b0c7d2f8a185
user: Timo Sirainen <tss at iki.fi>
date: Fri Oct 12 03:08:13 2012 +0300
description:
--without-shared-libs: Link Dovecot libraries with --whole-archive flag for binaries.
This removes the need for the ugly unused_objects lists for binaries, which
were needed to avoid plugins from failing because they were missing some
functions.
Apparently there's no easy way to use --whole-archive properly with libtool,
so there's now a rather ugly cc-wrapper.sh that does it. Also this is done
only when GNU ld is deted. Most people are going to use --with-shared-libs
though, so I don't think any of this is going to be a real problem.
diffstat:
.hgignore | 1 +
cc-wrapper.sh.in | 8 ++++++++
configure.in | 9 +++++++++
src/doveadm/Makefile.am | 9 +--------
src/indexer/Makefile.am | 8 --------
src/lda/Makefile.am | 15 ++-------------
src/lmtp/Makefile.am | 17 ++---------------
src/pop3/Makefile.am | 8 --------
8 files changed, 23 insertions(+), 52 deletions(-)
diffs (175 lines):
diff -r c30673b5ec1b -r b0c7d2f8a185 .hgignore
--- a/.hgignore Fri Oct 12 02:59:59 2012 +0300
+++ b/.hgignore Fri Oct 12 03:08:13 2012 +0300
@@ -1,6 +1,7 @@
syntax: glob
aclocal.m4
autom4te.cache
+cc-wrapper.sh
compile
config.cache
config.guess
diff -r c30673b5ec1b -r b0c7d2f8a185 cc-wrapper.sh.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cc-wrapper.sh.in Fri Oct 12 03:08:13 2012 +0300
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+if echo "$*" | grep -- -ldl > /dev/null; then
+ # the binary uses plugins. make sure we include everything from .a libs
+ exec @CC@ -Wl,--whole-archive $* -Wl,--no-whole-archive
+else
+ exec @CC@ $*
+fi
diff -r c30673b5ec1b -r b0c7d2f8a185 configure.in
--- a/configure.in Fri Oct 12 02:59:59 2012 +0300
+++ b/configure.in Fri Oct 12 03:08:13 2012 +0300
@@ -2723,6 +2723,15 @@
LDFLAGS="\$(NOPLUGIN_LDFLAGS) $LDFLAGS"
AC_SUBST(NOPLUGIN_LDFLAGS)
+if test "$with_gnu_ld" = yes -a "$want_shared_libs" = "no"; then
+ # libtool can't handle using whole-archive flags, so we need to do this
+ # with a CC wrapper.. shouldn't be much of a problem, since most people
+ # are building with shared libs.
+ sed "s/@CC@/$CC/" < $srcdir/cc-wrapper.sh.in > cc-wrapper.sh
+ chmod +x cc-wrapper.sh
+ CC=`pwd`/cc-wrapper.sh
+fi
+
if test "$docdir" = ""; then
dnl docdir supported only by autoconf v2.59c and later
docdir='${datadir}/doc/${PACKAGE_TARNAME}'
diff -r c30673b5ec1b -r b0c7d2f8a185 src/doveadm/Makefile.am
--- a/src/doveadm/Makefile.am Fri Oct 12 02:59:59 2012 +0300
+++ b/src/doveadm/Makefile.am Fri Oct 12 03:08:13 2012 +0300
@@ -26,20 +26,13 @@
-DBINDIR=\""$(bindir)"\" \
-DMANDIR=\""$(mandir)"\"
-if !BUILD_SHARED_LIBS
-unused_objects = \
- ../lib-imap/imap-util.o \
- ../lib-storage/mail-search-parser-imap.o
-endif
-
cmd_pw_libs = \
../auth/libpassword.a \
../lib-ntlm/libntlm.a \
../lib-otp/libotp.a
libs = \
- dsync/libdsync.la \
- $(unused_objects)
+ dsync/libdsync.la
doveadm_LDADD = \
$(libs) \
diff -r c30673b5ec1b -r b0c7d2f8a185 src/indexer/Makefile.am
--- a/src/indexer/Makefile.am Fri Oct 12 02:59:59 2012 +0300
+++ b/src/indexer/Makefile.am Fri Oct 12 03:08:13 2012 +0300
@@ -21,19 +21,11 @@
worker-connection.c \
worker-pool.c
-if !BUILD_SHARED_LIBS
-unused_objects = \
- ../lib-imap/imap-util.o \
- ../lib-storage/mail-search-parser-imap.o
-endif
-
indexer_worker_LDADD = \
- $(unused_objects) \
$(LIBDOVECOT_STORAGE) \
$(LIBDOVECOT) \
$(MODULE_LIBS)
indexer_worker_DEPENDENCIES = \
- $(unused_objects) \
$(LIBDOVECOT_STORAGE_DEPS) \
$(LIBDOVECOT_DEPS)
indexer_worker_SOURCES = \
diff -r c30673b5ec1b -r b0c7d2f8a185 src/lda/Makefile.am
--- a/src/lda/Makefile.am Fri Oct 12 02:59:59 2012 +0300
+++ b/src/lda/Makefile.am Fri Oct 12 03:08:13 2012 +0300
@@ -16,24 +16,13 @@
dovecot_lda_LDFLAGS = -export-dynamic
-if !BUILD_SHARED_LIBS
-unused_objects = \
- ../lib-mail/message-header-encode.o \
- ../lib-imap/imap-util.o \
- ../lib-storage/mail-search-parser-imap.o
-endif
-
-libs = \
- $(unused_objects) \
- $(LIBDOVECOT_LDA)
-
dovecot_lda_LDADD = \
- $(libs) \
+ $(LIBDOVECOT_LDA) \
$(LIBDOVECOT_STORAGE) \
$(LIBDOVECOT) \
$(MODULE_LIBS)
dovecot_lda_DEPENDENCIES = \
- $(libs) \
+ $(LIBDOVECOT_LDA) \
$(LIBDOVECOT_STORAGE_DEPS) \
$(LIBDOVECOT_DEPS)
diff -r c30673b5ec1b -r b0c7d2f8a185 src/lmtp/Makefile.am
--- a/src/lmtp/Makefile.am Fri Oct 12 02:59:59 2012 +0300
+++ b/src/lmtp/Makefile.am Fri Oct 12 03:08:13 2012 +0300
@@ -17,26 +17,13 @@
lmtp_LDFLAGS = -export-dynamic
-if !BUILD_SHARED_LIBS
-unused_objects = \
- ../lib-mail/message-header-encode.o \
- ../lib-imap/imap-util.o \
- ../lib-storage/mail-search-parser-imap.o \
- ../lib-lda/smtp-client.o \
- ../lib-lda/mail-send.o
-endif
-
-libs = \
- $(unused_objects) \
- $(LIBDOVECOT_LDA)
-
lmtp_LDADD = \
- $(libs) \
+ $(LIBDOVECOT_LDA) \
$(LIBDOVECOT_STORAGE) \
$(LIBDOVECOT) \
$(MODULE_LIBS)
lmtp_DEPENDENCIES = \
- $(libs) \
+ $(LIBDOVECOT_LDA) \
$(LIBDOVECOT_STORAGE_DEPS) \
$(LIBDOVECOT_DEPS)
diff -r c30673b5ec1b -r b0c7d2f8a185 src/pop3/Makefile.am
--- a/src/pop3/Makefile.am Fri Oct 12 02:59:59 2012 +0300
+++ b/src/pop3/Makefile.am Fri Oct 12 03:08:13 2012 +0300
@@ -12,19 +12,11 @@
pop3_LDFLAGS = -export-dynamic
-if !BUILD_SHARED_LIBS
-unused_objects = \
- ../lib-imap/imap-util.o \
- ../lib-storage/mail-search-parser-imap.o
-endif
-
pop3_LDADD = \
- $(unused_objects) \
$(LIBDOVECOT_STORAGE) \
$(LIBDOVECOT) \
$(MODULE_LIBS)
pop3_DEPENDENCIES = \
- $(unused_objects) \
$(LIBDOVECOT_STORAGE_DEPS) \
$(LIBDOVECOT_DEPS)
More information about the dovecot-cvs
mailing list