]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Francesco Chemolli <kinkie@squid-cache.org>
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 29 Oct 2009 08:03:40 +0000 (21:03 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 29 Oct 2009 08:03:40 +0000 (21:03 +1300)
TestBed: Implement parallelization on FreeBSD and parallelization override.

test-suite/buildtest.sh

index 41537015f1d00ff42acc330a58d6839fe2b55355..d71fab3dbc711bbed7db8326aaab7a94dd9bbcc8 100755 (executable)
@@ -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}"