diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index d767436d6..1870e6827 100644 --- a/v2/tools/gcc.jam +++ b/v2/tools/gcc.jam @@ -75,8 +75,11 @@ rule init ( version ? : command * : options * ) # Autodetect the version and flavor if not given. if $(command) { + # The 'command' variable can have multiple-element. When calling + # the SHELL builtin we need a single string. + local command-string = $(command:J=" ") ; local command-info = [ MATCH "^[^ ]+[ ]+[^ ]+[ ]+([^ ]+)[^(]*[(]?([^)]*)" - : [ SHELL "$(command) --version" ] ] ; + : [ SHELL "$(command-string) --version" ] ] ; version ?= $(command-info[1]) ; switch $(command-info[2]:L) {