net: Further simplify makesock_addrinfo().
[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 autoconf
18 autoheader
19 echo configuring...
20 ./configure $@ > /dev/null
21 echo compiling...
22 make clean2 > /dev/null 2>&1
23 make -j $n > /dev/null