1 dnl -*- shell-script -*-
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
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.
15 dnl Additional copyrights may follow
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
29 open(8, file="conftestval")
30 write(8, fmt="(I5)") range(x)
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])
46 # If not cross compiling, try to run (if we're cross
47 # compiling, then the value should have been loaded by the
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])])])
56 /bin/rm -f conftest*])
58 $2=AS_VAR_GET([type_var])
59 AS_VAR_POPDEF([type_var])dnl