aboutsummaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-06-23 14:03:57 +0200
committerC.J. Collier <cjcollier@linuxfoundation.org>2016-06-23 15:57:29 +0000
commitbfb8eeb20fbe6a96e7bc9d663370b871fe77717b (patch)
treecf800cebedd242ebb3b98eb7a5235f7ec0a76a13 /debian/rules
parentb0d4298a8d737c457ee15555b1edb100b8960e09 (diff)
d/rules: transfer dpkg-buildflags to the dpdk build system
DPDK build ignores the usual way of dpdk-buildflag exports. We have to set EXTRA_CFLAFS and EXTRA_LDFLAGS properly after setting up and including dpdk-buildflags properly to have the control over flags a debian package should have. LDFLAG fPIC is now added via DEB_CFLAGS_MAINT_APPEND and fPIE disabled from the default hardening set (incompatibility with fPIC on shared libraries) Change-Id: I74febe97da99c338e6c3e0992c65ca4a007f381c Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules15
1 files changed, 8 insertions, 7 deletions
diff --git a/debian/rules b/debian/rules
index 094f6f2f..8758dc66 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,24 +7,23 @@ export DH_OPTIONS=-v
VERSION := $(shell dpkg-parsechangelog | sed -nr '/^Version:/s/Version: (.*:)?(.*)-(.*)/\2/p')
# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
-DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
DEB_HOST_GNU_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
# see FEATURE AREAS in dpkg-buildflags(1)
-export DEB_BUILD_MAINT_OPTIONS = hardening=+all
-
-# build with debug symbols, dh_strip will create -dgbsyms packages by that
-# also export -fPIC for the static build (already used by shared by default)
-export EXTRA_CFLAGS = -g -fPIC
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
-#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
+export DEB_CFLAGS_MAINT_APPEND = -fPIC
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+include /usr/share/dpkg/buildflags.mk
+export EXTRA_CFLAGS=$(CFLAGS)
+export EXTRA_LDFLAGS=$(LDFLAGS)
+
# People rebuilding this package can overwrite DPDK_CONFIG, RTE_MACHINE and
# RTE_TARGET via environment variables if they like
ifneq (,$(filter $(DEB_HOST_ARCH), arm64))
@@ -48,6 +47,8 @@ build-config:
dh_testdir
# report dpkg-buildflags status to build log
dpkg-buildflags --status
+ echo EXTRA_CFLAGS $$EXTRA_CFLAGS
+ echo EXTRA_LDFLAGS: $$EXTRA_LDFLAGS
$(MAKE) O=$(DPDK_STATIC_DIR) T=$(DPDK_CONFIG) config
sed -ri -e 's,(RTE_MACHINE=).*,\1$(RTE_MACHINE),' \
-e 's,(RTE_NEXT_ABI=).*,\1n,' \