2012-10-19 19:24:57 +04:00
|
|
|
dnl
|
|
|
|
dnl Subshell support.
|
|
|
|
dnl
|
2016-01-04 21:43:19 +03:00
|
|
|
AC_DEFUN([mc_SUBSHELL], [
|
2012-10-19 19:24:57 +04:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([for subshell support])
|
|
|
|
AC_ARG_WITH(subshell,
|
|
|
|
[ --with-subshell Compile in concurrent subshell @<:@yes@:>@
|
|
|
|
--with-subshell=optional Don't run concurrent shell by default @<:@no@:>@],
|
|
|
|
[
|
2021-03-21 16:29:59 +03:00
|
|
|
case "x$withval" in
|
|
|
|
xyes)
|
|
|
|
result="yes"
|
|
|
|
;;
|
|
|
|
xoptional)
|
|
|
|
result="optional"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
result="no"
|
|
|
|
;;
|
|
|
|
esac
|
2012-10-19 19:24:57 +04:00
|
|
|
],
|
|
|
|
[
|
|
|
|
dnl Default: enable the subshell support
|
|
|
|
result="yes"
|
|
|
|
])
|
|
|
|
|
2021-03-21 16:29:59 +03:00
|
|
|
AC_MSG_RESULT([$result])
|
|
|
|
|
2012-10-19 19:24:57 +04:00
|
|
|
if test "x$result" != xno; then
|
|
|
|
AC_DEFINE(ENABLE_SUBSHELL, 1, [Define to enable subshell support])
|
2018-09-04 13:52:10 +03:00
|
|
|
|
|
|
|
dnl openpty() can simplify opening of master/slave devices for subshell
|
|
|
|
AC_CHECK_HEADERS([pty.h libutil.h util.h])
|
|
|
|
AC_CHECK_FUNCS(openpty,,
|
|
|
|
AC_CHECK_LIB(util,openpty,
|
|
|
|
[AC_DEFINE(HAVE_OPENPTY)
|
|
|
|
LIBS="$LIBS -lutil"]
|
|
|
|
)
|
|
|
|
)
|
2021-03-21 16:29:59 +03:00
|
|
|
|
|
|
|
if test "x$result" = xoptional; then
|
|
|
|
AC_DEFINE(SUBSHELL_OPTIONAL, 1, [Define to make subshell support optional])
|
|
|
|
fi
|
2012-10-19 19:24:57 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
subshell="$result"
|
|
|
|
|
|
|
|
AM_CONDITIONAL(ENABLE_SUBSHELL, [test "x$result" != xno])
|
|
|
|
])
|