From 4bc798c21f1b4890b7dea51b47319af9386a11f3 Mon Sep 17 00:00:00 2001 From: Modestas Vainius Date: Sat, 8 Aug 2009 11:10:25 +0300 Subject: [PATCH] Support dpkg-buildpackage -jX parallel DEB_BUILD_OPTIONS. --- debian/changelog | 4 +++- debian/rules | 14 ++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 950c077c6..a8c6957d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,10 @@ cmake (2.6.4-2) UNRELEASED; urgency=low * Fix bashisms in CMake scripts (Closes: #530056). * Merge in 2.6.0-6 debian/changelog. * Use quilt.make rather than custom quilt patch implementation. + * Make debian/rules dpkg-buildpackage -jX safe and support parallel + in DEB_BUILD_OPTIONS (Closes: #538826). - -- Modestas Vainius Sat, 08 Aug 2009 11:02:22 +0300 + -- Modestas Vainius Sat, 08 Aug 2009 11:06:53 +0300 cmake (2.6.4-1) unstable; urgency=low diff --git a/debian/rules b/debian/rules index 208fba347..26b143d33 100755 --- a/debian/rules +++ b/debian/rules @@ -15,6 +15,12 @@ ifeq ($(shell arch),parisc64) CFLAGS += -ffunction-sections endif +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +MAKEFLAGS += -j$(NUMJOBS) +CONFIGURE_PARALLEL += --parallel=$(NUMJOBS) +endif + $(BUILD_FLAGS_FILE): touch $@ echo 'set(CMAKE_SKIP_RPATH YES CACHE BOOL "Skip rpath" FORCE)' >> $@ @@ -32,18 +38,18 @@ $(BUILD_FLAGS_FILE): $(if $(USE_DARTP),echo 'set(BUILDNAME "cmake_2.2.3-1_$(DARCH).deb" CACHE STRING "" FORCE)' >> $@) configure: configure-stamp -configure-stamp: $(BUILD_FLAGS_FILE) +configure-stamp: $(QUILT_STAMPFN) $(BUILD_FLAGS_FILE) dh_testdir # pre-load the cache to avoid setting rpath: rm -rf Build && mkdir -p Build cd Build && ../bootstrap --prefix=/usr --docdir=/share/doc/cmake --mandir=/share/man \ - --init=../$(BUILD_FLAGS_FILE) --system-libs + --init=../$(BUILD_FLAGS_FILE) --system-libs $(CONFIGURE_PARALLEL) chmod -x ChangeLog.manual chmod -x Modules/*.cmake Modules/*.cmake.in Modules/*.cxx Modules/Platform/* touch $@ -build: $(QUILT_STAMPFN) configure-stamp build-stamp -build-stamp: +build: build-stamp +build-stamp: configure-stamp dh_testdir cd Build && $(MAKE) $(if $(USE_DARTP),Experimental && $(MAKE) ExperimentalSubmit) touch $@