* automake.in: Add "fc" and "ppfc" languages for Fortran 9x.
* doc/automake.texi (Fortran 9x Support): New section.
* lib/Automake/Variable.pm (%_ac_macro_for_var): Add AC_PROG_FC.
* tests/compile_f90_c_cxx.test: New file.
* tests/ext.test: Add AC_PROG_FC.
* tests/f90only.test: New file.
* tests/link_f90_only.test: New file.
* tests/Makefile.am (TESTS): Add new tests.
+2004-04-02 Mike Nolta <mike@nolta.net>
+
+ Better support for Fortran 9x.
+ * automake.in: Add "fc" and "ppfc" languages for Fortran 9x.
+ * doc/automake.texi (Fortran 9x Support): New section.
+ * lib/Automake/Variable.pm (%_ac_macro_for_var): Add AC_PROG_FC.
+ * tests/compile_f90_c_cxx.test: New file.
+ * tests/ext.test: Add AC_PROG_FC.
+ * tests/f90only.test: New file.
+ * tests/link_f90_only.test: New file.
+ * tests/Makefile.am (TESTS): Add new tests.
+
2004-04-01 Paul Eggert <eggert@twinsun.com>
* lib/install-sh: If "mv -f" works, use it, and fall back to
New in 1.8a:
+* Better support for Fortran 90/95 with the new "fc" and "ppfc" languages.
+ Works the same as the old Fortran 77 implementation; just replace F77
+ with FC everywhere (exception: FFLAGS becomes FCFLAGS). Requires a
+ version of autoconf which provides AC_PROG_FC (>=2.59).
+
* Libtool tags are used with libtool versions that support them.
(I.e., with Libtool 1.5 or greater.)
Michael Brantley Michael-Brantley@deshaw.com
Michel de Ruiter mdruiter@cs.vu.nl
Mike Castle dalgoda@ix.netcom.com
+Mike Nolta mrnolta@princeton.edu
Miles Bader miles@ccs.mt.nec.co.jp
Miloslav Trmac trmac@popelka.ms.mff.cuni.cz
Miodrag Vallat miodrag@ifrance.com
'lder' => 'F77LD',
'ld' => '$(F77)',
'pure' => 1,
- 'extensions' => ['.f', '.for', '.f90']);
+ 'extensions' => ['.f', '.for']);
+
+# Fortran
+register_language ('name' => 'fc',
+ 'Name' => 'Fortran',
+ 'linker' => 'FCLINK',
+ 'link' => '$(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
+ 'flags' => ['FCFLAGS'],
+ 'compile' => '$(FC) $(AM_FCFLAGS) $(FCFLAGS)',
+ 'compiler' => 'FCCOMPILE',
+ 'compile_flag' => '-c',
+ 'output_flag' => '-o',
+ 'lder' => 'FCLD',
+ 'ld' => '$(FC)',
+ 'pure' => 1,
+ 'extensions' => ['.f90', '.f95']);
+
+# Preprocessed Fortran
+register_language ('name' => 'ppfc',
+ 'Name' => 'Preprocessed Fortran',
+ 'config_vars' => ['FC'],
+ 'linker' => 'FCLINK',
+ 'link' => '$(FCLD) $(AM_FFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
+ 'lder' => 'FCLD',
+ 'ld' => '$(FC)',
+ 'flags' => ['FCFLAGS', 'CPPFLAGS'],
+ 'compiler' => 'PPFCCOMPILE',
+ 'compile' => '$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)',
+ 'compile_flag' => '-c',
+ 'output_flag' => '-o',
+ 'libtool_tag' => 'FC',
+ 'pure' => 1,
+ 'extensions' => ['.F90','.F95']);
# Preprocessed Fortran 77
#
return LANG_PROCESS;
}
+# Rewrite a single Fortran file.
+sub lang_fc_rewrite
+{
+ return LANG_PROCESS;
+}
+
+# Rewrite a single preprocessed Fortran file.
+sub lang_ppfc_rewrite
+{
+ return LANG_PROCESS;
+}
+
# Rewrite a single preprocessed Fortran 77 file.
sub lang_ppf77_rewrite
{
{
my (%linkers) = @_;
- foreach my $l (qw(GCJLINK CXXLINK F77LINK OBJCLINK))
+ foreach my $l (qw(GCJLINK CXXLINK F77LINK FCLINK OBJCLINK))
{
return $l if defined $linkers{$l};
}
* C++ Support:: Compiling C++ sources
* Assembly Support:: Compiling assembly sources
* Fortran 77 Support:: Compiling Fortran 77 sources
+* Fortran 9x Support:: Compiling Fortran 9x sources
* Java Support:: Compiling Java sources
* Support for Other Languages:: Compiling other languages
* ANSI:: Automatic de-ANSI-fication
* How the Linker is Chosen:: Automatic linker selection
+Fortran 9x Support
+
+* Compiling Fortran 9x Files:: Compiling Fortran 9x sources
+
Other Derived Objects
* Scripts:: Executable scripts
C++}). @xref{Macros, , Autoconf macros supplied with Automake}.
@cvindex AC_F77_LIBRARY_LDFLAGS
+@item AC_PROG_FC
+This is required if any Fortran 90/95 source is included. This macro is
+distributed with Autoconf version 2.58 and later. @xref{Particular
+Programs, , Particular Program Checks, autoconf, The Autoconf Manual}.
+@cvindex AC_PROG_FC
+
@item AC_PROG_LIBTOOL
Automake will turn on processing for @code{libtool} (@pxref{Top, ,
Introduction, libtool, The Libtool Manual}).
* C++ Support:: Compiling C++ sources
* Assembly Support:: Compiling assembly sources
* Fortran 77 Support:: Compiling Fortran 77 sources
+* Fortran 9x Support:: Compiling Fortran 9x sources
* Java Support:: Compiling Java sources
* Support for Other Languages:: Compiling other languages
* ANSI:: Automatic de-ANSI-fication
+---------+---------+---------+
@end example
+@node Fortran 9x Support
+@comment node-name, next, previous, up
+@section Fortran 9x Support
+
+@cindex Fortran 9x support
+@cindex Support for Fortran 9x
+
+Automake includes full support for Fortran 9x.
+
+Any package including Fortran 9x code must define the output variable
+@samp{FC} in @file{configure.ac}; the simplest way to do this is to use
+the @code{AC_PROG_FC} macro (@pxref{Particular Programs, , Particular
+Program Checks, autoconf, The Autoconf Manual}).
+
+A few additional variables are defined when a Fortran 9x source file is
+seen:
+
+@vtable @code
+
+@item FC
+The name of the Fortran 9x compiler.
+
+@item FCFLAGS
+Any flags to pass to the Fortran 9x compiler.
+
+@item AM_FCFLAGS
+The maintainer's variant of @code{FCFLAGS}.
+
+@item FCCOMPILE
+The command used to actually compile a Fortran 9x source file. The file
+name is appended to form the complete command line.
+
+@item FCLINK
+The command used to actually link a pure Fortran 9x program or shared
+library.
+
+@end vtable
+
+@menu
+* Compiling Fortran 9x Files:: Compiling Fortran 9x sources
+@end menu
+
+@node Compiling Fortran 9x Files
+@comment node-name, next, previous, up
+@subsection Compiling Fortran 9x Files
+
+@file{N.o} is made automatically from @file{N.f90} or @file{N.f95}
+by running the Fortran 9x compiler. The precise command used
+is as follows:
+
+@table @file
+
+@item .f9x
+@code{$(FC) -c $(AM_FCFLAGS) $(FCFLAGS)}
+
+@end table
@node Java Support
@comment node-name, next, previous, up
@section Support for Other Languages
Automake currently only includes full support for C, C++ (@pxref{C++
-Support}), Fortran 77 (@pxref{Fortran 77 Support}), and Java
-(@pxref{Java Support}). There is only rudimentary support for other
+Support}), Fortran 77 (@pxref{Fortran 77 Support}),
+Fortran 9x (@pxref{Fortran 9x Support}),
+and Java (@pxref{Java Support}). There is only rudimentary support for other
languages, support for which will be improved based on user demand.
Some limited support for adding your own languages is available via the
-@set UPDATED 16 February 2004
-@set UPDATED-MONTH February 2004
+@set UPDATED 2 April 2004
+@set UPDATED-MONTH April 2004
@set EDITION 1.8a
@set VERSION 1.8a
-@set UPDATED 16 February 2004
-@set UPDATED-MONTH February 2004
+@set UPDATED 2 April 2004
+@set UPDATED-MONTH April 2004
@set EDITION 1.8a
@set VERSION 1.8a
CXXFLAGS => 'AC_PROG_CXX',
F77 => 'AC_PROG_F77',
F77FLAGS => 'AC_PROG_F77',
+ FC => 'AC_PROG_FC',
+ FCFLAGS => 'AC_PROG_FC',
RANLIB => 'AC_PROG_RANLIB',
YACC => 'AC_PROG_YACC',
);
comment5.test \
comment6.test \
comment7.test \
+compile_f90_c_cxx.test \
compile_f_c_cxx.test \
cond.test \
cond2.test \
extra5.test \
extra6.test \
extra7.test \
+f90only.test \
flibs.test \
fnoc.test \
fo.test \
license.test \
link_c_cxx.test \
link_dist.test \
+link_f90_only.test \
link_fc.test \
link_fccxx.test \
link_fcxx.test \
comment5.test \
comment6.test \
comment7.test \
+compile_f90_c_cxx.test \
compile_f_c_cxx.test \
cond.test \
cond2.test \
extra5.test \
extra6.test \
extra7.test \
+f90only.test \
flibs.test \
fnoc.test \
fo.test \
license.test \
link_c_cxx.test \
link_dist.test \
+link_f90_only.test \
link_fc.test \
link_fccxx.test \
link_fcxx.test \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Test to make sure rules to invoke all compilers are selected with
+# mixed source objects.
+# (copied from compile_f_c_cxx.test) Mike Nolta <mrnolta@princeton.edu>
+
+. ./defs || exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_FC
+AC_FC_LIBRARY_LDFLAGS
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo
+foo_SOURCES = foo.f90 bar.c baz.cc
+foo_LDADD = @FLIBS@
+END
+
+: > foo.f90
+: > bar.c
+: > baz.cc
+
+$ACLOCAL || exit 1
+$AUTOMAKE || exit 1
+
+
+# Look for the macros at the beginning of rules. Be careful, as there
+# are literal tabs at the beginning of the search strings.
+grep ' \$(COMPILE)' Makefile.in || exit 1
+grep ' \$(CXXCOMPILE)' Makefile.in || exit 1
+grep ' \$(FCCOMPILE)' Makefile.in || exit 1
+
+exit 0
cat >> configure.in << 'END'
AC_PROG_F77
+AC_PROG_FC
_AM_DEPENDENCIES(OBJC)
AC_SUBST(OBJC)
END
--- /dev/null
+#! /bin/sh
+# Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Make sure programs with only Fortran 90 source are handled properly.
+# (copied from fonly.test) Mike Nolta <mrnolta@princeton.edu>
+
+. ./defs || exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_FC
+END
+
+# Tue Aug 11 09:50:48 1998 Matthew D. Langston <langston@SLAC.Stanford.EDU>
+#
+# This test currently fails with automake v. 1.3 since automake assumes
+# that elements of `bin_PROGRAMS' (e.g. zardoz) without a corresponding
+# `_SOURCES' (e.g. zardoz_SOURCES) should be compiled from `zardoz.c'
+# whether or not `zardoz.c' actually exists. For example, even if the
+# file `zardoz.c' doesn't exist but the file `zardoz.f' does exist, this
+# tests would still fail.
+#
+# Therefore, for now I have put in the line `zardoz_SOURCES = zardoz.f'
+# (see below) so that automake's top-level `make check' won't fail, but
+# this line should be removed once automake handles this situation
+# correctly.
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = zardoz
+zardoz_SOURCES = zardoz.f90
+END
+
+: > zardoz.f90
+
+$ACLOCAL || exit 1
+$AUTOMAKE || exit 1
+
+grep 'zardoz.f90' Makefile.in
--- /dev/null
+#! /bin/sh
+# Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Test to make sure the Fortran 90 linker is used when appropriate.
+# (copied from link_f_only.test) Mike Nolta <mrnolta@princeton.edu>
+
+. ./defs || exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_FC
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = lavalamp
+lavalamp_SOURCES = lamp.f90
+END
+
+: > lamp.f90
+
+$ACLOCAL || exit 1
+$AUTOMAKE || exit 1
+
+
+# We should only see the Fortran linker in the rules of `Makefile.in'.
+
+# Look for this macro not at the beginning of any line; that will have
+# to be good enough for now.
+grep '.\$(FCLINK)' Makefile.in || exit 1
+
+# We should not see these patterns:
+grep '.\$(CXXLINK)' Makefile.in && exit 1
+grep '.\$(LINK)' Makefile.in && exit 1
+
+exit 0