autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking for GCC 4


From: Ralf Wildenhues
Subject: Re: Checking for GCC 4
Date: Fri, 3 Feb 2006 09:31:54 +0100
User-agent: Mutt/1.5.11

* E. Rosten wrote on Thu, Feb 02, 2006 at 02:52:14PM CET:
> > How can I make sure user has at least gcc4 installed?
> 
> (after establishing that the compiler is gcc), and doing AC_PROG_AWK:
> 
> version=`$CXX -v 2>&1 | $AWK -F'[ .]' '/version/{print $3}'`
> 
> should do the job. There are some reasons for doing this (bigish changes
> in standards compliance in g++ 4 compared to g++ 3), but you should 
> probably check to see if you're not being overly restrictive before 
> implementing this test.

I'm very much with Ralf C. about _not_ using compiler versions for
checks, only as a last resort.

But _if_ I were to need the last resort, for example as the
ACTION-IF-CROSS-COMPILE action, I would check GCC's version
with the preprocessor macros
  __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]