diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-05-02 15:40:02 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-05-02 16:15:52 +0300 |
commit | 82917550244d2e4d06f4450d58af7beaae51a0a7 (patch) | |
tree | 4d8fab967c75303c4b760c5f9d0ba3dd29f44b0b | |
parent | 14af0505bcf691efbeb8fb60ab5ea99b9836f061 (diff) | |
download | mailutils-82917550244d2e4d06f4450d58af7beaae51a0a7.tar.gz mailutils-82917550244d2e4d06f4450d58af7beaae51a0a7.tar.bz2 |
Fix conditional compilation.
* .gitignore: Add git-describe and git-describe.h.
* Makefile.am (MU_COND_LIBMU_CPP): Replaced with MU_COND_SUPPORT_CXX
(SUBDIRS): Begin with .
(EXTRA_DIST, BUILT_SOURCES): Add git-describe and git-describe.h.
(git-describe, git-describe.h): New rules.
(alpha, alphacheck): Use git-describe to produce additional suffix.
* enable.m4 (MU_ENABLE_SUPPORT): Create an Automake condition.
* configure.ac: Fix MU_ENABLE_SUPPORT calls.
(--without-python): Replace with --disable-python.
* examples/Makefile.am: Disable components based on MU_COND conditions.
* libproto/Makefile.am: Likewise.
* include/mailutils/Makefile.am (MU_COND_LIBMU_CPP): Replace with
MU_COND_SUPPORT_CXX.
* mailbox/nullrec.c: New file.
* mailbox/Makefile.am (libmailutils_la_SOURCES): Add nullrec.c.
* mail/decode.c: Remove unused variable.
* mailbox/streamref.c: Likewise.
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile.am | 53 | ||||
-rw-r--r-- | am/enable.m4 | 6 | ||||
-rw-r--r-- | configure.ac | 51 | ||||
-rw-r--r-- | examples/Makefile.am | 20 | ||||
-rw-r--r-- | include/mailutils/Makefile.am | 2 | ||||
-rw-r--r-- | libmu_argp/mu_argp.h | 46 | ||||
-rw-r--r-- | libproto/Makefile.am | 22 | ||||
-rw-r--r-- | mail/decode.c | 1 | ||||
-rw-r--r-- | mailbox/Makefile.am | 1 | ||||
-rw-r--r-- | mailbox/nullrec.c | 49 | ||||
-rw-r--r-- | mailbox/streamref.c | 1 |
12 files changed, 168 insertions, 86 deletions
diff --git a/.gitignore b/.gitignore index 3f3f74e5e..a142bc9c9 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,8 @@ config.h.in config.log config.status configure +git-describe +git-describe.h libtool m4 pathdefs.h diff --git a/Makefile.am b/Makefile.am index f6f53a9c4..81aefd286 100644 --- a/Makefile.am +++ b/Makefile.am @@ -85,11 +85,11 @@ if MU_COND_LIBMU_SCM LIBMU_SCM_DIR = libmu_scm endif -if MU_COND_LIBMU_CPP +if MU_COND_SUPPORT_CXX LIBMU_CPP_DIR = libmu_cpp endif -SUBDIRS = \ +SUBDIRS = . \ mu-aux\ include\ po\ @@ -124,8 +124,8 @@ SUBDIRS = \ $(MOVEMAIL_DIR)\ $(MIMEVIEW_DIR) -EXTRA_DIST = COPYING.LESSER paths - +EXTRA_DIST = COPYING.LESSER paths git-describe git-describe.h +BUILT_SOURCES = git-describe git-describe.h DISTCLEANFILES = pathdefs.h gen_start_date = "2008-12-08" @@ -155,12 +155,45 @@ ChangeLog: mv cl-t ChangeLog; \ fi -alpha: - $(MAKE) dist distdir=$(PACKAGE)-$(VERSION)-`date +"%Y%m%d"` +.PHONY: git-describe +git-describe: + $(AM_V_GEN)if test -d .git; then \ + dirty=`git diff-index --name-only HEAD 2>/dev/null` || dirty=;\ + test -n "$$dirty" && dirty="-dirty"; \ + descr=`git describe`; \ + echo $${descr}$$dirty > git-describe; \ + fi -alphacheck: - $(MAKE) distcheck distdir=$(PACKAGE)-$(VERSION)-`date +"%Y%m%d"` +dist-hook: ChangeLog git-describe + @PATCHLEV=`echo "$(PACKAGE_VERSION)" | \ + sed -r "s/[0-9]+\.[0-9]+\.?//"`; \ + if test $${PATCHLEV:-0} -lt 50; then \ + if grep -q FIXME NEWS; then \ + echo >&2 "NEWS file contains FIXMEs"; \ + exit 1; \ + fi; \ + fi + +git-describe.h: git-describe + $(AM_V_GEN)if test -f $(srcdir)/git-describe; then \ + sed '1s/.*/#define GIT_DESCRIBE "&"/' $(srcdir)/git-describe; \ + else \ + echo "/* No git tag */"; \ + fi > git-describe.h + +alpha: git-describe + $(AM_V_GEN)if test -f $(srcdir)/git-describe; then \ + tag=`head -n 1 $(srcdir)/git-describe`; \ + else \ + tag=`date +"%Y%m%d"`; \ + fi; \ + $(MAKE) dist distdir=$(PACKAGE)-$(VERSION)-$$tag -rpm: dist - rpm -ta --clean mailutils-$(VERSION).tar.gz +alphacheck: + $(AM_V_GEN)if test -f $(srcdir)/git-describe; then \ + tag=`head -n 1 $(srcdir)/git-describe`; \ + else \ + tag=`date +"%Y%m%d"`; \ + fi; \ + $(MAKE) distcheck distdir=$(PACKAGE)-$(VERSION)-$$tag diff --git a/am/enable.m4 b/am/enable.m4 index faf3a3125..e531c984e 100644 --- a/am/enable.m4 +++ b/am/enable.m4 @@ -23,6 +23,7 @@ dnl [default-value]) AC_DEFUN([MU_ENABLE_SUPPORT], [ pushdef([mu_upcase],translit($1,[a-z+-],[A-ZX_])) pushdef([mu_cache_var],[mu_cv_enable_]translit($1,[+-],[x_])) + pushdef([mu_cond],[MU_COND_SUPPORT_]mu_upcase) AC_ARG_ENABLE($1, AC_HELP_STRING([--disable-]$1, @@ -43,8 +44,11 @@ AC_DEFUN([MU_ENABLE_SUPPORT], [ if test x"[$]mu_cache_var" = x"yes"; then AC_DEFINE([ENABLE_]mu_upcase,1,[Define this if you enable $1 support]) fi - popdef([mu_upcase]) + AM_CONDITIONAL(mu_cond, + [test x"[$]mu_cache_var" = x"yes" ifelse($4,,,[&& $4])]) + popdef([mu_cond]) popdef([mu_cache_var]) + popdef([mu_upcase]) ]) dnl MU_ENABLE_BUILD(feature, [action-if-true], [action-if-false], diff --git a/configure.ac b/configure.ac index ad3107520..832b33226 100644 --- a/configure.ac +++ b/configure.ac @@ -40,16 +40,16 @@ dnl Library paths AC_SUBST(MU_LIB_AUTH,'${top_builddir}/libmu_auth/libmu_auth.la') AC_SUBST(MU_LIB_MAILUTILS,'${top_builddir}/mailbox/libmailutils.la') AC_SUBST(MU_LIB_SQL,'${top_builddir}/sql/libsql.la') -AC_SUBST(MU_LIB_IMAP,'${top_builddir}/libproto/imap/libmu_imap.la') -AC_SUBST(MU_LIB_MAILDIR,'${top_builddir}/libproto/maildir/libmu_maildir.la') +AC_SUBST(MU_LIB_IMAP) +AC_SUBST(MU_LIB_MAILDIR) AC_SUBST(MU_LIB_MAILER,'${top_builddir}/libproto/mailer/libmu_mailer.la') AC_SUBST(MU_LIB_MBOX,'${top_builddir}/libproto/mbox/libmu_mbox.la') -AC_SUBST(MU_LIB_MH,'${top_builddir}/libproto/mh/libmu_mh.la') -AC_SUBST(MU_LIB_NNTP,'${top_builddir}/libproto/nntp/libmu_nntp.la') -AC_SUBST(MU_LIB_POP,'${top_builddir}/libproto/pop/libmu_pop.la') +AC_SUBST(MU_LIB_MH) +AC_SUBST(MU_LIB_NNTP) +AC_SUBST(MU_LIB_POP) AC_SUBST(MU_LIB_SIEVE,'${top_builddir}/libmu_sieve/libmu_sieve.la') -AC_SUBST(MU_LIB_SCM,'${top_builddir}/libmu_scm/libmu_scm.la') -AC_SUBST(MU_LIB_CPP,'${top_builddir}/libmu_cpp/libmu_cpp.la') +AC_SUBST(MU_LIB_SCM) +AC_SUBST(MU_LIB_CPP) AC_SUBST(MU_LIB_ARGP,'${top_builddir}/libmu_argp/libmu_argp.la') AC_SUBST(MU_LIB_PY) @@ -815,9 +815,17 @@ AC_ARG_WITH([virtual-pwddir], *) SITE_VIRTUAL_PWDDIR="\$(sysconfdir)/${withval}";; esac], [SITE_VIRTUAL_PWDDIR="\$(sysconfdir)/domain"]) -MU_ENABLE_SUPPORT(imap) -MU_ENABLE_SUPPORT(pop) -MU_ENABLE_SUPPORT(nntp) + +MU_ENABLE_SUPPORT([imap], + [MU_LIB_IMAP='${top_builddir}/libproto/imap/libmu_imap.la']) +MU_ENABLE_SUPPORT([pop], + [MU_LIB_POP='${top_builddir}/libproto/pop/libmu_pop.la']) +MU_ENABLE_SUPPORT([nntp], + [MU_LIB_NNTP='${top_builddir}/libproto/nntp/libmu_nntp.la']) +MU_ENABLE_SUPPORT([mh], + [MU_LIB_MH='${top_builddir}/libproto/mh/libmu_mh.la']) +MU_ENABLE_SUPPORT([maildir], + [MU_LIB_MAILDIR='${top_builddir}/libproto/maildir/libmu_maildir.la']) AC_SUBST(MU_SMTP_PROGRAMS_BUILD) AC_SUBST(MU_SMTP_DEJATOOL) @@ -829,9 +837,6 @@ MU_ENABLE_SUPPORT(sendmail) MU_ENABLE_SUPPORT(prog) -MU_ENABLE_SUPPORT(mh) - -MU_ENABLE_SUPPORT(maildir) # FIXME: Should be --with-radius MU_ENABLE_SUPPORT(radius, @@ -1083,6 +1088,7 @@ if test "$useguile" != "no"; then [useguile=yes AC_DEFINE([WITH_GUILE],1,[Enable Guile support]) GUILE_BINDIR=`guile-config info bindir` + MU_LIB_SCM='${top_builddir}/libmu_scm/libmu_scm.la' LIBMU_SCM=../libmu_scm/libmu_scm.la LIBMU_SCM_DEPS='${MU_LIB_MBOX} ${MU_LIB_IMAP} ${MU_LIB_POP} ${MU_LIB_MH} ${MU_LIB_MAILDIR} ${MU_LIB_MAILER}' MU_GUILE_SIEVE_MOD_DIR='$(GUILE_SITE)/$(PACKAGE)/sieve-modules' @@ -1103,14 +1109,14 @@ fi AC_SUBST(lisp_LISP) # Check for Python -AC_ARG_WITH([python], - AC_HELP_STRING([--without-python], - [do not build Python interface]), - [ -case "${withval}" in +AC_ARG_ENABLE([python], + AC_HELP_STRING([--disable-python], + [do not build Python interface]), + [ +case "${enableval}" in yes) status_python=yes ;; no) status_python=no ;; - *) AC_MSG_ERROR(bad value ${withval} for --without-python) ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;; esac],[status_python=yes]) AC_SUBST(PYTHON_LIBS) @@ -1150,8 +1156,8 @@ AM_CONDITIONAL([MU_COND_PYTHON], [test "$status_python" = yes]) AC_SUBST(MU_CXX_EXAMPLES_BUILD) MU_ENABLE_SUPPORT(cxx, - [MU_CXX_EXAMPLES_BUILD='$(MU_CXX_EXAMPLES_LIST)']) -AM_CONDITIONAL([MU_COND_LIBMU_CPP], [test "$mu_cv_enable_cxx" = yes]) + [MU_CXX_EXAMPLES_BUILD='$(MU_CXX_EXAMPLES_LIST)' + MU_LIB_CPP='${top_builddir}/libmu_cpp/libmu_cpp.la']) # Default mailbox record # Note: 1. Support for mbox type is always enabled. @@ -1236,12 +1242,13 @@ case `echo $VERSION|sed 's/[[^.]]//g'` in "..") if test `echo $VERSION | sed 's/.*\.//'` -lt 50; then RENDITION=DISTRIB else + AC_DEFINE_UNQUOTED([MU_ALPHA_RELEASE], 1, + [Define if this is an alpha release]) RENDITION=PROOF fi;; *) RENDITION=PROOF;; esac - AC_CONFIG_COMMANDS([status],[ cat <<EOF diff --git a/examples/Makefile.am b/examples/Makefile.am index 1e189a1ef..1ba0b8727 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -18,7 +18,19 @@ ## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301 USA -SUBDIRS = config cpp python scheme +if MU_COND_SUPPORT_POP + POP3CLIENT = pop3client +endif + +if MU_COND_SUPPORT_NNTP + NNTPCLIENT = nntpclient +endif + +if MU_COND_SUPPORT_CXX + CPP_DIR = cpp +endif + +SUBDIRS = config $(CPP_DIR) python scheme noinst_PROGRAMS = \ aclck\ @@ -40,11 +52,13 @@ noinst_PROGRAMS = \ muauth\ muemail\ murun\ - nntpclient\ - pop3client \ + $(NNTPCLIENT)\ + $(POP3CLIENT)\ sfrom\ url-parse +EXTRA_PROGRAMS = pop3client nntpclient + ## NOTE: Numaddr must be an installable target, otherwise libtool ## will not create a shared library and `make check' will fail in ## sieve. Pity. diff --git a/include/mailutils/Makefile.am b/include/mailutils/Makefile.am index d1261d2ff..098a9faef 100644 --- a/include/mailutils/Makefile.am +++ b/include/mailutils/Makefile.am @@ -98,7 +98,7 @@ pkginclude_HEADERS = \ vartab.h\ version.h -if MU_COND_LIBMU_CPP +if MU_COND_SUPPORT_CXX CPP_DIR = cpp endif diff --git a/libmu_argp/mu_argp.h b/libmu_argp/mu_argp.h deleted file mode 100644 index 804f46c5d..000000000 --- a/libmu_argp/mu_argp.h +++ /dev/null @@ -1,46 +0,0 @@ -/* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2009, 2010 Free - Software Foundation, Inc. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 3 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301 USA */ - -#ifndef _MAILUTILS_ARGP_H -#define _MAILUTILS_ARGP_H - -#include <mailutils/types.h> -#include <argp.h> -#include <errno.h> /* May declare program_invocation_name */ - -extern char *mu_license_text; - -#ifdef __cplusplus -extern "C" { -#endif - -extern void mu_argp_init (struct argp *argp, const char *vers, - const char *bugaddr, const char *capa[]); -extern void mu_argp_done (struct argp *argp); - -extern int mu_register_argp_capa (const char *name, struct argp_child *child); - -extern void mu_print_options (void); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/libproto/Makefile.am b/libproto/Makefile.am index 314cfb755..30a423d9a 100644 --- a/libproto/Makefile.am +++ b/libproto/Makefile.am @@ -17,5 +17,25 @@ ## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301 USA -SUBDIRS = include mbox pop nntp imap mh maildir mailer +if MU_COND_SUPPORT_POP + POP_DIR = pop +endif + +if MU_COND_SUPPORT_IMAP + IMAP_DIR = imap +endif + +if MU_COND_SUPPORT_NNTP + NNTP_DIR = nntp +endif + +if MU_COND_SUPPORT_MH + MH_DIR = mh +endif + +if MU_COND_SUPPORT_MAILDIR + MAILDIR_DIR = maildir +endif + +SUBDIRS = include mbox $(POP_DIR) $(NNTP_DIR) $(IMAP_DIR) $(MH_DIR) $(MAILDIR_DIR) mailer diff --git a/mail/decode.c b/mail/decode.c index f0212cdf6..0acceaf6a 100644 --- a/mail/decode.c +++ b/mail/decode.c @@ -318,7 +318,6 @@ print_stream (mu_stream_t stream, FILE *out) { char buffer[512]; size_t n = 0; - int rc; while (mu_stream_read (stream, buffer, sizeof (buffer) - 1, &n) == 0 && n != 0) diff --git a/mailbox/Makefile.am b/mailbox/Makefile.am index 1946fda39..0d0493033 100644 --- a/mailbox/Makefile.am +++ b/mailbox/Makefile.am @@ -114,6 +114,7 @@ libmailutils_la_SOURCES = \ muerror.c\ muerrno.c\ nls.c\ + nullrec.c\ observer.c\ opool.c\ parse822.c\ diff --git a/mailbox/nullrec.c b/mailbox/nullrec.c new file mode 100644 index 000000000..9d080cd86 --- /dev/null +++ b/mailbox/nullrec.c @@ -0,0 +1,49 @@ +/* GNU Mailutils -- a suite of utilities for electronic mail + Copyright (C) 1999, 2000, 2001, 2002, 2004, + 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. */ + +/* This file provides replacement definitions for mu_record_t defined + in those MU libraries which are disabled at configure time. */ +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <stdlib.h> +#include <mailutils/types.h> +#include <mailutils/registrar.h> + +#ifndef ENABLE_IMAP +mu_record_t mu_imap_record = NULL; +mu_record_t mu_imaps_record = NULL; +#endif + +#ifndef ENABLE_POP +mu_record_t mu_pop_record = NULL; +mu_record_t mu_pops_record = NULL; +#endif + +#ifndef ENABLE_NNTP +mu_record_t mu_nntp_record = NULL; +#endif + +#ifndef ENABLE_MH +mu_record_t mu_mh_record = NULL; +#endif + +#ifndef ENABLE_MAILDIR +mu_record_t mu_maildir_record = NULL; +#endif + diff --git a/mailbox/streamref.c b/mailbox/streamref.c index a2f022a99..4949a8540 100644 --- a/mailbox/streamref.c +++ b/mailbox/streamref.c @@ -156,7 +156,6 @@ static int _streamref_seek (struct _mu_stream *str, mu_off_t off, mu_off_t *ppos) { struct _mu_streamref *sp = (struct _mu_streamref *)str; - mu_off_t cur = sp->offset - sp->start; mu_off_t size; int rc; |