[build] gcc version detection problem

Hello, This problem cropped up a couple of days ago when I updated my copy of the head version. The following is a piece of the output that I get when I run configure then make on either Linux or Solaris: ...patience... ...found 1921 targets... ...updating 695 targets... MkDir1 bin.v2 MkDir1 bin.v2/libs MkDir1 bin.v2/libs/iostreams MkDir1 bin.v2/libs/iostreams/build MkDir1 bin.v2/libs/iostreams/build/gcc-4.1.1 Copyright MkDir1 bin.v2/libs/iostreams/build/gcc-4.1.1 Copyright/release MkDir1 bin.v2/libs/iostreams/build/gcc-4.1.1 Copyright/release/threading-multi gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.1.1 Copyright/release/threading-multi/zlib.o The problem starts with the fifth MkDir1 line that contains '/gcc-4.1.1\nCopyright'. If I look in bin.v2/libs/iostreams/build I indeed see a subdirectory with an embedded newline in its name. After a bit of poking this fragment of the path appears to be created in tools/build/v2/tools/gcc.jam with the following lines: local command-string = $(command:J=" ") ; local command-info = [ MATCH "^[^ ]+[ ]+[^ ]+[ ]+([^ ]+)[^(]*[(]?([^)]*)" : [ SHELL "$(command-string) --version" ] ] ; version ?= $(command-info[1]) ; Using ECHO to see what the values are I get: ECHO "command-string = '$(command-string)'" ; command-string = 'g++' local ci = [ SHELL "$(command-string) --version" ] ; ECHO "ci = '$(ci)'" ; ci = 'g++ (GCC) 4.1.1 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ' The value of 'ci' is the same as what I get from running 'g++ --version' at a command line so that is OK. ECHO "version = '$(version)'" ; version = '4.1.1 Copyright' The value of 'version' matches what I'm seeing in the paths that are being generated. It looks to me like MATCH is interpreting its regex such that the term '([^ ]+)' (near the 19th char into the expression) is including the newline between '4.1.1' and 'Copyright'. There is some logic to this since a space isn't a newline but my copy of head from a month or so ago didn't have this problem. I checked and gcc.jam changed but this portion of the file didn't. Have any changes been made to bjam in the last month or so that would affect the behavior of MATCH? -glenn
participants (1)
-
Glenn Schrader