diff options
author | Moritz Muehlenhoff <jmm@debian.org> | 2012-01-09 01:26:48 +0300 |
---|---|---|
committer | Moritz Muehlenhoff <jmm@debian.org> | 2012-01-09 01:26:48 +0300 |
commit | 308a2967328fbad64f1499db8e360492d572767e (patch) | |
tree | 9598969caeb2914b812ba211abaaaab5b77454e4 | |
parent | bb164b36dee7a10ad6e79d26fd55f8aa214ad41b (diff) | |
download | libxml2-308a2967328fbad64f1499db8e360492d572767e.tar.gz |
Enable hardened build flags through dpkg-buildflags.
-rwxr-xr-x | debian/rules | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/debian/rules b/debian/rules index 92a7bf9..fbd97a3 100755 --- a/debian/rules +++ b/debian/rules @@ -5,12 +5,13 @@ PYVERS=$(shell pyversions -s) # The current default version of python PYVER=$(shell pyversions -d) -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 -fno-strict-aliasing +ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -fno-strict-aliasing endif TARGETS := main $(PYVERS) $(PYVERS:%=%-dbg) @@ -25,7 +26,7 @@ $(if $(shell grep -q libxml2-udeb debian/control && echo yes),$(shell sed -i /li export DH_OPTIONS = -Nlibxml2-udeb endif -CONFIGURE_FLAGS := --with-history CC="gcc -Wl,--as-needed" CFLAGS="$(CFLAGS)" --cache-file="$(CURDIR)/build/config.cache" +CONFIGURE_FLAGS := --with-history CC="gcc -Wl,--as-needed" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" --cache-file="$(CURDIR)/build/config.cache" override_dh_auto_configure: $(TARGETS:%=configure-%) |