ncurses: enable parallel build
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Wed, 28 May 2014 20:12:39 +0000 (17:12 -0300)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 1 Jun 2014 20:50:30 +0000 (22:50 +0200)
Using a trick taken from gentoo enable parallel build when building for
the target to reduce the build time for my test case from about 54s to
32s on a dual-core laptop.

[Peter: add comment explaining why]
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/ncurses/ncurses.mk

index 9805113802fbbfb3e597ad8175f940b393c8a01e..4bba8f1b3b22339f29ce5f53be9c1d2203a4067d 100644 (file)
@@ -45,8 +45,12 @@ ifneq ($(BR2_ENABLE_DEBUG),y)
 NCURSES_CONF_OPT += --without-debug
 endif
 
+# ncurses breaks with parallel build, but takes quite a while to
+# build single threaded. Work around it similar to how Gentoo does
 define NCURSES_BUILD_CMDS
-       $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR)
+       $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR) sources
+       rm -rf $(@D)/misc/pc-files
+       $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR)
 endef
 
 ifneq ($(BR2_PREFER_STATIC_LIB),y)