[dpdk-dev] scripts: fix merged lines on FreeBSD in config.h
Commit Message
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 <bruce.richardson@intel.com>
---
scripts/gen-config-h.sh | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
@@ -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 */"