[Build-common-hackers] Bug#240981: cdbs: [PATCH] DEB_MAKE_JOBS variable added for parallel builds

Eric Wong Eric Wong <eric@petta-tech.com>, 240981@bugs.debian.org
Thu, 08 Apr 2004 01:30:10 -0700


Package: cdbs
Version: 0.4.21
Severity: wishlist
Followup-For: Bug #240981


I trivially added the DEB_MAKE_JOBS variable to support parallel builds
in the upstream build process.  It defaults to 1 so people won't notice
a difference if they don't set it. I'm not sure how the rest of CDBS
supports parallelization, but that could be worth looking into, too.

My GNU Arch archive and patch info of merging:
name: normalperson@yhbt.net--2004a-ordinary
location: http://des.petta-tech.bogomips.org/~eric/{ordinary}
patch: cdbs--parallel--0--patch-2

Btw, where is: build-common-hackers@lists.alioth.debian.org--2004 ?
I couldn't find it, so I tla-forked off dilinger's tree at
mirrors.sourcecontrol.net and applied a delta that I made with the
0.4.21 source.  Might be useful to put the address in a readme
somewhere.

Patch is also attached below:

--- orig/1/class/autotools.mk.in
+++ mod/1/class/autotools.mk.in
@@ -29,7 +29,7 @@
 
 # Overriden from makefile-vars.mk.  We pass CFLAGS and friends to ./configure, so
 # no need to pass them to make.
-DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) make -C $(DEB_BUILDDIR)
+DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) make -j$(DEB_MAKE_JOBS) -C $(DEB_BUILDDIR)
 
 common-configure-arch common-configure-indep:: common-configure-impl
 common-configure-impl:: $(DEB_BUILDDIR)/config.status


--- orig/1/class/makefile-vars.mk.in
+++ mod/1/class/makefile-vars.mk.in
@@ -28,7 +28,8 @@
 include $(_cdbs_class_path)/langcore.mk$(_cdbs_makefile_suffix)
 
 DEB_MAKE_ENVVARS = 
-DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) make -C $(DEB_BUILDDIR) CFLAGS=$(if $(CFLAGS_$(cdbs_curpkg)),"$(CFLAGS_$(cdbs_curpkg))","$(CFLAGS)") CXXFLAGS=$(if $(CXXFLAGS_$(cdbs_curpkg)),"$(CXXFLAGS_$(cdbs_curpkg))","$(CXXFLAGS)") 
+DEB_MAKE_JOBS ?= 1
+DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) make -j$(DEB_MAKE_JOBS) -C $(DEB_BUILDDIR) CFLAGS=$(if $(CFLAGS_$(cdbs_curpkg)),"$(CFLAGS_$(cdbs_curpkg))","$(CFLAGS)") CXXFLAGS=$(if $(CXXFLAGS_$(cdbs_curpkg)),"$(CXXFLAGS_$(cdbs_curpkg))","$(CXXFLAGS)") 
 
 # This variable is deprecated.
 DEB_BUILD_MAKE_TARGET = 


--- orig/1/class/makefile.mk.in
+++ mod/1/class/makefile.mk.in
@@ -43,7 +43,7 @@
 common-install-arch common-install-indep:: common-install-impl
 common-install-impl::
 	@if test -n "$(DEB_MAKE_INSTALL_TARGET)"; then \
-	  echo $(DEB_MAKE_ENVVARS) make -C $(DEB_BUILDDIR) $(DEB_MAKE_INSTALL_TARGET); \
+	  echo $(DEB_MAKE_ENVVARS) make -j$(DEB_MAKE_JOBS) -C $(DEB_BUILDDIR) $(DEB_MAKE_INSTALL_TARGET); \
 	  $(DEB_MAKE_INVOKE) $(DEB_MAKE_INSTALL_TARGET); \
 	 else \
 	   echo "DEB_MAKE_INSTALL_TARGET unset, skipping default makefile.mk common-install target"; \