Boost logo

Boost-Build :

Subject: Re: [Boost-build] Changes to GCC toolset init?
From: Vladimir Prus (ghost_at_[hidden])
Date: 2010-09-29 11:21:37


On Wednesday, September 29, 2010 17:49:27 Moritz Hassert wrote:
> Hi John,
>
> I recently created a patch to fix version checking for toolset gcc.
> See the ticket at https://svn.boost.org/trac/boost/ticket/4667 and the
> attached comments.
>
> Am Mittwoch, 29. September 2010, um 14:01:10 schrieb John Maddock:
> > After an SVN update my user-config.jam is now producing no end of errors:
> >
> > using gcc : cygwin ;
> >
> > Produces:
> >
> > M:/data/boost/trunk/tools/build/v2/tools\gcc.jam:106: in gcc.init from
> > module gcc
> > error: toolset gcc initialization:
> > error: version 'cygwin' requested but 'g++-cygwin' not found and version
> > '3.4.4' of default 'g++' does not match
> > error: initialized from C:\cygwin\home\john\user-config.jam:40
>
> That's correct behavior. Because you ask for a specific gcc with version
> "cygwin" but didn't tell boost-build where to find it. boost-build tries to
> guess its name and also checks whether the default gcc matches the version
> but in your case obviously both fails.
> Note: until the fix, boost-build accepted any version string and
> *unconditionally* used the default command "g++". The version "cygwin"
> specified by you was used *only* in the build path and in property
> <toolset- gcc:version> but not to select the actual compiler.
>
> > using gcc : cygwin4 : g++-4 ;
> >
> > Produces:
> >
> > M:/data/boost/trunk/tools/build/v2/tools\gcc.jam:77: in gcc.init from
> > module gcc
> >
> > error: toolset gcc initialization:
> > error: provided command 'g++-4' not found
> > error: initialized from C:\cygwin\home\john\user-config.jam:41
> >
> > Even though the command g++-4 most certainly does succeed!
>
> This is still an open problem. See comments of the ticket above. When no
> path is given, no suffixes are auto-appended. However adding ".exe" to the
> command should fix it for you.
>
> > And:
> >
> > using gcc : mw4 : "set PATH=C:/MinGW/bin;%PATH% && C:/MinGW/bin/g++.exe"
> > : <linkflags>-enable-auto-import ;
> >
> > Produces:
> >
> > M:/data/boost/trunk/tools/build/v2/tools\gcc.jam:77: in gcc.init from
> > module gcc
> >
> > error: toolset gcc initialization:
> > error: provided command 'set PATH=C:/MinGW/bin;%PATH% &&
> > C:/MinGW/bin/g++.exe' not found
> > error: initialized from C:\cygwin\home\john\user-config.jam:43
>
> I don't think specifying anything like "set PATH=C:/MinGW/bin;%PATH% &&
> C:/MinGW/bin/g++.exe" for the command could ever work. The command string
> can only contain the binary to run and its optinal path.
>
> If you ever need to set an environmnet variable for some other reasons, you
> should encapsulate everything in a bash-script or batch-file.

Actually, it's supposed to work. I have tested that say "distcc g++" still
works with the patch, but it seems that "set" might be tricky to recognize.
Maybe, the right approach is just try running to command, and remove
all looking around in PATH?

- Volodya


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk