Commit 86584768 8658476839bcd6704ce51f470e14cf302b888f4a by Sergey Poznyakoff

Improve configuration options.

* am/enable.m4 (MU_ENABLE_BUILD): Change handling of additional-cond
($4): the --{enable|disable}-build-* argument value overrides it.
This allows to use such configuration shortcuts as:

  --disable-build-clients --enable-build-mail

which will build only mail, but no other client.

* configure.ac: New option --with-dbm can be used to
enable/disable building of all available DBM interfaces.
It can be used in conjunction with implementation-specific
options in the same way as described above, e.g.:

  --without-dbm --with-gdbm

New option --with-mailbindir allows for overriding the installation
directory for mail[x] only.

* mail/Makefile.am (mailbindir): New variable.
(bin_PROGRAMS): Rename to mailbin_PROGRAMS.
1 parent 78f92501
......@@ -59,30 +59,31 @@ AC_DEFUN([MU_ENABLE_BUILD], [
pushdef([mu_cache_var],[mu_cv_enable_build_]translit($1,[+-],[x_]))
pushdef([mu_cond],[MU_COND_]mu_upcase)
ifelse([$4],,,[if test $4; then])
AC_ARG_ENABLE(build-$1,
AC_HELP_STRING([--disable-build-]$1,
[do not build ]$1),
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],
[mu_cache_var=ifelse([$5],,yes,[$5])])
[ifelse([$4],,[mu_cache_var=ifelse([$5],,yes,[$5])],
[if test $4; then
mu_cache_var=yes
else
mu_cache_var=no
fi])])
if test "[$]mu_cache_var" = "yes"; then
if test "[$]mu_cache_var" = "yes"; then
ifelse([$2],,:,[$2])
ifelse([$6],,,[$6="$[]$6 $1"])
ifelse([$3],,,else
[$3])
fi
if test "[$]mu_cache_var" = "yes"; then
AC_DEFINE([MU_BUILD_]mu_upcase,1,[Define this if you build $1])
fi
ifelse([$4],,,[else
mu_cache_var=no
fi])
ifelse([$3],,,else
[$3])
fi
if test "[$]mu_cache_var" = "yes"; then
AC_DEFINE([MU_BUILD_]mu_upcase,1,[Define this if you build $1])
fi
AM_CONDITIONAL(mu_cond,
[test "[$]mu_cache_var" = "yes"])
......
......@@ -358,8 +358,19 @@ AC_SUBST(DBMLIBS)
AC_SUBST(DBMLIB_DEPENDENCY)
AC_SUBST(DBMINCLUDES)
enable_dbm=no
enable_dbm=
disable_dbm=no
all_dbm="GDBM BDB TC NDBM"
AC_ARG_WITH([dbm],
AC_HELP_STRING([--with-dbm],
[build DBM support (default yes)]),
[
case "${withval}" in
yes) enable_dbm="$all_dbm";;
no) enable_dbm=no;;
*) enable_dbm="$withval" ;;
esac])
AC_ARG_WITH([gdbm],
AC_HELP_STRING([--with-gdbm],
......@@ -570,8 +581,8 @@ check_dbm_impl() {
esac
}
if test "$enable_dbm" = no; then
enable_dbm="GDBM BDB TC NDBM"
if test -z "$enable_dbm"; then
enable_dbm=$all_dbm
fi
for impl in $enable_dbm
......@@ -1266,7 +1277,14 @@ MU_ENABLE_BUILD(comsat,,,["$mu_build_servers" = yes],,[server_list])
MU_ENABLE_BUILD(frm,,,["$mu_build_clients" = yes],,[client_list])
MU_ENABLE_BUILD(maidag,,,["$mu_build_clients" = yes],,[client_list])
MU_ENABLE_BUILD(mail,,,["$mu_build_clients" = yes],,[client_list])
AC_SUBST([MAILBINDIR],'${bindir}')
AC_ARG_WITH([mailbindir],
[AC_HELP_STRING([--with-mailbindir=DIR],
[install mail to DIR [[BINDIR]]])],
[MAILBINDIR=$withval])
MU_ENABLE_BUILD(sieve,,,["$mu_build_clients" = yes],,[client_list])
MU_ENABLE_BUILD(messages,,,["$mu_build_clients" = yes],,[client_list])
MU_ENABLE_BUILD(readmsg,,,["$mu_build_clients" = yes],,[client_list])
......
......@@ -19,7 +19,9 @@ AM_YFLAGS=-vt
INCLUDES = @MU_APP_COMMON_INCLUDES@ @MU_AUTHINCS@
AM_CFLAGS = -DSITE_MAIL_RC=\"@SITE_MAIL_RC@\"
bin_PROGRAMS = mail
mailbindir=@MAILBINDIR@
mailbin_PROGRAMS = mail
mail_LDADD = \
${MU_APP_LIBRARIES}\
......