X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=autogen.sh;h=caf1401d8bf02e2d299bdcdf58ae902cfb260092;hp=5c3d931d8a4e43c99e46d9b20031d7ee30fe6ccc;hb=4e50b2401961b6ecc10f5e57d93b376401115395;hpb=c37c3422065b07b906a015537ac93169ee19efea diff --git a/autogen.sh b/autogen.sh index 5c3d931d..caf1401d 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,12 +1,28 @@ #!/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 -autoconf -autoheader +autom4te \ + --language=autoconf \ + --output=configure \ + --no-cache \ + --warnings=all \ + configure.ac +autoheader echo configuring... ./configure $@ > /dev/null echo compiling... -make clean all > /dev/null +make clean > /dev/null 2>&1 +make -j $n > /dev/null && make check