From: Francesco Chemolli Date: Mon, 5 Oct 2009 13:22:17 +0000 (+0200) Subject: Implement testsuite parallelization on FreeBSD and testsuite parallelization override. X-Git-Tag: SQUID_3_2_0_1~662 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b890da4122faeab594e0a0d1114058ed83af6908;p=thirdparty%2Fsquid.git Implement testsuite parallelization on FreeBSD and testsuite 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}"