From e5d5634456062b7a55700534fe7985d3ec3bd4fc Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 9 Sep 2002 16:51:35 -0500 Subject: [svn-r5916] Purpose: Bug Fix Description: Sometimes, we needed to pick up a header file in the current build directory. Solution: Added a test to see if the compiler can handle the "-I." option so that it will get that header file. Platforms tested: Modi4 --- fortran/acsite.m4 | 46 +++++++++++++++++++++++++++++++++++++++++++--- fortran/configure | 42 ++++++++++++++++++++++++++++++++++++++++++ fortran/configure.in | 12 ++++++++++++ 3 files changed, 97 insertions(+), 3 deletions(-) diff --git a/fortran/acsite.m4 b/fortran/acsite.m4 index 940a584..74da0dc 100644 --- a/fortran/acsite.m4 +++ b/fortran/acsite.m4 @@ -1,11 +1,20 @@ dnl ------------------------------------------------------------------------- dnl ------------------------------------------------------------------------- dnl +dnl Copyright by the Board of Trustees of the University of Illinois. +dnl All rights reserved. +dnl +dnl This file is part of HDF5. The full HDF5 copyright notice, including +dnl terms governing use, modification, and redistribution, is contained in +dnl the files COPYING and Copyright.html. COPYING can be found at the root +dnl of the source code distribution tree; Copyright.html can be found at the +dnl root level of an installed copy of the electronic HDF5 document set and +dnl is linked from the top-level documents page. It can also be found at +dnl http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have +dnl access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. +dnl dnl Macros for HDF5 Fortran dnl -dnl Copyright (C) 2000, 2002 -dnl National Center for Supercomputing Applications. -dnl All rights reserved. dnl ------------------------------------------------------------------------- dnl ------------------------------------------------------------------------- @@ -262,6 +271,37 @@ rm -rf conftest* ]) dnl ------------------------------------------------------------------------- +dnl AC_TRY_FCOMPILE() +dnl +dnl Check if we can compile a simple Fortran 90 program. +dnl +dnl AC_TRY_FCOMPILE(FUNCTION-BODY, +dnl [ACTION-IF-SUCCESS], [ACTION-IF-NOT-SUCCESS]) +dnl +AC_DEFUN([AC_TRY_FCOMPILE], +[AC_LANG_SAVE +AC_LANG_FORTRAN9X + +test -d conftestdir || mkdir conftestdir +cd conftestdir +rm -rf * + +cat >conftest.$ac_ext <&5' +ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&5' +cross_compiling=$ac_cv_prog_f9x_cross + + +test -d conftestdir || mkdir conftestdir +cd conftestdir +rm -rf * + +cat >conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + : + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + : + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + FFLAGS="$FFLAGS_saved" +fi +cd .. +rm -rf conftest* + + diff --git a/fortran/configure.in b/fortran/configure.in index e894841..8385b03 100644 --- a/fortran/configure.in +++ b/fortran/configure.in @@ -407,6 +407,18 @@ AC_CACHE_SAVE dnl Change back to the Fortran 90 language AC_LANG_FORTRAN9X +dnl See if the compiler will support the "-I." option +FFLAGS_saved=$FFLAGS +FFLAGS="$FFLAGS -I." + +AC_MSG_CHECKING(if compiler supports -I. option) +AC_TRY_FCOMPILE([ + program conftest + end +], AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) + FFLAGS="$FFLAGS_saved") + dnl ---------------------------------------------------------------------- dnl The following variables are used to distinguish between building a dnl serial and parallel library. -- cgit v0.12