diff mbox

ncurses: enable parallel build

Message ID 1401307959-19956-1-git-send-email-gustavo@zacarias.com.ar
State Accepted
Headers show

Commit Message

Gustavo Zacarias May 28, 2014, 8:12 p.m. UTC
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.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/ncurses/ncurses.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Thomas Petazzoni June 1, 2014, 12:28 p.m. UTC | #1
Dear Gustavo Zacarias,

On Wed, 28 May 2014 17:12:39 -0300, Gustavo Zacarias wrote:
> 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.
> 
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>

Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Without the patch:

real	0m29.326s
user	0m23.549s
sys	0m8.617s

With the patch:

real	0m18.839s
user	0m40.948s
sys	0m10.707s

A reduction of 11 seconds of the real build time, on a quad-core i7
laptop.

Best regards,

Thomas
Peter Korsgaard June 1, 2014, 9:08 p.m. UTC | #2
>>>>> "Gustavo" == Gustavo Zacarias <gustavo@zacarias.com.ar> writes:

 > 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.

 > Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>

I'm personally not convinced that the extra complexity is worth the
10-20s faster build in the context of a 30m-1h Buildroot build - But ok,
you guys do and atleast it is selfcontained.

 > ---
 >  package/ncurses/ncurses.mk | 4 +++-
 >  1 file changed, 3 insertions(+), 1 deletion(-)

 > diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
 > index 9805113..8e4b9e7 100644
 > --- a/package/ncurses/ncurses.mk
 > +++ b/package/ncurses/ncurses.mk
 > @@ -46,7 +46,9 @@ NCURSES_CONF_OPT += --without-debug
 >  endif

I've added a comment above explaining where this magic comes from and
committed, thanks.
 
 >  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)
 > -- 
 > 1.8.5.5

 > _______________________________________________
 > buildroot mailing list
 > buildroot@busybox.net
 > http://lists.busybox.net/mailman/listinfo/buildroot
diff mbox

Patch

diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
index 9805113..8e4b9e7 100644
--- a/package/ncurses/ncurses.mk
+++ b/package/ncurses/ncurses.mk
@@ -46,7 +46,9 @@  NCURSES_CONF_OPT += --without-debug
 endif
 
 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)