From: Amos Jeffries Date: Thu, 29 Oct 2009 08:03:40 +0000 (+1300) Subject: Author: Francesco Chemolli X-Git-Tag: SQUID_3_1_0_15~54 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=37d704bf57e7ceb3302076aa7e64f4d107f1af80;p=thirdparty%2Fsquid.git Author: Francesco Chemolli TestBed: Implement parallelization on FreeBSD and parallelization override. --- diff --git a/test-suite/buildtest.sh b/test-suite/buildtest.sh index 41537015f1..d71fab3dbc 100755 --- a/test-suite/buildtest.sh +++ b/test-suite/buildtest.sh @@ -10,12 +10,18 @@ config="${1}" base="`dirname ${0}`" #if we are on Linux, let's try parallelizing -pjobs="" #default -if [ -e /proc/cpuinfo ]; then +if [ -z "$pjobs" -a -e /proc/cpuinfo ]; then ncpus=`grep '^processor' /proc/cpuinfo | tail -1|awk '{print $3}'` ncpus=`expr ${ncpus} + 1` pjobs="-j${ncpus}" fi +#if we are on FreeBSD, let's try parallelizing +if [ -z "$pjobs" -a -x /sbin/sysctl ]; then + ncpus=`sysctl kern.smp.cpus | cut -f2 -d" "` + if [ $? -eq 0 -a -n $ncpus -a $ncpus -gt 1 ]; then + pjobs="-j${ncpus}" + fi +fi if test -e ${config} ; then echo "BUILD: ${config}"