]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Implement testsuite parallelization on FreeBSD and testsuite parallelization override.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 5 Oct 2009 13:22:17 +0000 (15:22 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 5 Oct 2009 13:22:17 +0000 (15:22 +0200)
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}"