automake
[Top][All Lists]
Advanced

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

Improved Fortran support


From: marq
Subject: Improved Fortran support
Date: Sun, 4 Feb 2001 15:13:26 +0100 (CET)

Hello,

to begin with, I'm an awful beginner when it comes to automake's
internals... I beg your pardon if the attached patch should break
something or is too much off the line.

I have used autoconf/automake a lot to configure programs and libraries
written in Fortran 77 and Fortran 90, partially using some autoconf
macros provided by Martin Wilck several months ago (they don't work with
the current CVS-version of autoconf anymore, but that's another issue).
Regarding automake, I believe there is an inconsistency in the way
automake handles Fortran file extensions:

 - For files ending with .f or .for, Makefile targets are created
   using the variables F77, FFLAGS, and F77LINK (apart from the standard
   ones. Fine.
   
 - Files ending with .f90 are also handled this way; i.e. Fortran 77 (!)
   targets are created for them - not really fine... :-(

 - Files ending with .F are handled in a special way - as preprocessed
   Fortran files. Great!

 - Files with .F90 are not handled at all, nor are Fortran 95 files
   (.f95 or .F95). :-((

The last point is annoying, since it prohibits the use of any
.F90 or even .f95 files in any project that is maintained with automake:
it simply doesn't generate the proper dependencies for a library or
program - a .F90, .f95 or .F95 is never compiled, even if the
Makefile.am contains handwritten rules for their generation.

I have tried to solve this by adding the appropriate register_language
calls for f90, ppf90, f95, and ppf95; I also added some auxiliary
routines within automake.in. The generated targets are more or less
identical to those generated from the f77/ppf77 set of routines, but use
the Makefile variables F90, F90FLAGS, F90LINK and F95, F95FLAGS,
F95LINK, respectively. These somehow have to be generated by
configure.in.

To my understanding, this shouldn't break anything apart from the
"feature" that Fortran 90 files are compiled by a Fortran 77 compiler.
Probably, this could be reproduced by adding something like

  F90      = @F77@
  F90FLAGS = @FFLAGS@
  F90LINK  = @F77LINK@

in the Makefile.am (though I haven't tried that).

Thank you for considering this, and kind regards,

  Chris.


-- 

  Christian Marquardt

  GFZ Potsdam, Div. 1             |       Tel.: (+49) 331-288-1168
  Am Telegrafenberg               |       Fax:  (+49) 331-288-1169
  D-14473 Potsdam                 |       Email: address@hidden

Attachment: fortran_patch.diff
Description: Text document


reply via email to

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