(tree_move): fix coding style.
[midnight-commander.git] / m4.include / mc-subshell.m4
blob9f6734ca1bfe85a9d1d2dfbef6717349022c4371
1 dnl
2 dnl Subshell support.
3 dnl
4 AC_DEFUN([mc_SUBSHELL], [
6     AC_MSG_CHECKING([for subshell support])
7     AC_ARG_WITH(subshell,
8             [  --with-subshell          Compile in concurrent subshell @<:@yes@:>@
9   --with-subshell=optional Don't run concurrent shell by default @<:@no@:>@],
10             [
11                 case "x$withval" in
12                     xyes)
13                         result="yes"
14                         ;;
15                     xoptional)
16                         result="optional"
17                         ;;
18                     *)
19                         result="no"
20                         ;;
21                 esac
22             ],
23             [
24                 dnl Default: enable the subshell support
25                 result="yes"
26             ])
28     AC_MSG_RESULT([$result])
30     if test "x$result" != xno; then
31         AC_DEFINE(ENABLE_SUBSHELL, 1, [Define to enable subshell support])
33         dnl openpty() can simplify opening of master/slave devices for subshell
34         AC_CHECK_HEADERS([pty.h libutil.h util.h])
35         AC_CHECK_FUNCS(openpty,,
36             AC_CHECK_LIB(util,openpty,
37                 [AC_DEFINE(HAVE_OPENPTY)
38                     LIBS="$LIBS -lutil"]
39             )
40         )
42         if test "x$result" = xoptional; then
43             AC_DEFINE(SUBSHELL_OPTIONAL, 1, [Define to make subshell support optional])
44         fi
45     fi
47     subshell="$result"
49     AM_CONDITIONAL(ENABLE_SUBSHELL, [test "x$result" != xno])