Makefile.am  |    1 +
 configure.ac |   29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

New commits:
commit a329ce48651c3ee7d916275ee4d6150d4fafe2d5
Author: Andras Timar <andras.ti...@collabora.com>
Date:   Tue Feb 27 22:21:43 2018 +0100

    enable make parallelism
    
    Change-Id: Ie16a450bee6d718d8daf58194fbbd7dfd1ac2f38

diff --git a/Makefile.am b/Makefile.am
index e4c773253..a951c2d46 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,4 @@
+AM_MAKEFLAGS = @PARALLELISM_OPTION@
 SUBDIRS = . test loleaflet
 
 export ENABLE_DEBUG
diff --git a/configure.ac b/configure.ac
index 4921f9530..e91d4e74c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,6 +117,35 @@ AC_ARG_ENABLE([werror],
             AS_HELP_STRING([--disable-werror],
                           [Do not turn warnings into errors.]))
 
+AC_ARG_WITH(parallelism,
+    AS_HELP_STRING([--with-parallelism],
+        [Number of jobs to run simultaneously during build. Parallel builds can
+        save a lot of time on multi-cpu machines. Defaults to the number of
+        CPUs on the machine.]),
+,)
+
+# Number of CPUs to use during the build
+AC_MSG_CHECKING([for number of processors to use])
+# plain --with-parallelism is just the default
+if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
+    if test "$with_parallelism" = "no"; then
+        PARALLELISM=0
+    else
+        PARALLELISM=$with_parallelism
+    fi
+else
+    PARALLELISM=`getconf _NPROCESSORS_ONLN`
+fi
+
+if test $PARALLELISM -eq 0; then
+    AC_MSG_RESULT([explicit make -j option needed])
+    PARALLELISM_OPTION=
+else
+    AC_MSG_RESULT([$PARALLELISM])
+    PARALLELISM_OPTION="-j $PARALLELISM"
+fi
+AC_SUBST(PARALLELISM_OPTION)
+
 # Handle options
 AS_IF([test "$enable_debug" = yes -a -n "$with_poco_libs"],
       [POCO_DEBUG_SUFFIX=d],
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to