Merge branch 't/oggdec_cleanups'
[paraslash.git] / autogen.sh
index a047f7c4d9f0bc704ade2ed049118c0eb3e02f7f..e5000a6fd70cddc63b1f2a2dc21f54bc760641bc 100755 (executable)
@@ -1,7 +1,13 @@
 #!/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
+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 +16,4 @@ echo configuring...
 ./configure $@ > /dev/null
 echo compiling...
 make clean2 > /dev/null 2>&1
-make > /dev/null
+make -j $n > /dev/null