From: Timo Sirainen Date: Tue, 14 Apr 2009 17:09:21 +0000 (-0400) Subject: Added configure --without-shared-libs to link built binaries against static libraries. X-Git-Tag: 2.0.alpha1~948 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8dec8eab222cb7a0b4ef5e066cb1d7dac8a526d1;p=thirdparty%2Fdovecot%2Fcore.git 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. --HG-- branch : HEAD --- diff --git a/configure.in b/configure.in index 418f1b4582..41ff76ce50 100644 --- a/configure.in +++ b/configure.in @@ -46,6 +46,12 @@ AC_ARG_ENABLE(asserts, 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, @@ -2216,6 +2222,26 @@ done AC_SUBST(LINKED_STORAGE_LIBS) 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 ** diff --git a/src/auth/Makefile.am b/src/auth/Makefile.am index 6528609efe..349879f303 100644 --- a/src/auth/Makefile.am +++ b/src/auth/Makefile.am @@ -41,8 +41,9 @@ dovecot_auth_LDADD = \ 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 @@ else noinst_HEADERS = $(headers) endif -checkpassword_reply_LDADD = \ - ../lib-dovecot/libdovecot.la +checkpassword_reply_LDADD = $(LIBDOVECOT) checkpassword_reply_sources = \ checkpassword-reply.c diff --git a/src/config/Makefile.am b/src/config/Makefile.am index 5453112e77..59af4b56f6 100644 --- a/src/config/Makefile.am +++ b/src/config/Makefile.am @@ -10,7 +10,8 @@ AM_CPPFLAGS = \ -DSSLDIR=\""$(ssldir)\"" doveconf_LDADD = \ - ../lib-dovecot/libdovecot.la \ + $(LIBDOVECOT) \ + $(MODULE_LIBS) \ $(RAND_LIBS) doveconf_SOURCES = \ diff --git a/src/dict/Makefile.am b/src/dict/Makefile.am index 7f91ce49a8..46b127db9a 100644 --- a/src/dict/Makefile.am +++ b/src/dict/Makefile.am @@ -13,11 +13,12 @@ dict_LDFLAGS = -export-dynamic 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) diff --git a/src/imap-login/Makefile.am b/src/imap-login/Makefile.am index 9ac9aae2b4..6b8c08df77 100644 --- a/src/imap-login/Makefile.am +++ b/src/imap-login/Makefile.am @@ -9,8 +9,8 @@ AM_CPPFLAGS = \ -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 \ diff --git a/src/imap/Makefile.am b/src/imap/Makefile.am index 8322546c57..1f4ebee7d9 100644 --- a/src/imap/Makefile.am +++ b/src/imap/Makefile.am @@ -15,12 +15,10 @@ AM_CPPFLAGS = \ imap_LDFLAGS = -export-dynamic libs = \ - ../lib-storage/libdovecot-storage.la \ - ../lib-dovecot/libdovecot.la - -imap_LDADD = \ - $(libs) + $(LIBDOVECOT_STORAGE) \ + $(LIBDOVECOT) +imap_LDADD = $(libs) $(MODULE_LIBS) imap_DEPENDENCIES = $(libs) cmds = \ diff --git a/src/lda/Makefile.am b/src/lda/Makefile.am index 3eae845cd9..a56d674daf 100644 --- a/src/lda/Makefile.am +++ b/src/lda/Makefile.am @@ -19,10 +19,10 @@ dovecot_lda_LDFLAGS = -export-dynamic 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) diff --git a/src/lib-dovecot/Makefile.am b/src/lib-dovecot/Makefile.am index 83894b1c6f..be5e28e9a3 100644 --- a/src/lib-dovecot/Makefile.am +++ b/src/lib-dovecot/Makefile.am @@ -1,7 +1,3 @@ -pkglib_LTLIBRARIES = libdovecot.la - -libdovecot_la_SOURCES = - libs = \ ../lib-settings/libsettings.la \ ../lib-dict/libdict.la \ @@ -12,6 +8,10 @@ libs = \ ../lib-master/libmaster.la \ ../lib/liblib.la +pkglib_LTLIBRARIES = libdovecot.la + +libdovecot_la_SOURCES = + libdovecot_la_LIBADD = \ $(libs) \ $(MODULE_LIBS) \ diff --git a/src/lib-storage/Makefile.am b/src/lib-storage/Makefile.am index 4abc221710..80068a2bd8 100644 --- a/src/lib-storage/Makefile.am +++ b/src/lib-storage/Makefile.am @@ -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 @@ AM_CPPFLAGS = \ -DPKG_RUNDIR=\""$(rundir)"\" \ -DMODULEDIR=\""$(moduledir)"\" -libdovecot_storage_la_SOURCES = \ +libstorage_la_SOURCES = \ mail.c \ mail-copy.c \ mail-error.c \ @@ -36,10 +36,8 @@ libs = \ 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 @@ headers = \ 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) diff --git a/src/login-common/Makefile.am b/src/login-common/Makefile.am index 286136efa3..2895df9d2f 100644 --- a/src/login-common/Makefile.am +++ b/src/login-common/Makefile.am @@ -1,4 +1,4 @@ -pkglib_LTLIBRARIES = libdovecot-login.la +noinst_LTLIBRARIES = liblogin.la AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib \ @@ -9,7 +9,7 @@ AM_CPPFLAGS = \ -DSBINDIR=\""$(sbindir)"\" \ -DSSLDIR=\""$(ssldir)\"" -libdovecot_login_la_SOURCES = \ +liblogin_la_SOURCES = \ client-common.c \ login-proxy.c \ login-settings.c \ @@ -20,7 +20,7 @@ libdovecot_login_la_SOURCES = \ ssl-proxy-gnutls.c \ ssl-proxy-openssl.c -libdovecot_login_la_LIBADD = \ +liblogin_la_LIBADD = \ $(SSL_LIBS) noinst_HEADERS = \ @@ -31,3 +31,9 @@ noinst_HEADERS = \ 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 diff --git a/src/master/Makefile.am b/src/master/Makefile.am index c3306f90c1..efa9d0140c 100644 --- a/src/master/Makefile.am +++ b/src/master/Makefile.am @@ -16,7 +16,7 @@ AM_CPPFLAGS = \ dovecot_LDADD = \ $(LIBCAP) \ - ../lib-dovecot/libdovecot.la + $(LIBDOVECOT) dovecot_SOURCES = \ auth-process.c \ @@ -57,6 +57,6 @@ ssl_build_param_SOURCES = \ ssl-init-gnutls.c ssl_build_param_LDADD = \ - ../lib-dovecot/libdovecot.la \ + $(LIBDOVECOT) \ $(SSL_LIBS) diff --git a/src/plugins/convert/Makefile.am b/src/plugins/convert/Makefile.am index 5a25bf63b7..a7a504503e 100644 --- a/src/plugins/convert/Makefile.am +++ b/src/plugins/convert/Makefile.am @@ -30,10 +30,11 @@ common_objects = \ 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) diff --git a/src/plugins/expire/Makefile.am b/src/plugins/expire/Makefile.am index 0877b17bfe..3775c3868c 100644 --- a/src/plugins/expire/Makefile.am +++ b/src/plugins/expire/Makefile.am @@ -32,9 +32,9 @@ expire_tool_SOURCES = \ expire-tool.c libs = \ - $(top_builddir)/src/lib-storage/libdovecot-storage.la \ - $(top_builddir)/src/lib-dovecot/libdovecot.la - -expire_tool_LDADD = $(libs) expire-env.o + expire-env.o \ + $(LIBDOVECOT_STORAGE) \ + $(LIBDOVECOT) +expire_tool_LDADD = $(libs) $(MODULE_LIBS) expire_tool_DEPENDENCIES = $(libs) diff --git a/src/plugins/fts-squat/Makefile.am b/src/plugins/fts-squat/Makefile.am index 1054dcb49f..8d5f6c04d7 100644 --- a/src/plugins/fts-squat/Makefile.am +++ b/src/plugins/fts-squat/Makefile.am @@ -32,8 +32,8 @@ common_objects = \ 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) \ diff --git a/src/pop3-login/Makefile.am b/src/pop3-login/Makefile.am index bdc7bc1423..b7d5c66030 100644 --- a/src/pop3-login/Makefile.am +++ b/src/pop3-login/Makefile.am @@ -8,8 +8,8 @@ AM_CPPFLAGS = \ -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 \ diff --git a/src/pop3/Makefile.am b/src/pop3/Makefile.am index fbeb0198da..c64e5bff58 100644 --- a/src/pop3/Makefile.am +++ b/src/pop3/Makefile.am @@ -13,11 +13,10 @@ AM_CPPFLAGS = \ pop3_LDFLAGS = -export-dynamic libs = \ - ../lib-storage/libdovecot-storage.la \ - ../lib-dovecot/libdovecot.la - -pop3_LDADD = $(libs) + $(LIBDOVECOT_STORAGE) \ + $(LIBDOVECOT) +pop3_LDADD = $(libs) $(MODULE_LIBS) pop3_DEPENDENCIES = $(libs) pop3_SOURCES = \ diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 6ed5f50031..7a5cd04ea2 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -18,7 +18,7 @@ test_lib_SOURCES = \ test_lib_LDADD = \ libtest.a \ - ../lib-dovecot/libdovecot.la + $(LIBDOVECOT) test_mail_SOURCES = \ test-mail.c @@ -32,8 +32,8 @@ noinst_HEADERS = \ test_mail_LDADD = \ libtest.a \ - ../lib-dovecot/libdovecot.la + $(LIBDOVECOT) test_imap_LDADD = \ libtest.a \ - ../lib-dovecot/libdovecot.la + $(LIBDOVECOT) diff --git a/src/util/Makefile.am b/src/util/Makefile.am index 968626a925..c5a58002d7 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -23,44 +23,37 @@ AM_CPPFLAGS = \ -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 @@ dovecotpw_LDADD = \ ../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