From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: [PATCH] scripts: fix merged lines on FreeBSD in config.h Date: Fri, 28 Nov 2014 14:35:54 +0000 Message-ID: <1417185354-10494-1-git-send-email-bruce.richardson@intel.com> References: <20141128135604.GB5828@bricha3-MOBL3> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <20141128135604.GB5828@bricha3-MOBL3> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Since commit 0a91453d, "Fix symbol overriding in configuration", the rte_config.h can have two lines generated for a single directive to enable a feature - one line to undef the feature value, and a second to enable or set the new value. On FreeBSD, sed inserts an "n" char instead of the "\n" carriage return, leading to compiler errors. This patch fixes that by having sed insert a "$" character instead of attempting a "\n", and then using tr subsequently to turn "$" characters into real "\n" characters. Signed-off-by: Bruce Richardson --- scripts/gen-config-h.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/gen-config-h.sh b/scripts/gen-config-h.sh index 2fac08c..647bf4b 100755 --- a/scripts/gen-config-h.sh +++ b/scripts/gen-config-h.sh @@ -35,9 +35,10 @@ echo "#ifndef __RTE_CONFIG_H" echo "#define __RTE_CONFIG_H" grep CONFIG_ $1 | grep -v '^[ \t]*#' | -sed 's,CONFIG_\(.*\)=y.*$,#undef \1\n#define \1 1,' | +sed 's,CONFIG_\(.*\)=y.*$,#undef \1$#define \1 1,' | sed 's,CONFIG_\(.*\)=n.*$,#undef \1,' | -sed 's,CONFIG_\(.*\)=\(.*\)$,#undef \1\n#define \1 \2,' | -sed 's,\# CONFIG_\(.*\) is not set$,#undef \1,' +sed 's,CONFIG_\(.*\)=\(.*\)$,#undef \1$#define \1 \2,' | +sed 's,\# CONFIG_\(.*\) is not set$,#undef \1,' | +tr '$' '\n' echo "#endif /* __RTE_CONFIG_H */" -- 2.1.0