Code

rules: Use dh_autotools-dev* to update config.{sub,guess}.
[pkg-libmpdclient.git] / debian / rules
index 2418ad8848fd9d1955914cc4badf59ab63ec8055..3075b45df41abb6757b7912307f7ebc3070e8309 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
@@ -27,15 +29,19 @@ endif
 
 config.status: configure
        dh_testdir
+       dh_autotools-dev_updateconfig
        
        ./configure \
                        --host=$(DEB_HOST_GNU_TYPE) \
                        --build=$(DEB_BUILD_GNU_TYPE) \
                        --prefix=/usr \
                        --mandir=\$${prefix}/share/man \
-                       CFLAGS="$(CFLAGS)"
+                       CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)"
 
-build: build-stamp
+build: build-arch build-indep
+
+build-arch: build-stamp
+build-indep: build-stamp
 
 build-stamp: config.status
        dh_testdir
@@ -52,6 +58,7 @@ clean:
        
        [ ! -f Makefile ] || $(MAKE) distclean
        
+       dh_autotools-dev_restoreconfig
        dh_clean
 
 install: build