From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergio Gonzalez Monroy Subject: [PATCH v2] mk: fix FreeBSD build Date: Mon, 18 Jul 2016 17:06:35 +0100 Message-ID: <1468857995-130392-1-git-send-email-sergio.gonzalez.monroy@intel.com> References: <1468847463-107132-1-git-send-email-sergio.gonzalez.monroy@intel.com> Cc: thomas.monjalon@6wind.com, christian.ehrhardt@canonical.com, ferruh.yigit@intel.com To: dev@dpdk.org Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 70503968 for ; Mon, 18 Jul 2016 18:06:38 +0200 (CEST) In-Reply-To: <1468847463-107132-1-git-send-email-sergio.gonzalez.monroy@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The sed syntax of '0,/regexp/' is GNU specific and fails with non GNU sed in FreeBSD. To solve the issue we can use awk instead to remove duplicates. Fixes: b2063f104db7 ("mk: filter duplicate configuration entries") Signed-off-by: Sergio Gonzalez Monroy --- v2: - Use temp var instead of temp file mk/rte.sdkconfig.mk | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk index e93237f..c2b6e13 100644 --- a/mk/rte.sdkconfig.mk +++ b/mk/rte.sdkconfig.mk @@ -88,11 +88,8 @@ $(RTE_OUTPUT)/.config: $(RTE_CONFIG_TEMPLATE) FORCE | $(RTE_OUTPUT) $(CPP) -undef -P -x assembler-with-cpp \ -ffreestanding \ -o $(RTE_OUTPUT)/.config_tmp $(RTE_CONFIG_TEMPLATE) ; \ - for config in $$(grep -v "^#" $(RTE_OUTPUT)/.config_tmp | cut -d"=" -f1 | sort | uniq -d); do \ - while [ $$(grep "^$${config}=" $(RTE_OUTPUT)/.config_tmp -c ) -gt 1 ]; do \ - sed -i "0,/^$${config}=/{//d}" $(RTE_OUTPUT)/.config_tmp; \ - done; \ - done; \ + config=$$(grep -v "^#" $(RTE_OUTPUT)/.config_tmp) ; \ + echo "$$config" | awk -F'=' '{a[$$1]=$$0} END {for (i in a) print a[i]}' > $(RTE_OUTPUT)/.config_tmp ; \ if ! cmp -s $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config; then \ cp $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config ; \ cp $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config.orig ; \ -- 2.4.11