|
Boost : |
From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2007-05-02 23:25:39
The problem:
Boost.Build currently uses "gcc --version" and some parsing of that to
autodetect the version and flavor (only mingw is relevant so far). But
the output of that command is extremely variable. A user tried doing a
"bjam --toolset=gcc install" with a more mainline MinGW 4.1.2 build and
got errors. I tried the same, and although I didn't get errors, I got
both bad version number and strange directory names.
The solution:
Change Boost.Build to use "gcc -dumpversion" and "gcc -dumpmachine".
Before I was reticent to make such a change because according to the
public GCC docs it's only there on versions 3.1 onward. But Antonio
Fiuman, from the #boost channel, found it was implemented as far back as
version 2.8.1. So I'm suggesting we make the following change to fix the
above problem:
Index: tools/build/v2/tools/gcc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/gcc.jam,v
retrieving revision 1.89
diff -u -r1.89 gcc.jam
--- tools/build/v2/tools/gcc.jam 3 Apr 2007 17:10:53 -0000 1.89
+++ tools/build/v2/tools/gcc.jam 3 May 2007 02:48:10 -0000
@@ -81,10 +81,11 @@
# 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 ;
}
===================================================================
NOTE: Even though this problem only showed up on the MinGW GCC it is
likely not confined to MinGW, nor Windows.
The patch is tested with MinGW 3.4.5, MinGW 4.1.2, and GCC 4.1.2 on
Ubuntu Linux.
OK to commit, to HEAD and RC_1_34_0?
-- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk