]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
improve parallel build support
authorJim Meyering <meyering@redhat.com>
Thu, 28 Aug 2008 09:08:44 +0000 (09:08 +0000)
committerJim Meyering <meyering@redhat.com>
Thu, 28 Aug 2008 09:08:44 +0000 (09:08 +0000)
* 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

ChangeLog
autobuild.sh
libvirt.spec.in

index ffe607a90ef000d53177d2a7e2aee5d7bb33521a..22830b756fee3dc4d917dd3d78e882ab954e225b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Thu Aug 28 11:08:15 CEST 2008 Jim Meyering <meyering@redhat.com>
+
+       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
+
 Wed Aug 27 20:50:00 EST 2008 Daniel P. Berrange <berrange@redhat.com>
 
        Storage pool source discovery from David Lively
index 7ae5d1e76a03a5f7370e2d3c9bf29eaf1a57d7ae..2fbecea8892dee52f0b85432369b274aa69d4345 100755 (executable)
@@ -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
 
index bac84a5b399b63cbdffa38eaab68104741c845c3..ba2447a26971871b174f4215a4e153319d2cbe34 100644 (file)
@@ -172,7 +172,7 @@ of recent versions of Linux (and other OSes).
            --with-init-script=redhat \
            --with-qemud-pid-file=%{_localstatedir}/run/libvirt_qemud.pid \
            --with-remote-file=%{_localstatedir}/run/libvirtd.pid
-make
+make %{?_smp_mflags}
 
 %install
 rm -fr %{buildroot}