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], [ ...@@ -59,30 +59,31 @@ AC_DEFUN([MU_ENABLE_BUILD], [
59 pushdef([mu_cache_var],[mu_cv_enable_build_]translit($1,[+-],[x_])) 59 pushdef([mu_cache_var],[mu_cv_enable_build_]translit($1,[+-],[x_]))
60 pushdef([mu_cond],[MU_COND_]mu_upcase) 60 pushdef([mu_cond],[MU_COND_]mu_upcase)
61 61
62 ifelse([$4],,,[if test $4; then]) 62 AC_ARG_ENABLE(build-$1,
63 AC_ARG_ENABLE(build-$1, 63 AC_HELP_STRING([--disable-build-]$1,
64 AC_HELP_STRING([--disable-build-]$1, 64 [do not build ]$1),
65 [do not build ]$1),
66 [ 65 [
67 case "${enableval}" in 66 case "${enableval}" in
68 yes) mu_cache_var=yes;; 67 yes) mu_cache_var=yes;;
69 no) mu_cache_var=no;; 68 no) mu_cache_var=no;;
70 *) AC_MSG_ERROR([bad value ${enableval} for --disable-$1]) ;; 69 *) AC_MSG_ERROR([bad value ${enableval} for --disable-$1]) ;;
71 esac], 70 esac],
72 [mu_cache_var=ifelse([$5],,yes,[$5])]) 71 [ifelse([$4],,[mu_cache_var=ifelse([$5],,yes,[$5])],
72 [if test $4; then
73 mu_cache_var=yes
74 else
75 mu_cache_var=no
76 fi])])
73 77
74 if test "[$]mu_cache_var" = "yes"; then 78 if test "[$]mu_cache_var" = "yes"; then
75 ifelse([$2],,:,[$2]) 79 ifelse([$2],,:,[$2])
76 ifelse([$6],,,[$6="$[]$6 $1"]) 80 ifelse([$6],,,[$6="$[]$6 $1"])
77 ifelse([$3],,,else 81 ifelse([$3],,,else
78 [$3]) 82 [$3])
79 fi 83 fi
80 if test "[$]mu_cache_var" = "yes"; then 84 if test "[$]mu_cache_var" = "yes"; then
81 AC_DEFINE([MU_BUILD_]mu_upcase,1,[Define this if you build $1]) 85 AC_DEFINE([MU_BUILD_]mu_upcase,1,[Define this if you build $1])
82 fi 86 fi
83 ifelse([$4],,,[else
84 mu_cache_var=no
85 fi])
86 87
87 AM_CONDITIONAL(mu_cond, 88 AM_CONDITIONAL(mu_cond,
88 [test "[$]mu_cache_var" = "yes"]) 89 [test "[$]mu_cache_var" = "yes"])
......
...@@ -358,8 +358,19 @@ AC_SUBST(DBMLIBS) ...@@ -358,8 +358,19 @@ AC_SUBST(DBMLIBS)
358 AC_SUBST(DBMLIB_DEPENDENCY) 358 AC_SUBST(DBMLIB_DEPENDENCY)
359 AC_SUBST(DBMINCLUDES) 359 AC_SUBST(DBMINCLUDES)
360 360
361 enable_dbm=no 361 enable_dbm=
362 disable_dbm=no 362 disable_dbm=no
363 all_dbm="GDBM BDB TC NDBM"
364
365 AC_ARG_WITH([dbm],
366 AC_HELP_STRING([--with-dbm],
367 [build DBM support (default yes)]),
368 [
369 case "${withval}" in
370 yes) enable_dbm="$all_dbm";;
371 no) enable_dbm=no;;
372 *) enable_dbm="$withval" ;;
373 esac])
363 374
364 AC_ARG_WITH([gdbm], 375 AC_ARG_WITH([gdbm],
365 AC_HELP_STRING([--with-gdbm], 376 AC_HELP_STRING([--with-gdbm],
...@@ -570,8 +581,8 @@ check_dbm_impl() { ...@@ -570,8 +581,8 @@ check_dbm_impl() {
570 esac 581 esac
571 } 582 }
572 583
573 if test "$enable_dbm" = no; then 584 if test -z "$enable_dbm"; then
574 enable_dbm="GDBM BDB TC NDBM" 585 enable_dbm=$all_dbm
575 fi 586 fi
576 587
577 for impl in $enable_dbm 588 for impl in $enable_dbm
...@@ -1266,7 +1277,14 @@ MU_ENABLE_BUILD(comsat,,,["$mu_build_servers" = yes],,[server_list]) ...@@ -1266,7 +1277,14 @@ MU_ENABLE_BUILD(comsat,,,["$mu_build_servers" = yes],,[server_list])
1266 1277
1267 MU_ENABLE_BUILD(frm,,,["$mu_build_clients" = yes],,[client_list]) 1278 MU_ENABLE_BUILD(frm,,,["$mu_build_clients" = yes],,[client_list])
1268 MU_ENABLE_BUILD(maidag,,,["$mu_build_clients" = yes],,[client_list]) 1279 MU_ENABLE_BUILD(maidag,,,["$mu_build_clients" = yes],,[client_list])
1280
1269 MU_ENABLE_BUILD(mail,,,["$mu_build_clients" = yes],,[client_list]) 1281 MU_ENABLE_BUILD(mail,,,["$mu_build_clients" = yes],,[client_list])
1282 AC_SUBST([MAILBINDIR],'${bindir}')
1283 AC_ARG_WITH([mailbindir],
1284 [AC_HELP_STRING([--with-mailbindir=DIR],
1285 [install mail to DIR [[BINDIR]]])],
1286 [MAILBINDIR=$withval])
1287
1270 MU_ENABLE_BUILD(sieve,,,["$mu_build_clients" = yes],,[client_list]) 1288 MU_ENABLE_BUILD(sieve,,,["$mu_build_clients" = yes],,[client_list])
1271 MU_ENABLE_BUILD(messages,,,["$mu_build_clients" = yes],,[client_list]) 1289 MU_ENABLE_BUILD(messages,,,["$mu_build_clients" = yes],,[client_list])
1272 MU_ENABLE_BUILD(readmsg,,,["$mu_build_clients" = yes],,[client_list]) 1290 MU_ENABLE_BUILD(readmsg,,,["$mu_build_clients" = yes],,[client_list])
......
...@@ -19,7 +19,9 @@ AM_YFLAGS=-vt ...@@ -19,7 +19,9 @@ AM_YFLAGS=-vt
19 INCLUDES = @MU_APP_COMMON_INCLUDES@ @MU_AUTHINCS@ 19 INCLUDES = @MU_APP_COMMON_INCLUDES@ @MU_AUTHINCS@
20 AM_CFLAGS = -DSITE_MAIL_RC=\"@SITE_MAIL_RC@\" 20 AM_CFLAGS = -DSITE_MAIL_RC=\"@SITE_MAIL_RC@\"
21 21
22 bin_PROGRAMS = mail 22 mailbindir=@MAILBINDIR@
23
24 mailbin_PROGRAMS = mail
23 25
24 mail_LDADD = \ 26 mail_LDADD = \
25 ${MU_APP_LIBRARIES}\ 27 ${MU_APP_LIBRARIES}\
......