dpdk: Use gnu sed on FreeBSD for header fix ups

FreeBSD sed isn't compatible with gnu seds in place option. On FreeBSD
explicitly use gsed, on Linux and other platforms this is available just
as 'sed'.

Type: improvement
Change-Id: I6e4fcaf11d4d22cd3e4cd0c3327b16393542845f
Signed-off-by: Tom Jones <thj@freebsd.org>
This commit is contained in:
Tom Jones
2024-02-01 16:09:20 +00:00
committed by Damjan Marion
parent 0a2fdc5669
commit 5267b53528

View File

@ -134,14 +134,19 @@ endif
DPDK_DRIVERS_DISABLED := $(shell echo $(DPDK_DRIVERS_DISABLED) | tr -d '\\\t ') DPDK_DRIVERS_DISABLED := $(shell echo $(DPDK_DRIVERS_DISABLED) | tr -d '\\\t ')
DPDK_LIBS_DISABLED := $(shell echo $(DPDK_LIBS_DISABLED) | tr -d '\\\t ') DPDK_LIBS_DISABLED := $(shell echo $(DPDK_LIBS_DISABLED) | tr -d '\\\t ')
SED=sed
ifeq ($shell(uname), FreeBSD)
SED=gsed
endif
HASH := \# HASH := \#
# post-meson-setup snippet to alter rte_build_config.h # post-meson-setup snippet to alter rte_build_config.h
define dpdk_config define dpdk_config
if grep -q RTE_$(1) $(dpdk_src_dir)/config/rte_config.h ; then \ if grep -q RTE_$(1) $(dpdk_src_dir)/config/rte_config.h ; then \
sed -i -e 's/$(HASH)define RTE_$(1).*/$(HASH)define RTE_$(1) $(DPDK_$(1))/' \ $(SED) -i -e 's/$(HASH)define RTE_$(1).*/$(HASH)define RTE_$(1) $(DPDK_$(1))/' \
$(dpdk_src_dir)/config/rte_config.h; \ $(dpdk_src_dir)/config/rte_config.h; \
elif grep -q RTE_$(1) $(dpdk_build_dir)/rte_build_config.h ; then \ elif grep -q RTE_$(1) $(dpdk_build_dir)/rte_build_config.h ; then \
sed -i -e 's/$(HASH)define RTE_$(1).*/$(HASH)define RTE_$(1) $(DPDK_$(1))/' \ $(SED) -i -e 's/$(HASH)define RTE_$(1).*/$(HASH)define RTE_$(1) $(DPDK_$(1))/' \
$(dpdk_build_dir)/rte_build_config.h; \ $(dpdk_build_dir)/rte_build_config.h; \
else \ else \
echo '$(HASH)define RTE_$(1) $(DPDK_$(1))' \ echo '$(HASH)define RTE_$(1) $(DPDK_$(1))' \
@ -157,7 +162,7 @@ if [[ "$(DPDK_$(1))" == "y" ]]; then \
>> $(dpdk_build_dir)/rte_build_config.h ; \ >> $(dpdk_build_dir)/rte_build_config.h ; \
fi; \ fi; \
elif [[ "$(DPDK_$(1))" == "n" ]]; then \ elif [[ "$(DPDK_$(1))" == "n" ]]; then \
sed -i '/$(HASH)define RTE_$(1) .*/d' $(dpdk_build_dir)/rte_build_config.h \ $(SED) -i '/$(HASH)define RTE_$(1) .*/d' $(dpdk_build_dir)/rte_build_config.h \
$(dpdk_src_dir)/config/rte_config.h ; \ $(dpdk_src_dir)/config/rte_config.h ; \
fi fi
endef endef