From 1265932819df8f3c010d011d13ead6ff59b41e7c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 11 Apr 2020 11:02:20 +0100 Subject: Consider distcc when calculating number of tasks --- bashrc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index 01a8844..64efbbc 100644 --- a/bashrc +++ b/bashrc @@ -62,7 +62,13 @@ sizes() { PATH="/usr/lib/ccache/bin:$PATH" CORES=$(grep core\ id /proc/cpuinfo | sort -u | wc -l) CPUS=$(grep core\ id /proc/cpuinfo -c) -TASKS=$((($CORES + $CPUS) / 2)) +if [ -n "$DISTCC_HOSTS" ] ; then + TASKS=$(echo $DISTCC_HOSTS | tr ' ' '\n' | cut -d / -f2 | paste -s -d+ | bc) +elif [ -x /usr/bin/distcc ] ; then + TASKS=$(distcc -j) +else + TASKS=$((($CORES + $CPUS) / 2)) +fi export FEATURES="ccache" alias :e="gvim" alias d="cd ~/dev" -- cgit v1.2.3