From 5fc84f2cfe03a44c2a071ee449cc1feece5bb713 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 21 Mar 2021 16:29:59 +0300 Subject: [PATCH] m4.include/mc-subshell.m4: minor refactoring. Signed-off-by: Andrew Borodin --- m4.include/mc-subshell.m4 | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/m4.include/mc-subshell.m4 b/m4.include/mc-subshell.m4 index 6c17be6f9..9f6734ca1 100644 --- a/m4.include/mc-subshell.m4 +++ b/m4.include/mc-subshell.m4 @@ -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 - result="yes" - fi + case "x$withval" in + xyes) + result="yes" + ;; + 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])