commit 56e7bcfe9ba89ddfa8740b261db922f08e68c91e
Author: Pau Escrich <p4u@dabax.net>
Date:   Tue Jul 1 11:44:52 2014 +0200

    Parallel procs (-j) can be specified as a variable, if not the number of CPU cores is used

diff --git a/nightlycompile.sh b/nightlycompile.sh
index 940105a..2a87aad 100755
--- a/nightlycompile.sh
+++ b/nightlycompile.sh
@@ -38,6 +38,8 @@ make is_up_to_date QMP_GIT_BRANCH=$BRANCH >& /dev/null
 # Date of the last commit
 LAST_COMMIT_DATE=$(cd build/qmp && git log -1 origin/${BRANCH} --format="%ct")
 
+# Number of parallel procs
+[ -z "$J" ] && J=$(cat /proc/cpuinfo | grep -c processor)
 
 (cd build/qmp && git checkout $BRANCH)
 
@@ -55,7 +57,7 @@ for t in $TARGETS; do
 	}
 
 	echo "Compiling target $t"
-	nice -n 25 make T=$t build J=2 QMP_GIT_BRANCH=$BRANCH COMMUNITY=$COMMUNITY EXTRA_PACKS=$EXTRA_PACKS
+	nice -n 25 make T=$t build J=$J QMP_GIT_BRANCH=$BRANCH COMMUNITY=$COMMUNITY EXTRA_PACKS=$EXTRA_PACKS
 	[ $? -ne 0 ] && [ ! -z "$MAIL" ] && echo "Error detected during QMP compilation process (for target $t)" | mail -s "[qMp] build system" $MAIL && ./scripts/extra-packages.script POST_BUILD "ar71xx" $t $EXTRA_PACKS
 done
 
