there was an #include directive missing
[openmpi-llc.git] / config / f90_get_range.m4
blobeafe7cc642dfecd9a921aa793c0f3d338b50b684
1 dnl -*- shell-script -*-
2 dnl
3 dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
4 dnl                         University Research and Technology
5 dnl                         Corporation.  All rights reserved.
6 dnl Copyright (c) 2004-2005 The University of Tennessee and The University
7 dnl                         of Tennessee Research Foundation.  All rights
8 dnl                         reserved.
9 dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
10 dnl                         University of Stuttgart.  All rights reserved.
11 dnl Copyright (c) 2004-2005 The Regents of the University of California.
12 dnl                         All rights reserved.
13 dnl $COPYRIGHT$
14 dnl 
15 dnl Additional copyrights may follow
16 dnl 
17 dnl $HEADER$
18 dnl
20 # OMPI_F90_GET_RANGE(type, shell variable to set)
21 # -----------------------------------------------
22 AC_DEFUN([OMPI_F90_GET_RANGE],[
23     AS_VAR_PUSHDEF([type_var], [ompi_cv_f90_range_$1])
25     AC_CACHE_CHECK([range of Fortran 90 $1], type_var,
26        [cat > conftestf.f90 <<EOF
27 program f90range
28     $1 :: x
29     open(8, file="conftestval")
30     write(8, fmt="(I5)") range(x)
31     close(8)
32 end program
33 EOF
35         # Compile
36         OMPI_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 -o conftest conftestf.f90 $LDFLAGS $LIBS], [happy="yes"], [happy="no"])
38         if test "$happy" = "no"; then
39              OMPI_LOG_MSG([here is the fortran 90 program:], 1)
40              OMPI_LOG_FILE([conftestf.f90])
41              AC_MSG_WARN([Could not determine range of $1])
42              AC_MSG_WARN([See config.log for details])
43              AC_MSG_ERROR([Cannot continue])
44         fi
46         # If not cross compiling, try to run (if we're cross
47         # compiling, then the value should have been loaded by the
48         # cache already)
49         AS_IF([test "$cross_compiling" = "yes"],
50             [AC_MSG_ERROR([Can not determine range of $1 when cross-compiling])],
51             [OMPI_LOG_COMMAND([./conftest],
52                 [AS_VAR_SET(type_var, [`sed 's/  *//' conftestval`])],
53                 [AC_MSG_ERROR([Could not determine range of $1])])])
55         unset happy
56         /bin/rm -f conftest*])
58     $2=AS_VAR_GET([type_var])
59     AS_VAR_POPDEF([type_var])dnl