From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Marchand Subject: [PATCH] scripts: fix symbol overriding in configuration files Date: Thu, 27 Nov 2014 12:29:05 +0100 Message-ID: <1417087745-9004-1-git-send-email-david.marchand@6wind.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: 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" When redefining the same symbol in configuration (basically after an inclusion), we need to undefine the previous symbol to avoid "redefined" errors. Signed-off-by: David Marchand --- scripts/gen-config-h.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/gen-config-h.sh b/scripts/gen-config-h.sh index efd7667..2fac08c 100755 --- a/scripts/gen-config-h.sh +++ b/scripts/gen-config-h.sh @@ -33,11 +33,11 @@ echo "#ifndef __RTE_CONFIG_H" echo "#define __RTE_CONFIG_H" -grep CONFIG_ $1 \ -| grep -v '^[ \t]*#' \ -| sed 's,CONFIG_\(.*\)=y.*$,#define \1 1,' \ -| sed 's,CONFIG_\(.*\)=n.*$,#undef \1,' \ -| sed 's,CONFIG_\(.*\)=\(.*\)$,#define \1 \2,' \ -| sed 's,\# CONFIG_\(.*\) is not set$,#undef \1,' +grep CONFIG_ $1 | +grep -v '^[ \t]*#' | +sed 's,CONFIG_\(.*\)=y.*$,#undef \1\n#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,' echo "#endif /* __RTE_CONFIG_H */" -- 1.7.10.4