Commit dd2131f5 dd2131f5522681d0f9f2cf5a648bd4fa1617bb1a by Sergey Poznyakoff

Rewrite conditional compilation support.

* Makefile.am: Conditionally add directories to SUBDIRS.
* am/enable.m4 (MU_ENABLE_BUILD): New macro.
* configure.ac: Require automake 1.11
Add MU_ENABLE_BUILDs for each utility.
Remove unused substitution variables.
* guimb/Makefile.am: Remove substitution variables.
* guimb/scm/Makefile.am: Likewise.
* libmu_scm/Makefile.am: Likewise.
* mh/Makefile.am: Likewise.
* python/libmu_py/Makefile.am: Likewise.
* python/mailutils/Makefile.am: Likewise.
* README: Document --disable-build-* options.
1 parent e4128c9e
......@@ -20,6 +20,70 @@
ACLOCAL_AMFLAGS = -I m4 -I am
if MU_COND_PYTHON
PYTHON_DIR = python
endif
if MU_COND_MH
MH_DIR = mh
endif
if MU_COND_FRM
FRM_DIR = frm
endif
if MU_COND_POP3D
POP3D_DIR = pop3d
endif
if MU_COND_IMAP4D
IMAP4D_DIR = imap4d
endif
if MU_COND_MAIDAG
MAIDAG_DIR = maidag
endif
if MU_COND_MAIL
MAIL_DIR = mail
endif
if MU_COND_SIEVE
SIEVE_DIR = sieve
endif
if MU_COND_GUIMB
GUIMB_DIR = guimb
endif
if MU_COND_MESSAGES
MESSAGES_DIR = messages
endif
if MU_COND_COMSAT
COMSAT_DIR = comsat
endif
if MU_COND_READMSG
READMSG_DIR = readmsg
endif
if MU_COND_DOTLOCK
DOTLOCK_DIR = dotlock
endif
if MU_COND_MOVEMAIL
MOVEMAIL_DIR = movemail
endif
if MU_COND_MIMEVIEW
MIMEVIEW_DIR = mimeview
endif
if MU_COND_LIBMU_SCM
LIBMU_SCM_DIR = libmu_scm
endif
SUBDIRS = \
mu-aux\
include\
......@@ -33,26 +97,26 @@ SUBDIRS = \
libmu_argp\
libmu_cfg\
libmu_cpp\
libmu_scm\
$(LIBMU_SCM_DIR)\
libmu_sieve\
python\
$(PYTHON_DIR)\
doc\
config\
examples\
frm\
pop3d\
imap4d\
maidag\
mail\
sieve\
guimb\
messages\
comsat\
readmsg\
dotlock\
mh\
movemail\
mimeview
$(FRM_DIR)\
$(POP3D_DIR)\
$(IMAP4D_DIR)\
$(MAIDAG_DIR)\
$(MAIL_DIR)\
$(SIEVE_DIR)\
$(GUIMB_DIR)\
$(MESSAGES_DIR)\
$(COMSAT_DIR)\
$(READMSG_DIR)\
$(DOTLOCK_DIR)\
$(MH_DIR)\
$(MOVEMAIL_DIR)\
$(MIMEVIEW_DIR)
EXTRA_DIST = COPYING.LESSER paths
......
......@@ -134,18 +134,6 @@ mailutils-specific configuration options:
You may have to explicitly specify LIBS and CPPFLAGS (see
above).
--enable-mh-utils
Build a suite of MH utilities. The GNU implementation of MH
primarily aims to provide an interface between Mailutils'
functionality and Emacs, using the mh-e module.
For more information, refer to the TODO file in the mh
subdirectory, and to the section `MH' in the accompanying
documentation. To access it, run
`info -f ./doc/texinfo/mailutils.info mh' from the Mailutils
root directory. After installation, it will become available
by running `info mailutils mh'.
--with-mh-bindir=DIR
By default the MH binaries are installed in
......@@ -308,14 +296,31 @@ features:
--disable-imap Disables IMAP protocol support.
--disable-pop Disables POP protocol support.
--disable-smtp Disables support for SMTP mailer. With this
option `mail.remote' is not built.
--disable-smtp Disables support for SMTP mailer.
--disable-sendmail Disables support for `Sendmail' mailer.
--disable-mh Disables support for MH mailbox format.
--disable-virtual-domains
Disables support for authentication using
virtual mail domains.
Special options are provided that control whether each particular
Mailutils program is built. These are:
--disable-build-frm do not build frm
--disable-build-pop3d do not build pop3d
--disable-build-imap4d do not build imap4d
--disable-build-comsat do not build comsat
--disable-build-maidag do not build maidag
--disable-build-mail do not build mail
--disable-build-sieve do not build sieve
--disable-build-guimb do not build guimb
--disable-build-messages do not build messages
--disable-build-readmsg do not build readmsg
--disable-build-dotlock do not build dotlock
--disable-build-movemail do not build movemail
--disable-build-mimeview do not build mimeview
--disable-build-mh do not build mh utilities
Several environment variables affect the configuration. Currently,
the only mailutils-specific variable is DEFAULT_CUPS_CONFDIR. It
sets the location of CUPS (Common UNIX Printing System) configuration
......
......@@ -46,5 +46,36 @@ AC_DEFUN([MU_ENABLE_SUPPORT], [
popdef([mu_cache_var])
])
AC_DEFUN([MU_ENABLE_BUILD], [
pushdef([mu_upcase],translit($1,[a-z+-],[A-ZX_]))
pushdef([mu_cache_var],[mu_cv_enable_build_]translit($1,[+-],[x_]))
pushdef([mu_cond],[MU_COND_]mu_upcase)
AC_ARG_ENABLE(build-$1,
AC_HELP_STRING([--disable-build-]$1,
[do not build ]$1),
[
case "${enableval}" in
yes) mu_cache_var=yes;;
no) mu_cache_var=no;;
*) AC_MSG_ERROR([bad value ${enableval} for --disable-$1]) ;;
esac],
[ifelse([$4],,mu_cache_var=yes,[$4])])
if test x"[$]mu_cache_var" = x"yes"; then
ifelse([$2],,:,[$2])
ifelse([$3],,,else
[$3])
fi
if test x"[$]mu_cache_var" = x"yes"; then
AC_DEFINE([MU_BUILD_]mu_upcase,1,[Define this if you build $1])
fi
AM_CONDITIONAL(mu_cond,
[test x"[$]mu_cache_var" = x"yes"])
popdef([mu_upcase])
popdef([mu_cache_var])
popdef([mu_cond])
])
......
......@@ -21,7 +21,7 @@ AC_PREREQ(2.63)
AC_INIT([GNU Mailutils], [2.0.90], [bug-mailutils@gnu.org], [mailutils])
AC_CONFIG_SRCDIR([mailbox/mailbox.c])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([gnits 1.8.5 dist-bzip2 std-options silent-rules])
AM_INIT_AUTOMAKE([gnits 1.11 dist-bzip2 std-options silent-rules])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
......@@ -808,14 +808,8 @@ MU_ENABLE_SUPPORT(sendmail)
MU_ENABLE_SUPPORT(prog)
AC_SUBST(MU_MH_PROGRAMS_BUILD)
AC_SUBST(MU_MH_LIBRARIES_BUILD)
AC_SUBST(MU_MH_EXEC_HOOK)
MU_ENABLE_SUPPORT(mh)
MU_ENABLE_SUPPORT(mh,
[MU_MH_PROGRAMS_BUILD='$(MU_MH_PROGRAMS_LIST)';
MU_MH_LIBRARIES_BUILD='$(MU_MH_LIBRARIES_LIST)';
MU_MH_EXEC_HOOK=mh_finish_install])
MU_ENABLE_SUPPORT(maildir)
# FIXME: Should be --with-radius
......@@ -825,17 +819,6 @@ MU_ENABLE_SUPPORT(radius,
mu_cv_enable_radius=yes],
[mu_cv_enable_radius=no])])
AC_SUBST(MH_BIN_DIR)
AC_ARG_WITH([mh-bindir],
AC_HELP_STRING([--with-mh-bindir],
[Set the directory where to install the MH binaries. If it starts with '/' it is taken as an absolute path specification, otherwise ${prefix} is prepended to it. (Default: ${exec_prefix}/bin/mu-mh)]),
[case "${withval}" in
/*) MH_BIN_DIR=${withval};;
*) MH_BIN_DIR="\${prefix}/${withval}";;
esac],
[MH_BIN_DIR='${exec_prefix}/bin/mu-mh'])
AC_ARG_ENABLE([experimental],
AC_HELP_STRING([--enable-experimental],
[build experimental and/or unfinished utilities]),
......@@ -1070,15 +1053,10 @@ fi
dnl Check for Guile
AC_SUBST(GUILE_BINDIR)
AC_SUBST(MU_SCM_BIN_PROGRAMS_BUILD)
AC_SUBST(MU_SCM_LTLIBRARIES_BUILD)
AC_SUBST(LIBMU_SCM)
AC_SUBST(LIBMU_SCM_DEPS)
AC_SUBST(GUILE_SITE_DATA)
AC_SUBST(GUILE_BUILT_SOURCES)
AC_SUBST(MU_GUILE_SITE_DIR)
AC_SUBST(MU_GUILE_SIEVE_MOD_DIR)
AC_SUBST(MU_GUILE_SIEVE_SCRIPTS)
AC_SUBST(MU_GUILE_SIEVE_MOD_DATA)
if test "$useguile" != "no"; then
......@@ -1086,16 +1064,11 @@ if test "$useguile" != "no"; then
[useguile=yes
AC_DEFINE(WITH_GUILE,1,[Enable Guile support])
GUILE_BINDIR=`guile-config info bindir`
MU_SCM_BIN_PROGRAMS_BUILD='$(MU_SCM_BIN_PROGRAMS_LIST)'
MU_SCM_LTLIBRARIES_BUILD='$(MU_SCM_LTLIBRARIES_LIST)'
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}'
GUILE_SITE_DATA='$(GUILE_SITE_DATA_X)'
MU_GUILE_SITE_DIR='$(GUILE_SITE)/$(PACKAGE)'
MU_GUILE_SIEVE_MOD_DIR='$(GUILE_SITE)/sieve-modules'
MU_GUILE_SIEVE_SCRIPTS='$(MU_GUILE_SIEVE_SCRIPTS_X)'
MU_GUILE_SIEVE_MOD_DATA='$(MU_GUILE_SIEVE_MOD_DATA_X)'
GUILE_BUILT_SOURCES='$(GUILE_BUILT_SOURCES_X)'
],[useguile=no])
if test "$useguile" = "yes"; then
......@@ -1120,6 +1093,8 @@ if test "$useguile" != "no"; then
fi
fi
AM_CONDITIONAL([MU_COND_LIBMU_SCM],[test "$useguile" = "yes"])
AC_SUBST(GUILE_SITE)
dnl Check for Emacs site-lisp directory
......@@ -1143,9 +1118,6 @@ esac],[status_python=yes])
AC_SUBST(PYTHON_LIBS)
AC_SUBST(PYTHON_INCLUDES)
AC_SUBST(MU_PY_LIB_LTLIBRARIES_BUILD)
AC_SUBST(MU_PY_PKGPYEXEC_LTLIBRARIES_BUILD)
AC_SUBST(MU_PY_PKGPYTHON_BUILD)
if test "$status_python" = yes; then
AM_PATH_PYTHON(2.5.0,, [status_python=no])
......@@ -1161,13 +1133,11 @@ if test "$status_python" = yes; then
if test "$status_python" = yes; then
AC_DEFINE(WITH_PYTHON,1,[Enable Python support])
MU_PY_LIB_LTLIBRARIES_BUILD='$(MU_PY_LIB_LTLIBRARIES_LIST)'
MU_PY_PKGPYEXEC_LTLIBRARIES_BUILD='$(MU_PY_PKGPYEXEC_LTLIBRARIES_LIST)'
MU_PY_PKGPYTHON_BUILD='$(MU_PY_PKGPYTHON_LIST)'
MU_LIB_PY='${top_builddir}/python/libmu_py/libmu_py.la'
fi
fi
fi
AM_CONDITIONAL([MU_COND_PYTHON], [test "$status_python" = yes])
AC_SUBST(MU_CXX_LTLIBRARIES_BUILD)
AC_SUBST(MU_CXX_EXAMPLES_BUILD)
......@@ -1208,6 +1178,43 @@ if test -z "$DEFAULT_CUPS_CONFDIR"; then
DEFAULT_CUPS_CONFDIR='$(sysconfdir)/cups'
fi
dnl ***********************************************************************
dnl Configure particular utilities
dnl ***********************************************************************
MU_ENABLE_BUILD(frm)
MU_ENABLE_BUILD(pop3d)
MU_ENABLE_BUILD(imap4d)
MU_ENABLE_BUILD(comsat)
MU_ENABLE_BUILD(maidag)
MU_ENABLE_BUILD(mail)
MU_ENABLE_BUILD(sieve)
if test "$useguile" = yes; then
MU_ENABLE_BUILD(guimb)
fi
MU_ENABLE_BUILD(messages)
MU_ENABLE_BUILD(readmsg)
MU_ENABLE_BUILD(dotlock)
MU_ENABLE_BUILD(movemail)
MU_ENABLE_BUILD(mimeview)
if test "$mu_cv_enable_mh" = yes; then
MU_ENABLE_BUILD(mh)
fi
AC_SUBST(MH_BIN_DIR)
AC_ARG_WITH([mh-bindir],
AC_HELP_STRING([--with-mh-bindir],
[Set the directory where to install the MH binaries. If it starts with '/' it is taken as an absolute path specification, otherwise ${prefix} is prepended to it. (Default: ${exec_prefix}/bin/mu-mh)]),
[case "${withval}" in
/*) MH_BIN_DIR=${withval};;
*) MH_BIN_DIR="\${prefix}/${withval}";;
esac],
[MH_BIN_DIR='${exec_prefix}/bin/mu-mh'])
dnl Make sysconfdir available to the application
dnl This must be done LAST, since CPPFLAGS is passed by configure
dnl to build tests, but this relies on being run in make to
......@@ -1273,7 +1280,6 @@ Mailers:
SMTP .......................... $status_smtp
Sendmail ...................... $status_sendmail
*******************************************************************
Before proceeding, verify if these satisfy your requirements.
......
......@@ -21,9 +21,7 @@ INCLUDES = @MU_APP_COMMON_INCLUDES@ @GUILE_INCLUDES@
SUBDIRS=scm
MU_SCM_BIN_PROGRAMS_LIST=guimb # FIXME: does it need $(EXEEXT)?
bin_PROGRAMS=@MU_SCM_BIN_PROGRAMS_BUILD@
EXTRA_PROGRAMS=$(MU_SCM_BIN_PROGRAMS_LIST)
bin_PROGRAMS=guimb
guimb_SOURCES=main.c collect.c util.c guimb.h
guimb_LDADD = \
${MU_APP_LIBRARIES}\
......
......@@ -18,7 +18,7 @@
## 02110-1301 USA
MU_GUILE_SIEVE_SCRIPTS_X=sieve.scm
bin_SCRIPTS = @MU_GUILE_SIEVE_SCRIPTS@
bin_SCRIPTS = sieve.scm
EXTRA_SCRIPTS=sieve.scm
sievemoddir=@MU_GUILE_SIEVE_MOD_DIR@
......@@ -37,8 +37,7 @@ sieve.sed: Makefile
CLEANFILES = sieve.scm sieve.sed
sitedir=@MU_GUILE_SITE_DIR@
GUILE_SITE_DATA_X=sieve-core.scm
site_DATA=@GUILE_SITE_DATA@
site_DATA=sieve-core.scm
MU_GUILE_SIEVE_MOD_DATA_X=\
mimeheader.scm\
......
......@@ -20,9 +20,8 @@
INCLUDES = -I. @MU_LIB_COMMON_INCLUDES@ @GUILE_INCLUDES@
MU_SCM_LTLIBRARIES_LIST = libmu_scm.la
lib_LTLIBRARIES=@MU_SCM_LTLIBRARIES_BUILD@
EXTRA_LTLIBRARIES=libmu_scm.la
lib_LTLIBRARIES=libmu_scm.la
C_SRCS=\
mu_address.c\
mu_body.c\
......@@ -52,11 +51,10 @@ libmu_scm_la_LIBADD = \
${MU_LIB_MAILUTILS}\
@GUILE_LIBS@
EXTRA_DIST=mailutils.scm mailutils.scm.in
EXTRA_DIST=mailutils.scm mailutils.scm.in guile-procedures.texi guile-procedures.txt
sitedir=@MU_GUILE_SITE_DIR@
GUILE_SITE_DATA_X=guile-procedures.txt mailutils.scm
site_DATA=@GUILE_SITE_DATA@
site_DATA=guile-procedures.txt mailutils.scm
DOT_X_FILES=\
mu_address.x\
......@@ -80,11 +78,15 @@ DOT_DOC_FILES=\
mu_scm.doc\
mu_util.doc
GUILE_BUILT_SOURCES_X=$(DOT_X_FILES) $(DOT_DOC_FILES) guile-procedures.texi
BUILT_SOURCES=$(DOT_X_FILES) $(DOT_DOC_FILES) guile-procedures.texi
BUILT_SOURCES=@GUILE_BUILT_SOURCES@
DISTCLEANFILES=\
$(DOT_X_FILES)\
$(DOT_DOC_FILES)\
guile-procedures.texi\
guile-procedures.txt\
mailutils.scm
DISTCLEANFILES=$(DOT_X_FILES) $(DOT_DOC_FILES) guile-procedures.texi @GUILE_SITE_DATA@
CLEANFILES=*.inc
AM_CPPFLAGS=-DDATADIR=\"$(pkgdatadir)\"
......
......@@ -17,35 +17,9 @@
## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
# All MH programs. Note that we have to explicitely append EXEEXT, Makefile
# won't do that.
MU_MH_PROGRAMS_LIST = \
ali$(EXEEXT)\
anno$(EXEEXT)\
burst$(EXEEXT)\
comp$(EXEEXT)\
fmtcheck$(EXEEXT)\
folder$(EXEEXT)\
forw$(EXEEXT)\
inc$(EXEEXT)\
install-mh$(EXEEXT)\
mark$(EXEEXT)\
mhl$(EXEEXT)\
mhn$(EXEEXT)\
mhparam$(EXEEXT)\
mhpath$(EXEEXT)\
pick$(EXEEXT)\
refile$(EXEEXT)\
repl$(EXEEXT)\
rmf$(EXEEXT)\
rmm$(EXEEXT)\
scan$(EXEEXT)\
send$(EXEEXT)\
sortm$(EXEEXT)\
whatnow$(EXEEXT)\
whom$(EXEEXT)
EXTRA_PROGRAMS = \
bindir = @MH_BIN_DIR@
mhlibdir = $(pkgdatadir)/mh
bin_PROGRAMS = \
ali\
anno\
burst\
......@@ -71,13 +45,7 @@ EXTRA_PROGRAMS = \
whatnow\
whom
MU_MH_LIBRARIES_LIST = libmh.a
EXTRA_LIBRARIES = libmh.a
bindir = @MH_BIN_DIR@
mhlibdir = $(pkgdatadir)/mh
bin_PROGRAMS = @MU_MH_PROGRAMS_BUILD@
noinst_LIBRARIES = @MU_MH_LIBRARIES_BUILD@
noinst_LIBRARIES = libmh.a
libmh_a_SOURCES= \
compcommon.c\
......@@ -168,9 +136,7 @@ mh_alias_lex.c: $(srcdir)/mh_alias.l mh_alias.h
$(srcdir)/mh_alias.l lex.yy.c mh_alias_lex.c \
-- -yy ali_yy
install-exec-hook: @MU_MH_EXEC_HOOK@
mh_finish_install:
install-exec-hook:
@here=`pwd`; \
cd $(DESTDIR)$(bindir); \
rm -f folders; \
......
......@@ -19,10 +19,7 @@
INCLUDES = @MU_LIB_COMMON_INCLUDES@ $(PYTHON_INCLUDES)
EXTRA_LTLIBRARIES = libmu_py.la c_api.la
MU_PY_LIB_LTLIBRARIES_LIST=libmu_py.la
lib_LTLIBRARIES=@MU_PY_LIB_LTLIBRARIES_BUILD@
lib_LTLIBRARIES=libmu_py.la
libmu_py_la_SOURCES = \
error.c \
address.c \
......@@ -66,8 +63,7 @@ libmu_py_la_LIBADD = $(PYTHON_LIBS) @MU_COMMON_LIBRARIES@ \
@MU_AUTHLIBS@\
${MU_LIB_MAILUTILS}
MU_PY_PKGPYEXEC_LTLIBRARIES_LIST = c_api.la
pkgpyexec_LTLIBRARIES = @MU_PY_PKGPYEXEC_LTLIBRARIES_BUILD@
pkgpyexec_LTLIBRARIES = c_api.la
c_api_la_LDFLAGS = -avoid-version -module -rpath $(pkgpyexecdir)
c_api_la_LIBADD = $(PYTHON_LIBS) ${MU_LIB_PY}
c_api_la_SOURCES = c_api.c
......
......@@ -17,7 +17,7 @@
## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
MU_PY_PKGPYTHON_LIST=\
pkgpython_PYTHON=\
__init__.py \
error.py \
address.py \
......@@ -42,5 +42,3 @@ MU_PY_PKGPYTHON_LIST=\
url.py \
util.py
pkgpython_PYTHON=@MU_PY_PKGPYTHON_BUILD@
EXTRA_PYTHON=$(MU_PY_PKGPYTHON_LIST)
......