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 82c2f74911f704aabaa7acbf00bb7ec791bbee1f..b14251b23fa7080747b528dfff6db0f4d0c57757 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 cf18017962b5c5906206090228dd2f5d964bce8c..042e001a95056c29fe03b619e3bc9ac79d91178e 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: