Commit d78773a2 d78773a2f393697f81d2b6f1be832eadb7a05019 by Sergey Poznyakoff

Minor fixes.

* am/enable.m4 (MU_ENABLE_SUPPORT): Add the additional-cond argument.
(MU_ENABLE_BUILD): Likewise.
* configure.ac: Update 4th args in calls to MU_ENABLE_SUPPORT.
Do not use MU_ENABLE_BUILD within conditionals, use additional-cond
instead.
* libmailutils/stream/mapfile_stream.c: Include sys/stat.h
1 parent 0d002309
......@@ -16,29 +16,33 @@ dnl You should have received a copy of the GNU General Public License
dnl along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
dnl MU_ENABLE_SUPPORT(feature, [action-if-true], [action-if-false],
dnl [default-value])
dnl [additional-cond], [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,
[disable ]$1[ support]),
[
case "${enableval}" in
ifelse([$4],,,[if test $4; then])
AC_ARG_ENABLE($1,
AC_HELP_STRING([--disable-]$1,
[disable ]$1[ support]),
[
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([$4],,yes,[$4])])
esac],
[mu_cache_var=ifelse([$5],,yes,[$5])])
if test "[$]mu_cache_var" = "yes"; then
ifelse([$2],,:,[$2])
ifelse([$3],,,else
[$3])
fi
if test "[$]mu_cache_var" = "yes"; then
ifelse([$2],,:,[$2])
ifelse([$3],,,else
[$3])
fi
ifelse([$4],,,[else
mu_cache_var=no
fi])
if test "[$]mu_cache_var" = "yes"; then
AC_DEFINE([ENABLE_]mu_upcase,1,[Define this if you enable $1 support])
fi
......@@ -55,25 +59,30 @@ AC_DEFUN([MU_ENABLE_BUILD], [
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
ifelse([$4],,,[if test $4; then])
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],
esac],
[mu_cache_var=ifelse([$5],,yes,[$5])])
if test "[$]mu_cache_var" = "yes"; then
ifelse([$2],,:,[$2])
ifelse([$3],,,else
[$3])
fi
if test "[$]mu_cache_var" = "yes"; then
if test "[$]mu_cache_var" = "yes"; then
ifelse([$2],,:,[$2])
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
fi
ifelse([$4],,,[else
mu_cache_var=no
fi])
AM_CONDITIONAL(mu_cond,
[test "[$]mu_cache_var" = "yes"])
......
......@@ -810,7 +810,7 @@ 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_build_experimental])
["$mu_build_experimental" = "yes"])
MU_ENABLE_SUPPORT([mh],
[MU_LIB_MH='${top_builddir}/libproto/mh/libmu_mh.la'])
MU_ENABLE_SUPPORT([maildir],
......@@ -1141,7 +1141,7 @@ MU_ENABLE_SUPPORT(cxx,
[MU_CXX_EXAMPLES_BUILD='$(MU_CXX_EXAMPLES_LIST)'
MU_LIB_CPP='${top_builddir}/libmu_cpp/libmu_cpp.la'],
[],
[$mu_build_experimental])
["$mu_build_experimental" = "yes"])
# Default mailbox record
# Note: 1. Support for mbox type is always enabled.
......@@ -1185,18 +1185,14 @@ 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,,,[$useguile])
fi
MU_ENABLE_BUILD(guimb,,,["$useguile" = "yes"])
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
MU_ENABLE_BUILD(mh,,,["$mu_cv_enable_mh" = yes])
AC_SUBST(MH_BIN_DIR)
......
......@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <mailutils/types.h>
#include <mailutils/alloc.h>
......