mc-subshell.m4 1.4 KB

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