autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fortran 9x support


From: Steven G. Johnson
Subject: Fortran 9x support
Date: Fri, 8 Nov 2002 03:35:14 -0500 (EST)

Hello all,

As I proposed in the recent "Fortran 9x" thread on the autoconf mailing
list, I've added support to fortran.m4 for using newer Fortran dialects
simultaneously with Fortran 77.

For a rationale and discussion, see the abovementioned thread.  A quick
summary of the changes is:

1) The F77 interface is unchanged.  Same macros, and same output variables
(F77, FFLAGS, FLIBS).  (If the output variables are changed, existing
features of automake will break, etcetera.  There was a proposal to use
F77FLAGS in accordance with GNU Make, but I'll leave it to others to
break backward compatibility if they are brave enough.)

2) There are new "FC" macros corresponding to all of the old F77 macros,
with output variables FC, FCFLAGS, and FCLIBS.  AC_PROG_FC defaults to
picking the newest available dialect, but older dialects can be specified.

3) The FC and F77 macros share common backend macros in all non-trivial
cases.  To do this I needed to add a new _AC_LANG_PREFIX macro to return a
prefix (F, FC, C, CXX) for environment variables.

4) I've added two new FC-only macros specifically for newer Fortran
dialects.  For a complete description, see the source, but to summarize:

AC_FC_SRCEXT(EXT, [ACTION-IF-SUCCESS], [ACTION-IF-FAIL])
        -- set the extension used for subsequent tests to EXT (e.g. f90);
the default extension is f.  Also can detect whether special compiler
flags are required to support the new extension (in particular with IBM's
compilers).

AC_FC_FREEFORM([ACTION-IF-SUCCESS], [ACTION-IF-FAIL])
        -- find compiler flags (added to FCFLAGS) to convince the compiler
to accept free-form source files.  (I've found at least one compiler (VAST
f90) where this apparently isn't possible for .f files, so I would
recommend that users use this in conjunction with AC_FC_SRCEXT to first
set the extension to .f90 or whatever.  Of course, in that case, this
macro is normally not needed...)

I've done basic testing of the various new Fortran macros on the systems
available to me (Linux with VAST f90, AIX, Alpha/Tru64, IRIX) and they
seem to be working.

I haven't written documentation yet because I expect that the patch will
change somewhat in response to feedback, and I am under no illusions that
this will make it into Autoconf 2.55.  =)

We should also coordinate with the Automake folks.  Using the new macros
in automake should be straightforward; the main question is which compiler
to use for which file extensions, and how to interact with AC_FC_SRCEXT.
(I've already proposed one possible behavior on the autoconf mailing list
thread.)

Cordially,
Steven G. Johnson

Attachment: diff.out
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]