[Libreoffice-commits] online.git: configure.ac Makefile.am
Andras Timar
andras.timar at collabora.com
Wed Feb 28 08:35:23 UTC 2018
Makefile.am | 1 +
configure.ac | 29 +++++++++++++++++++++++++++++
2 files changed, 30 insertions(+)
New commits:
commit 2e4ecfaf4475fd13c510c186f8f79c1cd38228c6
Author: Andras Timar <andras.timar at collabora.com>
Date: Tue Feb 27 22:21:43 2018 +0100
enable make parallelism
Change-Id: Ie16a450bee6d718d8daf58194fbbd7dfd1ac2f38
Reviewed-on: https://gerrit.libreoffice.org/50470
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/Makefile.am b/Makefile.am
index 6e6a847d7..db9ee34bd 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 0f1ffd5ca..ceff12d40 100644
--- a/configure.ac
+++ b/configure.ac
@@ -121,6 +121,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],
More information about the Libreoffice-commits
mailing list