Skip to content

Commit 4fb46b1

Browse files
author
duke
committed
Backport c49ef0421f2e6ec3f57a519bb439b1a731d7db38
1 parent eb6a23a commit 4fb46b1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

make/autoconf/toolchain.m4

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,11 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION],
449449
# Copyright (C) 2013 Free Software Foundation, Inc.
450450
# This is free software; see the source for copying conditions. There is NO
451451
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
452+
# or look like
453+
# gcc (GCC) 10.2.1 20200825 (Alibaba 10.2.1-3.8 2.32)
454+
# Copyright (C) 2020 Free Software Foundation, Inc.
455+
# This is free software; see the source for copying conditions. There is NO
456+
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
452457
COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1`
453458
# Check that this is likely to be GCC.
454459
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null
@@ -462,7 +467,8 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION],
462467
COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \
463468
$SED -e 's/ *Copyright .*//'`
464469
COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
465-
$SED -e 's/^.* \(@<:@1-9@:>@<:@0-9@:>@*\.@<:@0-9.@:>@*\)@<:@^0-9.@:>@.*$/\1/'`
470+
$AWK -F ')' '{print [$]2}' | \
471+
$AWK '{print [$]1}'`
466472
elif test "x$TOOLCHAIN_TYPE" = xclang; then
467473
# clang --version output typically looks like
468474
# Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)

0 commit comments

Comments
 (0)