sb: Fix rtems-build-dep to handle various issues

- Remove CR characters on Windows.
- Force the compiler to output English so the pattern
  matching works.

Updates #3537.
This commit is contained in:
Chris Johns 2018-10-24 21:37:49 +11:00
parent ceeb3be303
commit e2209fa153

View File

@ -121,7 +121,7 @@ fi
# Header file.
#
if [ ${op} = "header" ]; then
inc_paths=$(echo | ${compiler} ${includes} -xc -E -v - 2>&1 | \
inc_paths=$(echo | LC_ALL=C ${compiler} ${includes} -xc -E -v - 2>&1 | tr -d '\r' | \
awk 'BEGIN {flag=0;} /starts here/{flag=1;next}/End/{flag=0}flag')
for p in ${inc_paths}
do
@ -146,7 +146,7 @@ if [ ${op} = "library" ]; then
else
sep=':'
fi
lib_paths_1=$(${compiler} -print-search-dirs 2>&1 | \
lib_paths_1=$(LC_ALL=C ${compiler} -print-search-dirs 2>&1 | tr -d '\r' | \
grep libraries | \
sed -e 's/libraries:.*=//' | \
awk 'BEGIN {FS="'${sep}'"} {for (i=0;++i<=NF;) print $i;}')