Bug#199782: gcc-snapshot: Is there any reason why build doesn't use -j?
Package: gcc-snapshot
Version: 20030531-2
Severity: wishlist
Is there any particular reason why the Debian build
process doesn't use -j for multiple jobs? Attached is a patch
that keeps my machine busy and cuts the build time a bit.
-- System Information:
Debian Release: testing/unstable
Architecture: ia64
Kernel: Linux tartufi 2.5.72uni #17 SMP Wed Jul 2 16:03:07 EST 2003 ia64
Locale: LANG=C, LC_CTYPE=C
Versions of packages gcc-snapshot depends on:
ii binutils 2.14.90.0.4-0.1 The GNU assembler, linker and bina
ii libc6.1 2.3.1-17 GNU C Library: Shared libraries an
ii xlibs 4.2.1-8 X Window System client libraries
ii zlib1g 1:1.1.4-13 compression library - runtime
-- no debconf information
--- gcc-snapshot-20030531-orig/debian/rules2 2003-07-03 12:27:11.000000000 +1000
+++ gcc-snapshot-20030531/debian/rules2 2003-07-03 12:09:01.000000000 +1000
@@ -16,6 +16,10 @@
IP = install -p -m 755 # Install program
IS = install -p -m 755 # Install script
+#number of jobs to run for build
+NJOBS = $(shell if [ -f /proc/cpuinfo ] ; then echo `cat /proc/cpuinfo | grep 'processor' | wc -l` ; else echo 1 ; fi)
+
+
# the recipient for the test summaries. Send with: debian/rules mail-summary
S_EMAIL = gcc@packages.debian.org gcc-testresults@gcc.gnu.org $(shell whoami)
#S_EMAIL = gcc@packages.debian.org $(shell whoami)
@@ -227,7 +231,7 @@
( \
set +e; \
PATH=$(PWD)/bin:$$PATH \
- $(MAKE) -C $(builddir) bootstrap-lean \
+ $(MAKE) -C $(builddir) -j$(NJOBS) bootstrap-lean \
CC="$(CC)" CFLAGS="$(CFLAGS)" \
BOOT_CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(LDFLAGS)" \
STAGE1_CFLAGS="$(STAGE1_CFLAGS)" \
@@ -240,7 +244,7 @@
( \
set +e; \
PATH=$(PWD)/bin:$$PATH \
- $(MAKE) -C $(builddir) \
+ $(MAKE) -C -j$(NJOBS) $(builddir) \
LANGUAGES="$(shell echo $(enabled_languages)|tr -s ' ' ',')" \
CC="$(CC)" CFLAGS="$(CFLAGS)" \
BOOT_CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(LDFLAGS)" \
@@ -262,11 +266,11 @@
ifeq ($(with_shared_ada),yes)
LD_LIBRARY_PATH=$(builddir)/gcc/ada \
PATH=$(PWD)/bin:$$PATH \
- $(MAKE) -C $(builddir)/gcc gnatlib-shared gnatlib gnattools
+ $(MAKE) -j$(NJOBS) -C $(builddir)/gcc gnatlib-shared gnatlib gnattools
else
LD_LIBRARY_PATH=$(builddir)/gcc/ada \
PATH=$(PWD)/bin:$$PATH \
- $(MAKE) -C $(builddir)/gcc gnatlib gnattools
+ $(MAKE) -j$(NJOBS) -C $(builddir)/gcc gnatlib gnattools
endif
endif
Reply to: