File: mc-subshell.m4

package info (click to toggle)
mc 3%3A4.8.29-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 23,056 kB
  • sloc: ansic: 98,016; sh: 8,293; perl: 2,325; makefile: 1,458; python: 410; cs: 44; lisp: 44; sed: 16
file content (50 lines) | stat: -rw-r--r-- 1,459 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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])
])