summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bashrc8
1 files changed, 7 insertions, 1 deletions
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"