[PATCH] wineinstall - Add support for parallel builds using 'nproc' to detect cpu count

Chris Morgan chmorgan at gmail.com
Thu Feb 23 19:30:17 CST 2017


Parallel builds can greatly reduce the overall build time on modern multi-core processors.

Fall back to two parallel builds in the case where nproc is unavailable, most modern
processors have at least two cores.
---
 tools/wineinstall | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/wineinstall b/tools/wineinstall
index e8e22bf..370a29f 100755
--- a/tools/wineinstall
+++ b/tools/wineinstall
@@ -143,10 +143,18 @@ echo "in the meantime..."
 echo
 std_sleep
 
+# determine ideal number of parallel processes
+if [ -x `which nproc 2>/dev/null` ]
+then
+    NPROC=$(nproc --all)
+else
+    NPROC=2
+fi
+
 # try to just make wine, if this fails 'make depend' and try to remake
-if ! { make; }
+if ! { make -j$NPROC; }
 then
-    if ! { make depend && make; }
+    if ! { make depend && make -j$NPROC; }
     then
       echo
       echo "Compilation failed, aborting install."
-- 
2.9.3




More information about the wine-patches mailing list