From: Bdale Garbee Date: Wed, 11 Jan 2012 19:22:57 +0000 (-0700) Subject: patch from Moritz Muehlenhoff to enable hardened build flags X-Git-Tag: debian/1.8.3p1-3~11 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=7a8ffa8234116960f6099efc5363a3d1479c9470;p=debian%2Fsudo patch from Moritz Muehlenhoff to enable hardened build flags --- 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 \