autoconf
[Top][All Lists]
Advanced

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

How can I tell if Fortran compiler is GNU ?


From: Dr. David Kirkby
Subject: How can I tell if Fortran compiler is GNU ?
Date: Sat, 23 Jan 2010 02:22:45 +0000
User-agent: Thunderbird 2.0.0.21 (X11/20090323)

Hi,
If using AC_PROG_CC and the compiler is the gcc, the variable GCC is set to 
"yes".

Likewise, if using AC_PROG_F77 and the Fortran 77 compiler is g77, then the variable G77 is set to "yes".

If however I call AC_PROG_FC, is there any simple way of knowing if that compiler is a GNU compiler? The configure script shows:

checking whether we are using the GNU Fortran compiler... (cached) no
checking whether /opt/sunstudio12.1/bin/f95 accepts -g... (cached) no
checking for Fortran flag needed to allow free-form source... -free

Is there anything I can test, that will indicate this is not a GNU compiler? It so happens it is the Sun compiler, but I don't care about that - I just want to know whether it is a GNU compiler.

What I am trying to do is test the C, C++ and Fortran compilers, to ensure they are either

1) All GNU compilers   OR
2) All non-GNU compilers

What I want is to avoid a mixture of the two. I would imagine trying to mix object files from the Sun Fortran compiler and the GNU C++ compiler is likely to end in tears.


Dave







reply via email to

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