Merge branch 't/map_populate'
[paraslash.git] / autogen.sh
1 #!/bin/sh
2 # check if we have multiple processors/cores
3 n=$(nproc 2>/dev/null)
4 if [ -z "$n" ]; then
5 n=$(grep ^processor /proc/cpuinfo 2>/dev/null | wc -l)
6 [ $n -eq 0 ] && n=1
7 fi
8 # If we are compiling with distcc, try to guess a reasonable number
9 # based on (a) the number of cores on this machine and (b) the number
10 # of words in the DISTCC_HOSTS variable.
11 d="$(echo $DISTCC_HOSTS | wc -w)"
12 n=$(($n + 2 * $n * $d))
13 echo preparing, parallel=$n...
14 if test -f Makefile; then
15 make maintainer-clean > /dev/null 2>&1
16 fi
17 aclocal -I . > /dev/null 2>&1
18 autoconf
19 autoheader
20 echo configuring...
21 ./configure $@ > /dev/null
22 echo compiling...
23 make clean2 > /dev/null 2>&1
24 make -j $n > /dev/null