1dnl  This file is part of MED.
2dnl
3dnl  COPYRIGHT (C) 1999 - 2019  EDF R&D, CEA/DEN
4dnl  MED is free software: you can redistribute it and/or modify
5dnl  it under the terms of the GNU Lesser General Public License as published by
6dnl  the Free Software Foundation, either version 3 of the License, or
7dnl  (at your option) any later version.
8dnl
9dnl  MED is distributed in the hope that it will be useful,
10dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
11dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12dnl  GNU Lesser General Public License for more details.
13dnl
14dnl  You should have received a copy of the GNU Lesser General Public License
15dnl  along with MED.  If not, see <http://www.gnu.org/licenses/>.
16dnl
17
18AC_DEFUN([_MED_DEFINE_F77_ENABLE],[
19
20 AC_ARG_ENABLE(fortran, [AS_HELP_STRING([--enable-fortran],
21    [Compile the MED FORTRAN library.  Default: enabled])
22 ],[
23enable_fortran=$enableval
24 ],[
25 enable_fortran=yes
26 ])
27 AM_CONDITIONAL([ENABLE_FORTRAN],[test x"$enable_fortran" = xyes ])
28 test x"$enable_fortran" = xyes && AC_DEFINE(MED_HAVE_FORTRAN,1,
29   [Define if the Fortran part of MED library must be compiled.])
30 test ! x"$enable_fortran" = xyes && AC_DEFINE(MED_HAVE_FORTRAN,0,
31   [Define if the Fortran part of MED library must be compiled.])
32
33])
34
35AC_DEFUN([_MED_CALLING_F77], [
36  AC_REQUIRE([_MED_DEFINE_F77_ENABLE])
37
38#la macro de détection du compilateur f77 cherchera le compilateur séquentiel
39#si mpi_wanted_test == no
40  AX_PROG_F77_MPI(test "x$mpi_wanted_test" = "xyes",[],[
41    if test x"$mpi_wanted_test" = xyes && test x"$enable_fortran" = xyes ; then
42      AC_MSG_FAILURE([MPI F77 compiler requested, but couldn't use MPI.])
43    fi
44  ])
45
46])
47
48
49AC_DEFUN_ONCE([MED_CHECK_F77],dnl
50[
51#The macro for detecting Fortran compilers must not be called before
52# testing mpi fortran compiler frontend
53AC_BEFORE([$0],[AC_PROG_F77])
54AC_REQUIRE([_MED_CALLING_F77])
55
56AS_IF([test x"$enable_fortran" = xyes ],
57[
58## Looking for "$f77prog" presence
59
60# Pour l'affichage du Summary
61   BUILD_F77TESTS_CONDITIONAL_TRUE=
62   BUILD_F77TESTS_CONDITIONAL_FALSE='#'
63],[
64   FC=""
65# Pour l'affichage du Summary
66   BUILD_F77TESTS_CONDITIONAL_TRUE='#'
67   BUILD_F77TESTS_CONDITIONAL_FALSE=
68])
69
70AC_SUBST([BUILD_F77TESTS_CONDITIONAL_TRUE])
71AC_SUBST([BUILD_F77TESTS_CONDITIONAL_FALSE])
72
73])
74
75