summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/ptxdist4
-rw-r--r--scripts/lib/ptxd_make_serialize.sh12
2 files changed, 15 insertions, 1 deletions
diff --git a/bin/ptxdist b/bin/ptxdist
index ea16e064a..f9e7d845d 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -2348,6 +2348,10 @@ setup_parallel() {
if [ -z "${PTXDIST_PARALLELMFLAGS}" ]; then
pmf_intern="${pmf_cpus}"
pmf_extern="-j1"
+ elif [ "${PTXDIST_PARALLELMFLAGS}" == "-j1" ]; then
+ unset PTXDIST_PARALLELMFLAGS
+ pmf_intern="-j1"
+ pmf_extern="-j1"
elif [ "${PTXDIST_PARALLELMFLAGS}" == "auto" ]; then
PTXDIST_PARALLELMFLAGS="${pmf_cpus}"
fi
diff --git a/scripts/lib/ptxd_make_serialize.sh b/scripts/lib/ptxd_make_serialize.sh
index ba8fb8bea..a9586df48 100644
--- a/scripts/lib/ptxd_make_serialize.sh
+++ b/scripts/lib/ptxd_make_serialize.sh
@@ -47,12 +47,22 @@ export -f ptxd_make_serialize_setup
ptxd_make_serialize_init() {
local num="${PTXDIST_PARALLELMFLAGS#-j}"
+ local sync
+
+ if make -h | grep -q -- --output-sync; then
+ sync="--output-sync="
+ fi
if [ -n "${num}" ]; then
ptxd_make_serialize_setup global "${num}" || return
- local mflags="-j --jobserver-fds=${ptxd_make_serialize_global_readfd},${ptxd_make_serialize_global_writefd}"
+ local mflags="${sync:+${sync}recurse} -j --jobserver-fds=${ptxd_make_serialize_global_readfd},${ptxd_make_serialize_global_writefd}"
PTXDIST_PARALLELMFLAGS_INTERN="${mflags}"
PTXDIST_PARALLELMFLAGS_EXTERN="${mflags}"
+ else
+ case "${PTXDIST_PARALLELMFLAGS_INTERN}" in
+ -j1) ;;
+ *) PTXDIST_PARALLELMFLAGS_INTERN="${PTXDIST_PARALLELMFLAGS_INTERN} ${sync:+${sync}target --no-print-directory}" ;;
+ esac
fi
ptxd_make_serialize_setup get 4 &&