From 6c6470b3847d12b2d7504fa37fbf871c46792d77 Mon Sep 17 00:00:00 2001 From: Chris Renshaw Date: Wed, 21 Apr 2021 14:40:31 -0300 Subject: [PATCH] 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 Signed-off-by: Denys Vlasenko --- scripts/gcc-version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/gcc-version.sh b/scripts/gcc-version.sh index 9376ed4fb..0eb27c7a6 100755 --- a/scripts/gcc-version.sh +++ b/scripts/gcc-version.sh @@ -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