From fba81e5d234ad2cb2e8d1bc8d3ec245d51f745e8 Mon Sep 17 00:00:00 2001 From: Moritz Muehlenhoff Date: Sun, 29 Dec 2013 10:27:20 +0100 Subject: [PATCH] enable hardened build flags --- rules | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/rules b/rules index 56f3b4db..031db6f4 100644 --- a/rules +++ b/rules @@ -28,13 +28,11 @@ PYDEF := $(shell pyversions -vd) PYVERS := $(shell pyversions -vr debian/control) OTHERPYVERS := $(filter-out $(PYDEF), $(PYVERS)) -CFLAGS = -Wall -g +CFLAGS = `dpkg-buildflags --get CFLAGS` +CFLAGS += -Wall +LDFLAGS = `dpkg-buildflags --get LDFLAGS` +CPPFLAGS = `dpkg-buildflags --get CPPFLAGS` -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif @@ -64,7 +62,7 @@ endif config.status: configure dh_testdir # Add here commands to configure the package. - CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) $(CONFIGURE_ARGS) + CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) $(CONFIGURE_ARGS) build: build-stamp