Code

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 78d469b63a3130489c5cd1c36da3a7c8b15e97d5..292c026fee37c2a15a8088dae2d19977c587b72a 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 8c82591e4c6dea729e7dba8aff0b8db7311d83c3..4be60df5141411f879f9c1da16bd462a5781a552 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