Index: automake.in =================================================================== RCS file: /cvs/automake/automake/automake.in,v retrieving revision 1.851 diff -u -u -r1.851 automake.in --- automake.in 2001/02/04 04:03:08 1.851 +++ automake.in 2001/02/04 13:45:30 @@ -380,7 +380,7 @@ 'compile=$(F77) $(AM_FFLAGS) $(FFLAGS)', 'compiler-name=F77COMPILE', 'output-arg=-c -o $@', - 'f', 'for', 'f90'); + 'f', 'for'); ®ister_language ('ppf77', 'linker=F77LINK', 'flags=FFLAGS', 'compile=$(F77) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)', 'compiler-name=PPF77COMPILE', @@ -392,6 +392,26 @@ 'compiler-name=RCOMPILE', 'output-arg=-c -o $@', 'r'); +®ister_language ('f90', 'linker=F90LINK', 'flags=F90FLAGS', + 'compile=$(F90) $(AM_FFLAGS) $(F90FLAGS)', + 'compiler-name=F90COMPILE', + 'output-arg=-c -o $@', + 'f90'); +®ister_language ('ppf90', 'linker=F90LINK', 'flags=F90FLAGS', + 'compile=$(F90) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(F90FLAGS)', + 'compiler-name=PPF90COMPILE', + 'output-arg=-c -o $@', + 'F90'); +®ister_language ('f95', 'linker=F95LINK', 'flags=F95FLAGS', + 'compile=$(F95) $(AM_FFLAGS) $(F95FLAGS)', + 'compiler-name=F95COMPILE', + 'output-arg=-c -o $@', + 'f95'); +®ister_language ('ppf95', 'linker=F95LINK', 'flags=F95FLAGS', + 'compile=$(F95) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(F95FLAGS)', + 'compiler-name=PPF95COMPILE', + 'output-arg=-c -o $@', + 'F95'); # FIXME: for now we can't do dependency tracking for Java. # autodep=GCJ ®ister_language ('java', 'linker=GCJLINK', 'flags=GCJFLAGS', @@ -1045,7 +1065,7 @@ next if defined $done{$lang}; $done{$lang} = 1; - $non_c = 0 if $lang !~ /(objc|cxx|f77|ratfor)$/; + $non_c = 0 if $lang !~ /(objc|cxx|f77|ppf77|ratfor|f90|ppf90|f95|ppf95)$/; if ($comp ne '') { @@ -4662,7 +4682,7 @@ &am_conf_line_warning ($filename, $., "automake requires \`AM_PROG_LEX', not \`AC_PROG_LEX'"); } - if (/AC_PROG_(F77|YACC|RANLIB|CC|CXXCPP|CXX|LEX|AWK|CPP|LN_S)/) + if (/AC_PROG_(F77|F90|F95|YACC|RANLIB|CC|CXXCPP|CXX|LEX|AWK|CPP|LN_S)/) { $configure_vars{$1} = $filename . ':' . $.; } @@ -4737,6 +4757,16 @@ { $configure_vars{'FLIBS'} = $filename . ':' . $.; } + # Check for Fortran 90 intrinsic and run-time libraries. + if (/AC_F90_LIBRARY_LDFLAGS/) + { + $configure_vars{'FLIBS'} = $filename . ':' . $.; + } + # Check for Fortran 95 intrinsic and run-time libraries. + if (/AC_F95_LIBRARY_LDFLAGS/) + { + $configure_vars{'FLIBS'} = $filename . ':' . $.; + } } close (CONFIGURE); @@ -5041,6 +5071,30 @@ return $LANG_PROCESS; } +# Rewrite a single Fortran 90 file. +sub lang_f90_rewrite +{ + return $LANG_PROCESS; +} + +# Rewrite a single preprocessed Fortran 90 file. +sub lang_ppf90_rewrite +{ + return $LANG_PROCESS; +} + +# Rewrite a single Fortran 95 file. +sub lang_f95_rewrite +{ + return $LANG_PROCESS; +} + +# Rewrite a single preprocessed Fortran 95 file. +sub lang_ppf95_rewrite +{ + return $LANG_PROCESS; +} + # Rewrite a single Objective C file. sub lang_objc_rewrite { @@ -5313,6 +5367,86 @@ . "\t\$(RCOMPILE) -F \$<\n"); } +sub lang_f90_finish +{ + # FIXME: this function can be called more than once. We should + # arrange for it to only do anything the first time through. + + local ($ltcompile, $ltlink) = &libtool_compiler; + + &define_variable ('F90LD', '$(F90)'); + &define_variable ('F90LINK', $ltlink . '$(F90LD) $(AM_FFLAGS) $(F90FLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@'); + + if (! defined $configure_vars{'F90'}) + { + &am_error ("Fortran 90 source seen but \`F90' not defined in \`$configure_ac'"); + } +} + +# Preprocessed Fortran 90 +# +# The current support for preprocessing Fortran 90 just involves passing +# `$(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)' as additional flags +# to the Fortran 90 compiler, since this is how GNU Make does it; see +# the `GNU Make Manual, Edition 0.51 for `make' Version 3.76 Beta' +# (specifically, from info file `(make)Catalogue of Rules'). +# +# A better approach would be to write an Autoconf test +# (i.e. AC_PROG_FPP) for a Fortran 90 preprocessor, because not all +# Fortran 90 compilers know how to do preprocessing. The Autoconf macro +# AC_PROG_FPP should test the Fortran 90 compiler first for +# preprocessing capabilities, and then fall back on cpp (if cpp were +# available). +sub lang_ppf90_finish +{ + &lang_f90_finish; + + # We also handle the case of preprocessing `.F90' files into `.f90' + # files. + $output_rules .= (".F90.f90:\n" + . "\t\$(F90COMPILE) -F \$<\n"); +} + +sub lang_f95_finish +{ + # FIXME: this function can be called more than once. We should + # arrange for it to only do anything the first time through. + + local ($ltcompile, $ltlink) = &libtool_compiler; + + &define_variable ('F95LD', '$(F95)'); + &define_variable ('F95LINK', $ltlink . '$(F95LD) $(AM_FFLAGS) $(F90FLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@'); + + if (! defined $configure_vars{'F95'}) + { + &am_error ("Fortran 95 source seen but \`F95' not defined in \`$configure_ac'"); + } +} + +# Preprocessed Fortran 95 +# +# The current support for preprocessing Fortran 95 just involves passing +# `$(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)' as additional flags +# to the Fortran 95 compiler, since this is how GNU Make does it; see +# the `GNU Make Manual, Edition 0.51 for `make' Version 3.76 Beta' +# (specifically, from info file `(make)Catalogue of Rules'). +# +# A better approach would be to write an Autoconf test +# (i.e. AC_PROG_FPP) for a Fortran 95 preprocessor, because not all +# Fortran 90 compilers know how to do preprocessing. The Autoconf macro +# AC_PROG_FPP should test the Fortran 95 compiler first for +# preprocessing capabilities, and then fall back on cpp (if cpp were +# available). +sub lang_ppf95_finish +{ + &lang_f95_finish; + + # We also handle the case of preprocessing `.F95' files into `.f95' + # files. + $output_rules .= (".F95.f95:\n" + . "\t\$(F95COMPILE) -F \$<\n"); +} + sub lang_objc_finish { local ($ltcompile, $ltlink) = &libtool_compiler; @@ -5379,6 +5513,10 @@ if defined $linkers{'CXXLINK'}; return 'F77LINK' if defined $linkers{'F77LINK'}; + return 'F90LINK' + if defined $linkers{'F90LINK'}; + return 'F95LINK' + if defined $linkers{'F95LINK'}; return 'OBJCLINK' if defined $linkers{'OBJCLINK'}; return 'LINK';