Reword to pacify "make alpha".
[autoconf.git] / tests / fortran.at
blob312ca5bd069e286c0af6c11f4ea0f1337efe2671
1 #                                                       -*- Autotest -*-
3 AT_BANNER([Fortran low level compiling/preprocessing macros.])
5 # Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 # 02110-1301, USA.
23 # Since the macros which compile are required by most tests, check
24 # them first.  But remember that looking for a compiler is even more
25 # primitive, so check those first.
28 ## --------------------- ##
29 ## Fortran 77 Compiler.  ##
30 ## --------------------- ##
33 AT_CHECK_MACRO([GNU Fortran 77],
34 [[AC_LANG(Fortran 77)
35 AC_LANG_COMPILER
37 if AC_TRY_COMMAND([$F77 --version | grep GNU >&2]); then
38   # Be sure to remove files which might be created by compilers that
39   # don't support --version.
40   rm -f a.exe a.out
41   # Has GNU in --version.
42   test "$G77" != yes &&
43     AC_MSG_ERROR([failed to recognize GNU Fortran 77 compiler])
44 else
45   # Be sure to remove files which might be created by compilers that
46   # don't support --version.
47   rm -f a.exe a.out
48   # Has not.
49   test "$G77" = yes &&
50     AC_MSG_ERROR([incorrectly recognized a GNU Fortran 77 compiler])
52 ]])
56 ## ------------------ ##
57 ## Fortran Compiler.  ##
58 ## ------------------ ##
61 AT_CHECK_MACRO([GNU Fortran],
62 [[AC_LANG(Fortran)
63 AC_LANG_COMPILER
65 # No Fortran compiler is known not to support "*.f".
66 AC_FC_SRCEXT([f])
68 # GNU Fortran is known to support freeform.
69 AC_FC_FREEFORM([],
70                [AC_MSG_WARN([Fortran does not accept free-form source])])
71 if test "$ac_compiler_gnu" = yes; then
72   case $FCFLAGS in
73    *-ffree-form*) ;;
74    *) AC_MSG_ERROR([failed to recognize GNU Fortran's -ffree-form option.]);;
75   esac
77 ]])