X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=autogen.sh;h=ea38dbf7ac901be9265427f4f91748fcfafebc09;hp=76eaef2f38cad05ffd41d0bd7291f51601efcac7;hb=63aab30b55d5809704a2d0e1c4e8de20e8228d7d;hpb=b55f996a9d756a84b7fb880df6a9b917215ea058 diff --git a/autogen.sh b/autogen.sh index 76eaef2f..ea38dbf7 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,13 +1,24 @@ #!/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 +aclocal -I . > /dev/null 2>&1 autoconf autoheader echo configuring... ./configure $@ > /dev/null echo compiling... -make clean2 &> /dev/null -make > /dev/null +make clean2 > /dev/null 2>&1 +make -j $n > /dev/null