Re: autotools, preprocessors, and fortran 90

John <[email protected]>
Newsgroups gmane.comp.gnu.utils
Organization Aioe.org NNTP Server
Message-ID <[email protected]>
Hi Ralph,

Ralf Wildenhues wrote:
> cat >configure.ac <<\EOF
> AC_INIT([fortran-test], [1], [devnull])
> AM_INIT_AUTOMAKE([foreign])
> AC_CONFIG_FILES([Makefile])
> AC_PROG_FC
> if test $ac_cv_fc_compiler_gnu = yes; then
>   AC_SUBST([MY_CPPFLAGS], ["-x f95-cpp-input"])
> fi
> AC_OUTPUT
> EOF
> cat >Makefile.am <<\EOF
> bin_PROGRAMS = foo
> foo_SOURCES = foo.F95
> AM_CPPFLAGS = $(MY_CPPFLAGS)
> EOF
> cat >foo.F95 <<\EOF
>       program main
>       end
> EOF
> autoreconf -vi
> ./configure
> make

This works.  Thanks.  Is there some way to avoid having to use the
capital F's?  It's not too much of an issue, but I have my project under
version control and renaming file names is a bit of a pain.

> With respect to portability among compilers, this example is lacking the
> flag for source file extensions, AC_FC_SRCEXT([F95]).  I omitted it
> because Automake does not automatically add support for it yet
> (for .f90 and .f95, that has been added in Automake 1.10).  If you need
> this, write me, and I'll post an updated example.

I use the f90 extension regardless of whether the file is f90 or f95, so
I don't think I need to add this support.

> The address is <[email protected]>, the archives are here at
> <http://lists.gnu.org/archive/html/automake/>.
Thanks, I'll post further questions here.

John
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.