X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/e503a4d5ac668d233c11f64a0dd0c6d20f3b2be1..77c35637ea85a065da3bcf57a4a8921cf2ad04f0:/debian/rules?ds=inline

diff --git a/debian/rules b/debian/rules
index f031cfddb..ce7d19dec 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,6 +9,7 @@ export NOISY=1
 export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+export PARALLEL = $(or $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))),1)
 
 # FOR AUTOCONF 2.52 AND NEWER ONLY
 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
@@ -17,6 +18,9 @@ else
   confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
 endif
 
+# Set the number of procs to be run in parallel from the options.
+confflags += --with-procs=$(PARALLEL)
+
 # See below
 -include build/environment.mak
 
@@ -56,6 +60,11 @@ ifeq ($(words $(BLD)),0)
 override BLD := ./build
 endif
 
+# When building without <nocheck>, the header is available and thus the test is
+# successful. When building with <nocheck>, the header is missing, but we still
+# pretend it to be available, because configure would fail otherwise.
+export ac_cv_header_gtest_gtest_h=yes
+
 # APT Programs in apt-utils
 APT_UTILS=ftparchive sortpkgs extracttemplates
 
@@ -85,7 +94,7 @@ build/environment.mak: build/configure-stamp
 configure: configure.ac
 build/configure-stamp: configure buildlib/config.sub buildlib/config.guess
 	dh_testdir
-	-mkdir build
+	mkdir -p build
 	cp COPYING debian/copyright
 	cd build && CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" ../configure $(confflags)
 	touch $@