chiark / gitweb /
bin/mdw-build: Do parallel builds as instructed by DEB_BUILD_OPTIONS.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 Jan 2012 10:01:18 +0000 (10:01 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 26 Jan 2012 10:01:18 +0000 (10:01 +0000)
This wants to be set right anyway for the Debian build, and it's better
to say such things only once.

bin/mdw-build

index bcd2ac68150f1d8886e564bd356f0e5cda43d65e..2c4edaa17e04cab25a048b1716f691590d7eef85 100755 (executable)
@@ -113,6 +113,18 @@ for opt; do
   esac
 done
 
+## Parse DEB_BUILD_OPTIONS.
+jobs=1
+set -- $DEB_BUILD_OPTIONS
+for opt; do
+  case "$opt" in
+    parallel=*) jobs=${opt#*=} ;;
+  esac
+done
+
+makeopts=""
+case $jobs in 1) ;; *) makeopts="$makeopts -j$jobs" ;; esac
+
 ###--------------------------------------------------------------------------
 ### Utility functions.
 
@@ -268,10 +280,10 @@ assign distdir $(make -f find-distdir.mk print-distdir)
 ## Get a tarball distribution.
 case "$distcheck" in
   yes)
-    run make distcheck
+    run make $makeopts distcheck
     ;;
   no)
-    run make dist
+    run make $makeopts dist
     ;;
 esac