summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChris Renshaw2021-04-21 14:40:31 -0300
committerDenys Vlasenko2021-04-22 09:21:39 +0200
commit6c6470b3847d12b2d7504fa37fbf871c46792d77 (patch)
tree5878e2f488f32089a6dfa3dbb2dd2dbb4038ab30 /scripts
parent20b224046c61ccc9a8e847cd0665f9f39e9a8ff9 (diff)
downloadbusybox-6c6470b3847d12b2d7504fa37fbf871c46792d77.zip
busybox-6c6470b3847d12b2d7504fa37fbf871c46792d77.tar.gz
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>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gcc-version.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/gcc-version.sh b/scripts/gcc-version.sh
index 9376ed4..0eb27c7 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