cmake: restore parallel build support for bootstrap
authorFelix Fietkau <nbd@nbd.name>
Thu, 12 Jan 2017 13:31:40 +0000 (14:31 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 13 Jan 2017 09:23:43 +0000 (10:23 +0100)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
tools/cmake/Makefile
tools/cmake/patches/150-bootstrap_parallel_make_flag.patch [new file with mode: 0644]

index a1137c5b506682372ee66639bda86f1f74757fb9..c56cd40fb5a92b5240cacd0138b89d51ff6f65c6 100644 (file)
@@ -20,7 +20,9 @@ HOST_CONFIGURE_PARALLEL:=1
 include $(INCLUDE_DIR)/host-build.mk
 
 HOST_CONFIGURE_CMD := \
-       MAKEFLAGS="$(HOST_JOBS)" $(BASH) ./configure
+       MAKEFLAGS="$(HOST_JOBS)" \
+       $(BASH) ./configure \
+               $(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)")
 
 HOST_CONFIGURE_VARS :=
 
diff --git a/tools/cmake/patches/150-bootstrap_parallel_make_flag.patch b/tools/cmake/patches/150-bootstrap_parallel_make_flag.patch
new file mode 100644 (file)
index 0000000..6970b83
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/bootstrap
++++ b/bootstrap
+@@ -958,7 +958,10 @@ int main(){ printf("1%c", (char)0x0a); r
+ ' > "test.c"
+ cmake_original_make_flags="${cmake_make_flags}"
+ if [ "x${cmake_parallel_make}" != "x" ]; then
+-  cmake_make_flags="${cmake_make_flags} -j ${cmake_parallel_make}"
++  case "$cmake_paralle_make" in
++    [0-9]*) cmake_parallel_make="-j ${cmake_parallel_make}";;
++  esac
++  cmake_make_flags="${cmake_make_flags} ${cmake_parallel_make}"
+ fi
+ for a in ${cmake_make_processors}; do
+   if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then