From d96a038e8b2bce971192669f3ea3965612678633 Mon Sep 17 00:00:00 2001 From: Herbert Thielen Date: Mon, 4 Sep 2017 18:19:06 +0200 Subject: [PATCH] set MAKEFLAGS to use multiple processors on Travis CI --- travis.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/travis.sh b/travis.sh index bd226a8d..3a6c297a 100755 --- a/travis.sh +++ b/travis.sh @@ -1,5 +1,16 @@ #!/usr/bin/env sh set -evx + +# if possible, ask for the precise number of processors, +# otherwise take 2 processors as reasonable default; see +# https://docs.travis-ci.com/user/speeding-up-the-build/#Makefile-optimization +if [ -x /usr/bin/getconf ]; then + MAKEFLAGS=j$(/usr/bin/getconf _NPROCESSORS_ONLN) +else + MAKEFLAGS="j2" +fi +export MAKEFLAGS + env | sort mkdir build || true