mx-test.sh: disable an unset $JOBMON for bmake(1)! (Simon Gerraty)
authorSteffen Nurpmeso <steffen@sdaoden.eu>
Sat, 19 Dec 2020 00:01:06 +0000 (01:01 +0100)
committerSteffen Nurpmeso <steffen@sdaoden.eu>
Sat, 19 Dec 2020 00:04:01 +0000 (01:04 +0100)
mx-test.sh

index f1ed02b3db9860a02cc689280c7ea28945970a7c..bfd7a381c94f2d67a6e0b42dad5aadbceb122e20 100755 (executable)
@@ -413,10 +413,30 @@ fi
 
 case "${JOBMON}" in
 [yY]*)
-   if (set -m >/dev/null 2>&1); then
+   # BSD make cannot monitor shells which monitor
+   i=
+   ( ${MAKE} -p ) >/dev/null 2>&1
+   if [ ${?} -ne 0 ]; then
+      ${cat} > .t.mk.mon <<'_EOT'
+all:
+       @printf ''
+ifdef .PARSEDIR
+.if defined(.PARSEDIR)
+       @echo yes
+.endif
+endif
+_EOT
+      i=`${MAKE} -f .t.mk.mon 2>/dev/null`
+      if [ ${?} -ne 0 ] || [ -n "${i}" ]; then
+         i="${MAKE} cannot supervise sh(1)ells with"
+      fi
+   fi
+
+   if [ -z "${i}" ] && (set -m >/dev/null 2>&1); then
       JOBMON=y
    else
-      echo >&2 'Cannot use monitor mode (set -m) in sh(1).'
+      [ -z "${i}" ] && i="${SHELL} does not support"
+      echo >&2 ${i}" \"set -m[onitor]\"!"
       echo >&2 'Failing (hanging) tests could leave stale processes around!'
       JOBMON=
    fi
This page took 0.067038 seconds and 4 git commands to generate.