summaryrefslogtreecommitdiffstats
path: root/m4.include/mc-subshell.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:12 +0000
commit8ccb487c21368a7fdc8c7c72315325bf0aa06147 (patch)
treeb2056fae01d325924508a41731edfbd4c3cddd23 /m4.include/mc-subshell.m4
parentInitial commit. (diff)
downloadmc-8ccb487c21368a7fdc8c7c72315325bf0aa06147.tar.xz
mc-8ccb487c21368a7fdc8c7c72315325bf0aa06147.zip
Adding upstream version 3:4.8.29.upstream/3%4.8.29upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--m4.include/mc-subshell.m450
1 files changed, 50 insertions, 0 deletions
diff --git a/m4.include/mc-subshell.m4 b/m4.include/mc-subshell.m4
new file mode 100644
index 0000000..9f6734c
--- /dev/null
+++ b/m4.include/mc-subshell.m4
@@ -0,0 +1,50 @@
+dnl
+dnl Subshell support.
+dnl
+AC_DEFUN([mc_SUBSHELL], [
+
+ 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@:>@],
+ [
+ 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])
+
+ 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"]
+ )
+ )
+
+ if test "x$result" = xoptional; then
+ AC_DEFINE(SUBSHELL_OPTIONAL, 1, [Define to make subshell support optional])
+ fi
+ fi
+
+ subshell="$result"
+
+ AM_CONDITIONAL(ENABLE_SUBSHELL, [test "x$result" != xno])
+])