ifneq (,$(filter rte_machine=%,$(DEB_BUILD_OPTIONS)))
RTE_MACHINE ?= $(patsubst rte_machine=%,%,$(filter rte_machine=%,$(DEB_BUILD_OPTIONS)))
endif
-
-# Use default for arm* where there is a defined list.
-# x86 and power would just use "native", which is an invariant, so set
-# power8 and corei7 to keep it stable.
-ifneq (,$(filter $(DEB_HOST_ARCH), arm64))
+# default to minimal base, without setting this it would build
+# -march=native which is a non portable invariant
RTE_MACHINE ?= "default"
-else
-ifneq (,$(filter $(DEB_HOST_ARCH), armhf))
-RTE_MACHINE ?= "armv7a"
-else
-ifneq (,$(filter $(DEB_HOST_ARCH), ppc64el))
-RTE_MACHINE ?= "power8"
-else
-RTE_MACHINE ?= "corei7"
-endif
-endif
-endif
# now stable with parallel comilation, so support -j
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
endif
+# Allow to pass specific configure flags to meson as a comma separated list
+ifneq (,$(filter dpdk_config_options=%,$(DEB_BUILD_OPTIONS)))
+# GNU Makefile hack: can't directly escape comma and spaces, so use variables
+ comma := ,
+ space :=
+ space +=
+ DPDK_CONFIG_OPTIONS ?= $(subst $(comma),$(space),$(patsubst dpdk_config_options=%,%,$(filter dpdk_config_options=%,$(DEB_BUILD_OPTIONS))))
+endif
+
# kernel_modules can be passed via DEB_BUILD_OPTIONS to enable building the
# optional binary kernel modules package. By default it will be built against
# the current kernel, or ksrc can be passed with a path to the target kernel
ifneq (,$(filter ksrc=%,$(DEB_BUILD_OPTIONS)))
KSRC := $(patsubst ksrc=%,%,$(filter ksrc=%,$(DEB_BUILD_OPTIONS)))
else
- KSRC := /lib/modules/$(shell uname -r)/build
+ KSRC := /lib/modules/$(shell LIST=$$(ls /lib/modules/); for dir in $$LIST; do test -d /lib/modules/$$dir/build && echo $$dir; done | sort -V | tail -n1)/build
endif
KVERS := $(shell perl debian/kernel-version $(KSRC))
# list for libdpdk-dev to avoid having to maintain it manually.
# Same for the recommends list for dpdk, were we want the PMDs and the mempools.
dh_gencontrol -p libdpdk-dev -- -V"librte:Depends=`grep -E 'librte-*' ./debian/files | grep -v dbgsym | tr '_' ' ' | awk '{ print $$1,"(=",$$2 ")" }' | paste -sd ',' - | sed -e 's/,/, /g'`"
- dh_gencontrol -p dpdk -- -V"librte:Recommends=`grep -E 'librte-(pmd|mempool).*' ./debian/files | grep -v dbgsym | tr '_' ' ' | awk '{ print $$1,"(=",$$2 ")" }' | paste -sd ',' - | sed -e 's/,/, /g'`"
+ dh_gencontrol -p dpdk -- -V"librte:Suggests=`grep -E 'librte-(pmd|mempool).*' ./debian/files | grep -v dbgsym | tr '_' ' ' | awk '{ print $$1,"(=",$$2 ")" }' | paste -sd ',' - | sed -e 's/,/, /g'`"
ifneq (,$(findstring kernel_modules,$(DEB_BUILD_OPTIONS)))
dh_gencontrol -p dpdk-modules-$(KVERS) -- \
-v`cat debian/VERSION` \
dh_auto_clean
override_dh_auto_configure:
- dh_auto_configure -- \
+ dh_auto_configure -- $(DPDK_CONFIG_OPTIONS) \
--includedir=include/dpdk \
+ --default-library=shared \
-Dper_library_versions=false \
-Dinclude_subdir_arch=../$(DEB_HOST_MULTIARCH)/dpdk \
-Dmachine=$(RTE_MACHINE) \