enable hardened build flags

This commit is contained in:
Moritz Muehlenhoff 2013-12-29 10:27:20 +01:00 committed by Frédéric Péters
parent dd8d85e2a8
commit fba81e5d23
1 changed files with 5 additions and 7 deletions

12
rules
View File

@ -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