From: Timo Sirainen Date: Sun, 27 Apr 2003 20:02:06 +0000 (+0300) Subject: --with-storage=maildir,mbox can now be used to compile in only the wanted X-Git-Tag: 1.1.alpha1~4702 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9bfb1bd23d31f3032d5bd843ffbcc2ccd5cb3a6;p=thirdparty%2Fdovecot%2Fcore.git --with-storage=maildir,mbox can now be used to compile in only the wanted storage formats. --HG-- branch : HEAD --- diff --git a/configure.in b/configure.in index 2074733356..a9cc436821 100644 --- a/configure.in +++ b/configure.in @@ -181,6 +181,11 @@ AC_ARG_WITH(pop3d, want_pop3d=yes) AM_CONDITIONAL(BUILD_POP3D, test "$want_pop3d" = "yes") +AC_ARG_WITH(storages, +[ --with-storages Build specified mail storage formats (maildir,mbox)], [ + mail_storages=`echo "$withval"|sed 's/,/ /g'` ], + mail_storages="maildir mbox") + dnl * gcc specific options if test "x$ac_cv_prog_gcc" = "xyes"; then # -Wcast-qual -Wcast-align -Wconversion # too many warnings @@ -957,6 +962,22 @@ if test "x$want_ipv6" = "xyes"; then AC_MSG_RESULT($i_cv_type_in6_addr) fi +dnl ** +dnl ** storage classes +dnl ** + +maildir_libs="../lib-storage/index/maildir/libstorage_maildir.a ../lib-index/maildir/libstorage_index_maildir.a" +mbox_libs="../lib-storage/index/mbox/libstorage_mbox.a ../lib-index/mbox/libstorage_index_mbox.a" +index_libs="../lib-storage/index/libstorage_index.a ../lib-index/libindex.a" + +STORAGE_LIBS= +for storage in $mail_storages; do + STORAGE_LIBS="$STORAGE_LIBS `eval \"echo \\$${storage}_libs\"`" +done +STORAGE_LIBS="$STORAGE_LIBS $index_libs" +AC_SUBST(STORAGE_LIBS) + + dnl ** dnl ** capabilities dnl ** @@ -1000,17 +1021,16 @@ dnl ** dnl * do it after AC_OUTPUT(), so we know that the directory exists. dnl * it doesn't when building in different directory -STORAGE="maildir mbox" file="src/lib-storage/register/mail-storage-register.c" echo "/* this file is generated by configure */" > $file echo '#include "lib.h"' >> $file echo '#include "mail-storage.h"' >> $file -for storage in $STORAGE; do +for storage in $mail_storages; do echo "extern struct mail_storage ${storage}_storage;" >> $file done echo "void mail_storage_register_all(void) {" >> $file -for storage in $STORAGE; do +for storage in $mail_storages; do echo "mail_storage_class_register(&${storage}_storage);" >> $file done echo "}" >> $file diff --git a/src/imap/Makefile.am b/src/imap/Makefile.am index e9955765dc..81f3c87341 100644 --- a/src/imap/Makefile.am +++ b/src/imap/Makefile.am @@ -10,13 +10,8 @@ INCLUDES = \ imap_LDADD = \ ../lib-storage/register/libstorage-register.a \ - ../lib-storage/index/maildir/libstorage_maildir.a \ - ../lib-storage/index/mbox/libstorage_mbox.a \ - ../lib-storage/index/libstorage_index.a \ + $(STORAGE_LIBS) \ ../lib-storage/libstorage.a \ - ../lib-index/maildir/libstorage_index_maildir.a \ - ../lib-index/mbox/libstorage_index_mbox.a \ - ../lib-index/libstorage_index.a \ ../lib-storage/subscription-file/libstorage_subscription_file.a \ ../lib-imap/libimap.a \ ../lib-mail/libmail.a \ diff --git a/src/lib-index/Makefile.am b/src/lib-index/Makefile.am index 86eb73bd73..4db43f9251 100644 --- a/src/lib-index/Makefile.am +++ b/src/lib-index/Makefile.am @@ -1,13 +1,13 @@ SUBDIRS = maildir mbox -noinst_LIBRARIES = libstorage_index.a +noinst_LIBRARIES = libindex.a INCLUDES = \ -I$(top_srcdir)/src/lib \ -I$(top_srcdir)/src/lib-mail \ -I$(top_srcdir)/src/lib-imap -libstorage_index_a_SOURCES = \ +libindex_a_SOURCES = \ mail-custom-flags.c \ mail-index.c \ mail-index-compress.c \