changeset 9104:c6d306772f4e HEAD

Added configure --without-shared-libs to link built binaries against static libraries. The libraries are still built and installed, so this is mainly useful for making life easier for developers.
author Timo Sirainen <tss@iki.fi>
date Tue, 14 Apr 2009 13:09:21 -0400
parents 5c12eac2c3ca
children fdbc1902b4a9
files configure.in src/auth/Makefile.am src/config/Makefile.am src/dict/Makefile.am src/imap-login/Makefile.am src/imap/Makefile.am src/lda/Makefile.am src/lib-dovecot/Makefile.am src/lib-storage/Makefile.am src/login-common/Makefile.am src/master/Makefile.am src/plugins/convert/Makefile.am src/plugins/expire/Makefile.am src/plugins/fts-squat/Makefile.am src/pop3-login/Makefile.am src/pop3/Makefile.am src/tests/Makefile.am src/util/Makefile.am
diffstat 18 files changed, 98 insertions(+), 68 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Mon Apr 13 20:15:14 2009 -0400
+++ b/configure.in	Tue Apr 14 13:09:21 2009 -0400
@@ -46,6 +46,12 @@
 		AC_DEFINE(DISABLE_ASSERTS,, Disable asserts)
 	fi)
 
+AC_ARG_WITH(shared-libs,
+[  --with-shared-libs      Link binaries using shared Dovecot libraries (default)],
+	want_shared_libs=$withval,
+	want_shared_libs=yes)
+AM_CONDITIONAL(BUILD_SHARED_LIBS, test "$want_shared_libs" = "yes")
+
 AC_ARG_WITH(mem-align,
 [  --with-mem-align=BYTES  Set the memory alignment (default: 8)],
 	mem_align=$withval,
@@ -2217,6 +2223,26 @@
 AC_DEFINE_UNQUOTED(MAIL_STORAGES, "$mail_storages", List of compiled in mail storages)
 
 dnl **
+dnl ** Shared libraries usage
+dnl **
+
+if test "$want_shared_libs" = "yes"; then
+  LIBDOVECOT='$(top_builddir)/src/lib-dovecot/libdovecot.la'
+  LIBDOVECOT_STORAGE='$(top_builddir)/src/lib-storage/libdovecot-storage.la'
+  LIBDOVECOT_LOGIN='$(top_builddir)/src/login-common/libdovecot-login.la'
+else
+  LIBDOVECOT='$(top_builddir)/src/lib-settings/libsettings.la $(top_builddir)/src/lib-dict/libdict.la $(top_builddir)/src/lib-imap/libimap.la $(top_builddir)/src/lib-mail/libmail.la $(top_builddir)/src/lib-auth/libauth.la $(top_builddir)/src/lib-charset/libcharset.la $(top_builddir)/src/lib-master/libmaster.la $(top_builddir)/src/lib/liblib.la $(LIBICONV)'
+  LIBDOVECOT_STORAGE_BASE='$(top_builddir)/src/lib-storage/libstorage.la $(top_builddir)/src/lib-storage/register/libstorage_register.la $(top_builddir)/src/lib-storage/list/libstorage_list.la $(top_builddir)/src/lib-storage/index/libstorage_index.la $(top_builddir)/src/lib-index/libindex.la'
+  LIBDOVECOT_STORAGE="$LINKED_STORAGE_LIBS $LIBDOVECOT_STORAGE_BASE"
+  LIBDOVECOT_LOGIN='$(top_builddir)/src/login-common/liblogin.la'
+fi
+LIBDOVECOT_SQL='$(top_builddir)/src/lib-sql/libsql.la'
+AC_SUBST(LIBDOVECOT)
+AC_SUBST(LIBDOVECOT_STORAGE)
+AC_SUBST(LIBDOVECOT_LOGIN)
+AC_SUBST(LIBDOVECOT_SQL)
+
+dnl **
 dnl ** SQL drivers
 dnl **
 
--- a/src/auth/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/auth/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -41,8 +41,9 @@
 	libpassword.a \
 	../lib-ntlm/libntlm.a \
 	../lib-otp/libotp.a \
-	../lib-sql/libsql.la \
-	../lib-dovecot/libdovecot.la \
+	$(LIBDOVECOT_SQL) \
+	$(LIBDOVECOT) \
+	$(MODULE_LIBS) \
 	$(AUTH_LIBS)
 
 ldap_sources = db-ldap.c passdb-ldap.c userdb-ldap.c
@@ -155,8 +156,7 @@
   noinst_HEADERS = $(headers)
 endif
 
-checkpassword_reply_LDADD = \
-	../lib-dovecot/libdovecot.la
+checkpassword_reply_LDADD = $(LIBDOVECOT)
 
 checkpassword_reply_sources = \
 	checkpassword-reply.c
--- a/src/config/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/config/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -10,7 +10,8 @@
 	-DSSLDIR=\""$(ssldir)\""
 
 doveconf_LDADD = \
-	../lib-dovecot/libdovecot.la \
+	$(LIBDOVECOT) \
+	$(MODULE_LIBS) \
 	$(RAND_LIBS)
 
 doveconf_SOURCES = \
--- a/src/dict/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/dict/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -13,11 +13,12 @@
 
 libs = \
 	../lib-dict/libdict_backend.a \
-	../lib-sql/libsql.la \
-	../lib-dovecot/libdovecot.la
+	$(LIBDOVECOT_SQL) \
+	$(LIBDOVECOT)
 
 dict_LDADD = \
 	$(libs) \
+	$(MODULE_LIBS) \
 	$(DICT_LIBS) \
 	$(SQL_LIBS)
 
--- a/src/imap-login/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/imap-login/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -9,8 +9,8 @@
 	-I$(top_srcdir)/src/login-common
 
 imap_login_LDADD = \
-	../login-common/libdovecot-login.la \
-	../lib-dovecot/libdovecot.la
+	$(LIBDOVECOT_LOGIN) \
+	$(LIBDOVECOT)
 
 imap_login_SOURCES = \
 	client.c \
--- a/src/imap/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/imap/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -15,12 +15,10 @@
 imap_LDFLAGS = -export-dynamic
 
 libs = \
-	../lib-storage/libdovecot-storage.la \
-	../lib-dovecot/libdovecot.la
+	$(LIBDOVECOT_STORAGE) \
+	$(LIBDOVECOT)
 
-imap_LDADD = \
-	$(libs)
-
+imap_LDADD = $(libs) $(MODULE_LIBS)
 imap_DEPENDENCIES = $(libs)
 
 cmds = \
--- a/src/lda/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/lda/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -19,10 +19,10 @@
 
 libs = \
 	../lib-lda/liblda.a \
-	../lib-storage/libdovecot-storage.la \
-	../lib-dovecot/libdovecot.la
+	$(LIBDOVECOT_STORAGE) \
+	$(LIBDOVECOT)
 
-dovecot_lda_LDADD = $(libs)
+dovecot_lda_LDADD = $(libs) $(MODULE_LIBS)
 
 dovecot_lda_DEPENDENCIES = $(libs)
 
--- a/src/lib-dovecot/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/lib-dovecot/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -1,7 +1,3 @@
-pkglib_LTLIBRARIES = libdovecot.la
-
-libdovecot_la_SOURCES = 
-
 libs = \
 	../lib-settings/libsettings.la \
 	../lib-dict/libdict.la \
@@ -12,6 +8,10 @@
 	../lib-master/libmaster.la \
 	../lib/liblib.la
 
+pkglib_LTLIBRARIES = libdovecot.la
+
+libdovecot_la_SOURCES = 
+
 libdovecot_la_LIBADD = \
 	$(libs) \
 	$(MODULE_LIBS) \
--- a/src/lib-storage/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/lib-storage/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -1,6 +1,6 @@
 SUBDIRS = list index register
 
-pkglib_LTLIBRARIES = libdovecot-storage.la
+noinst_LTLIBRARIES = libstorage.la
 
 AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/lib \
@@ -14,7 +14,7 @@
 	-DPKG_RUNDIR=\""$(rundir)"\" \
 	-DMODULEDIR=\""$(moduledir)"\"
 
-libdovecot_storage_la_SOURCES = \
+libstorage_la_SOURCES = \
 	mail.c \
 	mail-copy.c \
 	mail-error.c \
@@ -36,10 +36,8 @@
 	index/libstorage_index.la \
 	register/libstorage_register.la	
 
-libdovecot_storage_la_LIBADD = $(libs)
-libdovecot_storage_la_DEPENDENCIES = $(libs)
-
-libdovecot_storage_la_LDFLAGS = -export-dynamic
+libstorage_la_LIBADD = $(libs)
+libstorage_la_DEPENDENCIES = $(libs)
 
 headers = \
 	mail-copy.h \
@@ -59,6 +57,12 @@
 	mailbox-tree.h \
 	mailbox-uidvalidity.h
 
+pkglib_LTLIBRARIES = libdovecot-storage.la
+libdovecot_storage_la_SOURCES = 
+libdovecot_storage_la_LIBADD = libstorage.la
+libdovecot_storage_la_DEPENDENCIES = libstorage.la
+libdovecot_storage_la_LDFLAGS = -export-dynamic
+
 if INSTALL_HEADERS
   pkginc_libdir=$(pkgincludedir)/src/lib-storage
   pkginc_lib_HEADERS = $(headers)
--- a/src/login-common/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/login-common/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -1,4 +1,4 @@
-pkglib_LTLIBRARIES = libdovecot-login.la
+noinst_LTLIBRARIES = liblogin.la
 
 AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/lib \
@@ -9,7 +9,7 @@
 	-DSBINDIR=\""$(sbindir)"\" \
 	-DSSLDIR=\""$(ssldir)\""
 
-libdovecot_login_la_SOURCES = \
+liblogin_la_SOURCES = \
 	client-common.c \
 	login-proxy.c \
 	login-settings.c \
@@ -20,7 +20,7 @@
 	ssl-proxy-gnutls.c \
 	ssl-proxy-openssl.c
 
-libdovecot_login_la_LIBADD = \
+liblogin_la_LIBADD = \
 	$(SSL_LIBS)
 
 noinst_HEADERS = \
@@ -31,3 +31,9 @@
 	master.h \
 	sasl-server.h \
 	ssl-proxy.h
+
+pkglib_LTLIBRARIES = libdovecot-login.la
+libdovecot_login_la_SOURCES = 
+libdovecot_login_la_LIBADD = liblogin.la
+libdovecot_login_la_DEPENDENCIES = liblogin.la
+libdovecot_login_la_LDFLAGS = -export-dynamic
--- a/src/master/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/master/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -16,7 +16,7 @@
 
 dovecot_LDADD = \
 	$(LIBCAP) \
-	../lib-dovecot/libdovecot.la
+	$(LIBDOVECOT)
 
 dovecot_SOURCES = \
 	auth-process.c \
@@ -57,6 +57,6 @@
 	ssl-init-gnutls.c
 
 ssl_build_param_LDADD = \
-	../lib-dovecot/libdovecot.la \
+	$(LIBDOVECOT) \
 	$(SSL_LIBS)
 
--- a/src/plugins/convert/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/plugins/convert/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -30,10 +30,11 @@
 	convert-storage.lo
 
 libs = \
-	$(top_builddir)/src/lib-storage/libdovecot-storage.la \
-	$(top_builddir)/src/lib-dovecot/libdovecot.la
+	$(LIBDOVECOT_STORAGE) \
+	$(LIBDOVECOT)
 
 convert_tool_LDADD = \
+	$(MODULE_LIBS) \
 	$(common_objects) \
 	$(libs)
 
--- a/src/plugins/expire/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/plugins/expire/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -32,9 +32,9 @@
 	expire-tool.c
 
 libs = \
-	$(top_builddir)/src/lib-storage/libdovecot-storage.la \
-	$(top_builddir)/src/lib-dovecot/libdovecot.la
+	expire-env.o \
+	$(LIBDOVECOT_STORAGE) \
+	$(LIBDOVECOT)
 
-expire_tool_LDADD = $(libs) expire-env.o
-
+expire_tool_LDADD = $(libs) $(MODULE_LIBS)
 expire_tool_DEPENDENCIES = $(libs)
--- a/src/plugins/fts-squat/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/plugins/fts-squat/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -32,8 +32,8 @@
 	squat-uidlist.lo
 
 libs = \
-	$(top_builddir)/src/lib-storage/libdovecot-storage.la \
-	$(top_builddir)/src/lib-dovecot/libdovecot.la
+	$(LIBDOVECOT_STORAGE) \
+	$(LIBDOVECOT)
 
 squat_test_LDADD = \
 	$(common_objects) \
--- a/src/pop3-login/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/pop3-login/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -8,8 +8,8 @@
 	-I$(top_srcdir)/src/login-common
 
 pop3_login_LDADD = \
-	../login-common/libdovecot-login.la \
-	../lib-dovecot/libdovecot.la
+	$(LIBDOVECOT_LOGIN) \
+	$(LIBDOVECOT)
 
 pop3_login_SOURCES = \
 	client.c \
--- a/src/pop3/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/pop3/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -13,11 +13,10 @@
 pop3_LDFLAGS = -export-dynamic
 
 libs = \
-	../lib-storage/libdovecot-storage.la \
-	../lib-dovecot/libdovecot.la
+	$(LIBDOVECOT_STORAGE) \
+	$(LIBDOVECOT)
 
-pop3_LDADD = $(libs)
-
+pop3_LDADD = $(libs) $(MODULE_LIBS)
 pop3_DEPENDENCIES = $(libs)
 
 pop3_SOURCES = \
--- a/src/tests/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/tests/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -18,7 +18,7 @@
 
 test_lib_LDADD = \
 	libtest.a \
-	../lib-dovecot/libdovecot.la
+	$(LIBDOVECOT)
 
 test_mail_SOURCES = \
 	test-mail.c
@@ -32,8 +32,8 @@
 
 test_mail_LDADD = \
 	libtest.a \
-	../lib-dovecot/libdovecot.la
+	$(LIBDOVECOT)
 
 test_imap_LDADD = \
 	libtest.a \
-	../lib-dovecot/libdovecot.la
+	$(LIBDOVECOT)
--- a/src/util/Makefile.am	Mon Apr 13 20:15:14 2009 -0400
+++ b/src/util/Makefile.am	Tue Apr 14 13:09:21 2009 -0400
@@ -23,44 +23,37 @@
 	-I$(top_srcdir)/src/lib-storage \
 	-I$(top_srcdir)/src/auth
 
-rawlog_LDADD = \
-	../lib-dovecot/libdovecot.la
+rawlog_LDADD = $(LIBDOVECOT)
 rawlog_SOURCES = \
 	rawlog.c
 
-gdbhelper_LDADD = \
-	../lib-dovecot/libdovecot.la
+gdbhelper_LDADD = $(LIBDOVECOT)
 gdbhelper_SOURCES = \
 	gdbhelper.c
 
 idxview_LDADD = \
-	../lib-dovecot/libdovecot.la \
-	../lib-storage/libdovecot-storage.la
+	$(LIBDOVECOT_STORAGE) \
+	$(LIBDOVECOT)
 idxview_SOURCES = \
 	idxview.c
 
-imap_utf7_LDADD = \
-	../lib-dovecot/libdovecot.la
+imap_utf7_LDADD = $(LIBDOVECOT)
 imap_utf7_SOURCES = \
 	imap-utf7.c
 
-listview_LDADD = \
-	../lib-dovecot/libdovecot.la
+listview_LDADD = $(LIBDOVECOT)
 listview_SOURCES = \
 	listview.c
 
-logview_LDADD = \
-	../lib-dovecot/libdovecot.la
+logview_LDADD = $(LIBDOVECOT)
 logview_SOURCES = \
 	logview.c
 
-maildirlock_LDADD = \
-	../lib-dovecot/libdovecot.la
+maildirlock_LDADD = $(LIBDOVECOT)
 maildirlock_SOURCES = \
 	maildirlock.c
 
-threadview_LDADD = \
-	../lib-dovecot/libdovecot.la
+threadview_LDADD = $(LIBDOVECOT)
 threadview_SOURCES = \
 	threadview.c
 
@@ -68,15 +61,16 @@
 	../auth/libpassword.a \
 	../lib-ntlm/libntlm.a \
 	../lib-otp/libotp.a \
-	../lib-dovecot/libdovecot.la \
+	$(LIBDOVECOT) \
 	$(AUTH_LIBS)
 
 dovecotpw_SOURCES = \
 	dovecotpw.c
 
 doveadm_LDADD = \
-	../lib-dovecot/libdovecot.la \
-	../lib-storage/libdovecot-storage.la
+	$(LIBDOVECOT_STORAGE) \
+	$(LIBDOVECOT) \
+	$(MODULE_LIBS)
 doveadm_SOURCES = \
 	doveadm.c