From 7a8ffa8234116960f6099efc5363a3d1479c9470 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Wed, 11 Jan 2012 12:22:57 -0700 Subject: [PATCH] patch from Moritz Muehlenhoff to enable hardened build flags --- debian/rules | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/debian/rules b/debian/rules index 3f924fa..adf2947 100755 --- a/debian/rules +++ b/debian/rules @@ -2,13 +2,10 @@ export DH_VERBOSE=1 -CFLAGS = -Wall -Wno-comment -g -ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif -export CFLAGS +CFLAGS = `dpkg-buildflags --get CFLAGS` +CFLAGS += -Wall -Wno-comment +LDFLAGS = `dpkg-buildflags --get LDFLAGS` +CPPFLAGS = `dpkg-buildflags --get CPPFLAGS` configure: configure-stamp configure-stamp: @@ -18,7 +15,8 @@ configure-stamp: # simple version mkdir -p build-simple - cd build-simple && NROFFPROG=/usr/bin/nroff $(CURDIR)/configure \ + cd build-simple && NROFFPROG=/usr/bin/nroff CFLAGS="$(CFLAGS)" \ + CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(CURDIR)/configure \ --prefix=/usr -v \ --with-all-insults \ --with-pam \ @@ -38,7 +36,8 @@ configure-stamp: # LDAP version mkdir -p build-ldap - cd build-ldap && NROFFPROG=/usr/bin/nroff $(CURDIR)/configure \ + cd build-ldap && NROFFPROG=/usr/bin/nroff CFLAGS="$(CFLAGS)" \ + CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(CURDIR)/configure \ --prefix=/usr -v \ --with-all-insults \ --with-pam \ -- 2.47.2