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>
diff --git a/build/external/packages/dpdk.mk b/build/external/packages/dpdk.mk
index e0a3ef2..b9ce4ac 100644
--- a/build/external/packages/dpdk.mk
+++ b/build/external/packages/dpdk.mk
@@ -134,14 +134,19 @@
 DPDK_DRIVERS_DISABLED := $(shell echo $(DPDK_DRIVERS_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 := \#
 # post-meson-setup snippet to alter rte_build_config.h
 define dpdk_config
 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; \
 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; \
 else \
 echo '$(HASH)define RTE_$(1) $(DPDK_$(1))' \
@@ -157,7 +162,7 @@
           >> $(dpdk_build_dir)/rte_build_config.h ; \
     fi; \
 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 ; \
 fi
 endef