mc-subshell.m4 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. result=no
  11. if test x$withval = xoptional; then
  12. AC_DEFINE(SUBSHELL_OPTIONAL, 1, [Define to make subshell support optional])
  13. result="optional"
  14. fi
  15. if test x$withval = xyes; then
  16. result="yes"
  17. fi
  18. ],
  19. [
  20. dnl Default: enable the subshell support
  21. result="yes"
  22. ])
  23. if test "x$result" != xno; then
  24. AC_DEFINE(ENABLE_SUBSHELL, 1, [Define to enable subshell support])
  25. dnl openpty() can simplify opening of master/slave devices for subshell
  26. AC_CHECK_HEADERS([pty.h libutil.h util.h])
  27. AC_CHECK_FUNCS(openpty,,
  28. AC_CHECK_LIB(util,openpty,
  29. [AC_DEFINE(HAVE_OPENPTY)
  30. LIBS="$LIBS -lutil"]
  31. )
  32. )
  33. fi
  34. AC_MSG_RESULT([$result])
  35. subshell="$result"
  36. AM_CONDITIONAL(ENABLE_SUBSHELL, [test "x$result" != xno])
  37. ])