[dpdk-dev] scripts: fix merged lines on FreeBSD in config.h

Message ID 1417185354-10494-1-git-send-email-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Bruce Richardson Nov. 28, 2014, 2:35 p.m. UTC
  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(-)
  

Patch

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 */"