[U-Boot] [PATCH 2/3] mkconfig: create CONFIG_ defines without relying on GNU extensions

Jeroen Hofstee jeroen at myspectrum.nl
Tue Jul 19 22:41:49 CEST 2011


Parsing of boards.cfg relies on sed GNU extensions and fails if sed
doesn't support these. On FreeBSD this leads to the error:

sed: 1: "/=/ {s/=/\t/;q } ; { s/ ...": extra characters at the end
of q command

Signed-off-by: Jeroen Hofstee <jeroen at myspectrum.nl>
Cc: Marek Vasut <marek.vasut at gmail.com>
---
 mkconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mkconfig b/mkconfig
index 6ff533f..b9cfc94 100755
--- a/mkconfig
+++ b/mkconfig
@@ -148,7 +148,7 @@ fi
 echo "/* Automatically generated - do not edit */" >>config.h
 
 for i in ${TARGETS} ; do
-	i="`echo ${i} | sed '/=/ {s/=/\t/;q } ; { s/$/\t1/ }'`"
+	i="`echo ${i} | sed -e '/=/!s/$/=1/' -e 's/=/	/'`"
 	echo "#define CONFIG_${i}" >>config.h ;
 done
 
-- 
1.7.5.4



More information about the U-Boot mailing list