aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-08-28 09:08:44 +0000
committerJim Meyering <meyering@redhat.com>2008-08-28 09:08:44 +0000
commitff7ecc1d5b8a53702a48ed7367cf923dd4679b90 (patch)
tree8fe0ae7e832e9e991e922b6dc63f8915bae59e5a /autobuild.sh
parentAdd storage pool source discovery support (patch from David Lively) (diff)
downloadlibvirt-ff7ecc1d5b8a53702a48ed7367cf923dd4679b90.tar.gz
libvirt-ff7ecc1d5b8a53702a48ed7367cf923dd4679b90.tar.bz2
libvirt-ff7ecc1d5b8a53702a48ed7367cf923dd4679b90.zip
improve parallel build support
* autobuild.sh: Append -j$N to MAKEFLAGS, if no -j option is there. * libvirt.spec.in: Use %{?_smp_mflags} with "make". Based on a patch from James Morris: http://thread.gmane.org/gmane.comp.emulators.libvirt/8201
Diffstat (limited to 'autobuild.sh')
-rwxr-xr-xautobuild.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/autobuild.sh b/autobuild.sh
index 7ae5d1e76..2fbecea88 100755
--- a/autobuild.sh
+++ b/autobuild.sh
@@ -21,6 +21,18 @@ rm -rf coverage
--with-lxc \
--with-xen-proxy
+# If the MAKEFLAGS envvar does not yet include a -j option,
+# add -jN where N depends on the number of processors.
+case $MAKEFLAGS in
+ *-j*) ;;
+ *) n=$(getconf _NPROCESSORS_ONLN 2> /dev/null)
+ test "$n" -gt 0 || n=1
+ n=$(expr $n + 1)
+ MAKEFLAGS="$MAKEFLAGS -j$n"
+ export MAKEFLAGS
+ ;;
+esac
+
make
make install