diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index efe907827..800d3f2b2 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -81,10 +81,11 @@ rule init ( version ? : command * : options * ) # The 'command' variable can have multiple elements. When calling # the SHELL builtin we need a single string. local command-string = $(command:J=" ") ; - local command-info = [ MATCH "^[^ ]+[ ]+[^ ]+[ ]+([^ ]+)[^(]*[(]?([^)]*)" - : [ SHELL "$(command-string) --version" ] ] ; - version ?= $(command-info[1]) ; - switch $(command-info[2]:L) + local machine = [ MATCH "^([^ ]+)" + : [ SHELL "$(command-string) -dumpmachine" ] ] ; + version ?= [ MATCH "^([0-9.]+)" + : [ SHELL "$(command-string) -dumpversion" ] ] ; + switch $(machine:L) { case *mingw* : flavor ?= mingw ; }