Merge branch 'mh/fix-detect-compilers-with-nondigit-versions'

The detect-compilers script to help auto-tweaking the build system
had trouble working with compilers whose version number has extra
suffixes.  The script has been taught that certain suffixes (like
"-win32" in "gcc 10-win32") can be safely stripped as they share
the same features and bugs with the version without the suffix.

* mh/fix-detect-compilers-with-nondigit-versions:
  Handle some compiler versions containing a dash
This commit is contained in:
Junio C Hamano
2023-05-09 16:45:45 -07:00

View File

@ -17,7 +17,15 @@ get_family() {
}
get_version() {
get_version_line | sed 's/^.* version \([0-9][^ ]*\).*/\1/'
# A string that begins with a digit up to the next SP
ver=$(get_version_line | sed 's/^.* version \([0-9][^ ]*\).*/\1/')
# There are known -variant suffixes that do not affect the
# meaning of the main version number. Strip them.
ver=${ver%-win32}
ver=${ver%-posix}
echo "$ver"
}
print_flags() {