3 AT_BANNER([Fortran low level compiling/preprocessing macros.])
5 # Copyright (C) 2000, 2001, 2003, 2008, 2009, 2010 Free Software
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 # Since the macros which compile are required by most tests, check
22 # them first. But remember that looking for a compiler is even more
23 # primitive, so check those first.
26 ## --------------------- ##
27 ## Fortran 77 Compiler. ##
28 ## --------------------- ##
31 AT_CHECK_MACRO([GNU Fortran 77],
35 if AC_TRY_COMMAND([$F77 --version | grep GNU >&2]); then
36 # Be sure to remove files which might be created by compilers that
37 # don't support --version.
39 # Has GNU in --version.
41 AC_MSG_ERROR([failed to recognize GNU Fortran 77 compiler])
43 # Be sure to remove files which might be created by compilers that
44 # don't support --version.
48 AC_MSG_ERROR([incorrectly recognized a GNU Fortran 77 compiler])
54 ## ------------------ ##
55 ## Fortran Compiler. ##
56 ## ------------------ ##
59 AT_CHECK_MACRO([GNU Fortran],
63 # No Fortran compiler is known not to support "*.f".
66 # GNU Fortran is known to support freeform.
68 [AC_MSG_WARN([Fortran does not accept free-form source])])
69 if test "$ac_compiler_gnu" = yes; then
72 *) AC_MSG_ERROR([failed to recognize GNU Fortran's -ffree-form option]);;
78 ## ------------------------- ##
79 ## AC_OPENMP and Fortran 77. ##
80 ## ------------------------- ##
82 AT_SETUP([AC_OPENMP and Fortran 77])
84 AT_DATA([configure.ac],
89 if test "X$ac_cv_prog_f77_openmp" = Xunsupported; then
92 FFLAGS="$FFLAGS $OPENMP_FFLAGS"
93 AC_CONFIG_FILES([Makefile])
97 AT_DATA([Makefile.in],
98 [[foo@EXEEXT@: foo.@OBJEXT@
99 @F77@ @FFLAGS@ @LDFLAGS@ -o $@ foo.@OBJEXT@
102 @F77@ @FFLAGS@ -c foo.f
111 AT_CHECK([env ACLOCAL=true autoreconf -vi], [], [ignore], [ignore])
112 AT_CHECK([./configure $configure_options], [], [ignore], [ignore])
113 AT_CHECK([$MAKE], [], [ignore], [ignore])
118 ## ---------------------- ##
119 ## AC_OPENMP and Fortran. ##
120 ## ---------------------- ##
122 AT_SETUP([AC_OPENMP and Fortran])
124 AT_DATA([configure.ac],
129 if test "X$ac_cv_prog_fc_openmp" = Xunsupported; then
132 FCFLAGS="$FCFLAGS $OPENMP_FCFLAGS"
133 AC_CONFIG_FILES([Makefile])
137 AT_DATA([Makefile.in],
138 [[foo@EXEEXT@: foo.@OBJEXT@
139 @FC@ @FCFLAGS@ @LDFLAGS@ -o $@ foo.@OBJEXT@
142 @FC@ @FCFLAGS@ -c foo.f
151 AT_CHECK([env ACLOCAL=true autoreconf -vi], [], [ignore], [ignore])
152 AT_CHECK([./configure $configure_options], [], [ignore], [ignore])
153 AT_CHECK([$MAKE], [], [ignore], [ignore])