honor dpkg-buildflags and DEB_BUILD_OPTIONS better, #727196
authorBdale Garbee <bdale@gag.com>
Wed, 23 Oct 2013 15:53:48 +0000 (09:53 -0600)
committerBdale Garbee <bdale@gag.com>
Wed, 23 Oct 2013 15:53:48 +0000 (09:53 -0600)
debian/changelog
debian/rules

index 8229aa282797791e8a355513410007485f27b5b9..b1cb3829819eee01e9a4319d792e0c47fe1c5c6a 100644 (file)
@@ -1,3 +1,10 @@
+tar (1.27-3) UNRELEASED; urgency=low
+
+  * honor DEB_BUILD_OPTIONS parallel=<n>, honor dpkg-buildflags in build
+    target in addition to configure target, closes: #727196
+
+ -- Bdale Garbee <bdale@gag.com>  Wed, 23 Oct 2013 09:53:31 -0600
+
 tar (1.27-2) unstable; urgency=low
 
   * claim support for mime type application/x-ustar too, and no longer
index 5ab1d39a84da58d0ab4e8e756b425635cfa0f41b..8adc9887943d67aca801430f85ba31df790a0469 100755 (executable)
@@ -11,6 +11,11 @@ CFLAGS += -Wall
 LDFLAGS += `dpkg-buildflags --get LDFLAGS`
 CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`
 
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+  NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+  MAKEFLAGS += -j$(NUMJOBS)
+endif
+
 configure: configure-stamp
 configure-stamp:
        dh_testdir
@@ -29,7 +34,8 @@ build-arch: build-stamp
 build-indep: build-stamp
 build-stamp: configure-stamp
        dh_testdir
-       RSH="/usr/bin/rsh" CFLAGS="-O2 -g -Wall -fno-gnu89-inline" $(MAKE)
+       RSH="/usr/bin/rsh" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \
+               LDFLAGS="$(LDFLAGS)" $(MAKE)
 
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))