Code

rules: Use dpkg-buildflags to get CPPFLAGS, CFLAGS, and LDFLAGS.
authorSebastian Harl <sh@tokkee.org>
Sun, 27 Apr 2014 11:29:15 +0000 (13:29 +0200)
committerSebastian Harl <sh@tokkee.org>
Sun, 27 Apr 2014 11:32:14 +0000 (13:32 +0200)
debian/changelog
debian/rules

index 82c2f74..b14251b 100644 (file)
@@ -13,6 +13,7 @@ ncmpc (0.21-1) UNRELEASED; urgency=low
   * debian/rules:
     - Enable chat-screen feature.
     - Split build target into build-arch and build-indep.
+    - Use dpkg-buildflags to get CPPFLAGS, CFLAGS, and LDFLAGS.
   * debian/control, debian/rules:
     - Enable documentation and build-depend on doxygen.
   * debian/patches, debian/control:
index cf18017..042e001 100755 (executable)
 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
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0
-else
-       CFLAGS += -O2
-endif
+CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
+CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
+CFLAGS += -Wall
+LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
 
 CHECK = check
 
@@ -48,7 +45,9 @@ config.status: configure
                        --enable-outputs-screen \
                        --enable-documentation \
                        --with-ncursesw \
-                       CFLAGS="$(CFLAGS)"
+                       CPPFLAGS="$(CPPFLAGS)" \
+                       CFLAGS="$(CFLAGS)" \
+                       LDFLAGS="$(LDFLAGS)"
 
 build: build-arch build-indep
 build-indep: