rules: Use dpkg-buildflags to get CPPFLAGS and CFLAGS.
authorSebastian Harl <sh@tokkee.org>
Sat, 23 Nov 2013 19:14:56 +0000 (20:14 +0100)
committerSebastian Harl <sh@tokkee.org>
Sat, 23 Nov 2013 19:14:56 +0000 (20:14 +0100)
debian/changelog
debian/rules

index 78d469b..292c026 100644 (file)
@@ -7,6 +7,7 @@ libmpdclient (2.9-1) UNRELEASED; urgency=low
     - Updated for new upstream version.
   * debian/rules:
     - Split build target into build-arch and build-indep.
+    - Use dpkg-buildflags to get CPPFLAGS and CFLAGS.
   * debian/control:
     - Updated standards-version to 3.9.4.
 
index 8c82591..4be60df 100755 (executable)
@@ -11,7 +11,9 @@
 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
-CFLAGS = -Wall -g
+CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
+CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
+CFLAGS += -Wall -g
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -O0
@@ -33,7 +35,7 @@ config.status: configure
                        --build=$(DEB_BUILD_GNU_TYPE) \
                        --prefix=/usr \
                        --mandir=\$${prefix}/share/man \
-                       CFLAGS="$(CFLAGS)"
+                       CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)"
 
 build: build-arch build-indep