m4.include/mc-subshell.m4: minor refactoring.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2021-03-21 16:29:59 +03:00
parent 0a26014ca4
commit 5fc84f2cfe
1 changed files with 17 additions and 9 deletions

View File

@ -8,20 +8,25 @@ AC_DEFUN([mc_SUBSHELL], [
[ --with-subshell Compile in concurrent subshell @<:@yes@:>@
--with-subshell=optional Don't run concurrent shell by default @<:@no@:>@],
[
result=no
if test x$withval = xoptional; then
AC_DEFINE(SUBSHELL_OPTIONAL, 1, [Define to make subshell support optional])
result="optional"
fi
if test x$withval = xyes; then
case "x$withval" in
xyes)
result="yes"
fi
;;
xoptional)
result="optional"
;;
*)
result="no"
;;
esac
],
[
dnl Default: enable the subshell support
result="yes"
])
AC_MSG_RESULT([$result])
if test "x$result" != xno; then
AC_DEFINE(ENABLE_SUBSHELL, 1, [Define to enable subshell support])
@ -33,9 +38,12 @@ AC_DEFUN([mc_SUBSHELL], [
LIBS="$LIBS -lutil"]
)
)
if test "x$result" = xoptional; then
AC_DEFINE(SUBSHELL_OPTIONAL, 1, [Define to make subshell support optional])
fi
fi
AC_MSG_RESULT([$result])
subshell="$result"
AM_CONDITIONAL(ENABLE_SUBSHELL, [test "x$result" != xno])