[ROOT] Minor change to Makefile to detect g++ version number

From: Nick West (n.west1@physics.ox.ac.uk)
Date: Fri Aug 02 2002 - 16:31:11 MEST


Hi Fons,

Would it be possible to make a very minor change to the top level ROOT
Makefile and replace:-

GCC_MAJOR    := $(shell $(CXX) -v 2>&1 | \
                        grep version | cut -d' ' -f3  | cut -d'.' -f1)
GCC_MINOR    := $(shell $(CXX) -v 2>&1 | \
                        grep version | cut -d' ' -f3  | cut -d'.' -f2)

by:-

GCC_MAJOR    := $(shell $(CXX) -v 2>&1 | \
                        grep " version " | cut -d' ' -f3  | cut -d'.' -f1)
GCC_MINOR    := $(shell $(CXX) -v 2>&1 | \
                        grep " version " | cut -d' ' -f3  | cut -d'.' -f2)

i.e. require a space either side of "version".  The reason I request this is
that I made my own version of gcc and included:-

   --enable-version-specific-runtime-libs

The problem is that the output of the g++ -v command includes the switches
used to build g++ and that option appears before the gcc version number.
The net result is that string is used to infer GCC_MAJOR and GCC_MAJOR which
consequently get scrambled and I ended up with some very strange build
problems that it took a while to track down.  

Something like this could catch other people, for example if they install
into a directory path that contains the string "version" anywhere. It might
even be safer to look for "gcc version " if that would work for all
versions.

Cheers,

Nick West.



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:03 MET