d/rules: streamline dpkg-buildflags usage

use DEB_flag_MAINT_APPEND instead of mangling CFLAGS/LDFLAGS directly,
and rely on debhelper to convey those flags to autoconf instead of
passing them manually.

Gbp-Dch: Short
Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent d239f0bb
......@@ -17,14 +17,12 @@ PY3VERS=
endif
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -Wall -O3
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
CC = $(DEB_HOST_GNU_TYPE)-gcc
CFLAGS = `dpkg-buildflags --get CFLAGS` -Wall -O3
LDFLAGS = `dpkg-buildflags --get LDFLAGS` -Wl,--as-needed
CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`
TARGETS := main $(PYVERS) $(PYVERS:%=%-dbg) $(PY3VERS) $(PY3VERS:%=%-dbg)
WITH_UDEB := $(shell dpkg-vendor --derives-from Ubuntu && echo yes)
......@@ -37,7 +35,7 @@ $(if $(shell grep -q libxml2-udeb debian/control && echo yes),$(shell sed -i /li
export DH_OPTIONS = -Nlibxml2-udeb
endif
CONFIGURE_FLAGS := --disable-silent-rules --with-history CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" --cache-file="$(CURDIR)/builddir/config.cache"
CONFIGURE_FLAGS := --disable-silent-rules --with-history --cache-file="$(CURDIR)/builddir/config.cache"
override_dh_auto_configure: $(TARGETS:%=doconfigure-%)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment