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

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Fri Aug 02 2002 - 18:25:41 MEST


I've fixed it like this:

GCC_MAJOR    := $(shell $(CXX) -dumpversion 2>&1 | cut -d'.' -f1)
GCC_MINOR    := $(shell $(CXX) -dumpversion 2>&1 | cut -d'.' -f2)

Cheers, Fons.



On Fri, 2002-08-02 at 16:49, Brett Viren wrote:
> Nick West writes:
>  > 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)
> 
> GCC defines these values implicitly as CPP macros.  So, alternatively,
> you can access them like:
> 
>  GCC_MAJOR := $shell(echo|gcc -dM -E -|grep __GNUC__|cut -d' ' -f3)
>  GCC_MINOR := $shell(echo|gcc -dM -E -|grep __GNUC_MINOR__|cut -d' ' -f3)
> 
> The question is, which changes more frequently, GCC's version string
> formatting or its macro names?
> 
> -Brett.
-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7679480



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