Skip to content

Commit ab828cd

Browse files
committed
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
2 parents 620e92b + 382a946 commit ab828cd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

detect-compiler

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ get_family() {
1717
}
1818

1919
get_version() {
20-
get_version_line | sed 's/^.* version \([0-9][^ ]*\).*/\1/'
20+
# A string that begins with a digit up to the next SP
21+
ver=$(get_version_line | sed 's/^.* version \([0-9][^ ]*\).*/\1/')
22+
23+
# There are known -variant suffixes that do not affect the
24+
# meaning of the main version number. Strip them.
25+
ver=${ver%-win32}
26+
ver=${ver%-posix}
27+
28+
echo "$ver"
2129
}
2230

2331
print_flags() {

0 commit comments

Comments
 (0)