From 4a6d2bfde8b1346919049b3c99788689a85873da Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 17 May 2012 20:09:02 +0200 Subject: [PATCH] rules: Enabled harding build flags (use dpkg-buildflags). --- debian/changelog | 1 + debian/rules | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index b8e2a09..17440bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ tig (1.0-1) UNRELEASED; urgency=low - Don't remove 'test-graph'; it is no longer installed by 'make install'. - Don't try to install TODO; it no longer exists. - Split build target into build-{arch,indep} as recommended by policy. + - Enabled harding build flags (use dpkg-buildflags). * debian/control: - Updated standards-version to 3.9.3 -- no changes. diff --git a/debian/rules b/debian/rules index 63f2599..9c4aa14 100755 --- a/debian/rules +++ b/debian/rules @@ -11,7 +11,14 @@ 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 -I/usr/include/ncursesw +export DEB_BUILD_MAINT_OPTIONS=hardening=+all + +CFLAGS = $(shell dpkg-buildflags --get CFLAGS) +CFLAGS += -Wall -g -I/usr/include/ncursesw + +CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS) + +LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 @@ -23,7 +30,7 @@ config.status: configure dh_testdir ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr --mandir=\$${prefix}/share/man --sysconfdir=/etc \ - CFLAGS="$(CFLAGS)" + CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" build: build-arch build-indep -- 2.30.2