help-gnu-utils
[Top][All Lists]
Advanced

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

Re: autotools, preprocessors, and fortran 90


From: John
Subject: Re: autotools, preprocessors, and fortran 90
Date: Tue, 12 Dec 2006 21:02:32 +0900
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060909

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 <automake@gnu.org>, the archives are here at
> <http://lists.gnu.org/archive/html/automake/>.
Thanks, I'll post further questions here.

John



reply via email to

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