X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=autogen.sh;h=ea38dbf7ac901be9265427f4f91748fcfafebc09;hp=a047f7c4d9f0bc704ade2ed049118c0eb3e02f7f;hb=53077ea78f01e197e84529ae42558af5c3a68429;hpb=53a605a8fb41234ce3ee58e505373fae334335eb;ds=sidebyside diff --git a/autogen.sh b/autogen.sh index a047f7c4..ea38dbf7 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,7 +1,18 @@ #!/bin/sh -echo preparing... +# check if we have multiple processors/cores +n=$(nproc 2>/dev/null) +if [ -z "$n" ]; then + n=$(grep ^processor /proc/cpuinfo 2>/dev/null | wc -l) + [ $n -eq 0 ] && n=1 +fi +# If we are compiling with distcc, try to guess a reasonable number +# based on (a) the number of cores on this machine and (b) the number +# of words in the DISTCC_HOSTS variable. +d="$(echo $DISTCC_HOSTS | wc -w)" +n=$(($n + 2 * $n * $d)) +echo preparing, parallel=$n... if test -f Makefile; then - make maintainer-clean > /dev/null + make maintainer-clean > /dev/null 2>&1 fi aclocal -I . > /dev/null 2>&1 autoconf @@ -10,4 +21,4 @@ echo configuring... ./configure $@ > /dev/null echo compiling... make clean2 > /dev/null 2>&1 -make > /dev/null +make -j $n > /dev/null