| 1 | # -*- Autotest -*-
|
|---|
| 2 |
|
|---|
| 3 | AT_BANNER([Fortran low level compiling/preprocessing macros.])
|
|---|
| 4 |
|
|---|
| 5 | # Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
|
|---|
| 6 | #
|
|---|
| 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.
|
|---|
| 11 | #
|
|---|
| 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.
|
|---|
| 16 | #
|
|---|
| 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.
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 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.
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 | ## --------------------- ##
|
|---|
| 29 | ## Fortran 77 Compiler. ##
|
|---|
| 30 | ## --------------------- ##
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 | AT_CHECK_MACRO([GNU Fortran 77],
|
|---|
| 34 | [[AC_LANG(Fortran 77)
|
|---|
| 35 | AC_LANG_COMPILER
|
|---|
| 36 |
|
|---|
| 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])
|
|---|
| 51 | fi
|
|---|
| 52 | ]])
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 | ## ------------------ ##
|
|---|
| 57 | ## Fortran Compiler. ##
|
|---|
| 58 | ## ------------------ ##
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 | AT_CHECK_MACRO([GNU Fortran],
|
|---|
| 62 | [[AC_LANG(Fortran)
|
|---|
| 63 | AC_LANG_COMPILER
|
|---|
| 64 |
|
|---|
| 65 | # No Fortran compiler is known not to support "*.f".
|
|---|
| 66 | AC_FC_SRCEXT([f])
|
|---|
| 67 |
|
|---|
| 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
|
|---|
| 76 | fi
|
|---|
| 77 | ]])
|
|---|