gcc-version.sh: fix for "invalid number" message during Android NDK builds

A CR in the gcc output would cause the following to show throughout build:

: invalid numberbox-1.32.1/scripts/gcc-version.sh: line 12: printf: 9

Signed-off-by: Chris Renshaw <osm0sis@outlook.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Chris Renshaw 2021-04-21 14:40:31 -03:00 committed by Denys Vlasenko
parent 20b224046c
commit 6c6470b384

View File

@ -7,6 +7,6 @@
#
compiler="$*"
MAJ_MIN=$(echo __GNUC__ __GNUC_MINOR__ | $compiler -E -xc - | grep . | tail -n 1)
# tr -d '\r': fix up msdos-style line endings (Cygwin et al)
MAJ_MIN=$(echo __GNUC__ __GNUC_MINOR__ | $compiler -E -xc - | tr -d '\r' | tail -n 1)
printf '%02d%02d\n' $MAJ_MIN