[Top][All Lists]

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

Re: Problems with linking tests with fortran

From: Ralf Wildenhues
Subject: Re: Problems with linking tests with fortran
Date: Fri, 19 Aug 2005 17:18:37 +0200
User-agent: Mutt/1.4.1i

Hi Laurence,

* L. D. Marks wrote on Mon, Aug 01, 2005 at 11:19:56AM CEST:
> I've run into some problems writing some tests for intrinsics in fortran
> -- there are subtle (annoying) differences between these for different
> systems, so this is exactly what autoconf should be able to handle. It
> looks like some of the autoconf scripts are broken for anything except C
> (maybe C++ is OK) and need some patches. Two examples:

I believe these are all just m4 quoting issues:

> 1) The test
> [       integer*4 FSEEK,I1,I2,I3
>         i=FSEEK( I1, I2, I3) ]), ....
> does not work as expected since everything after the first FSEEK is
> ignored so I1,I2,I3 are not defined.

Quote the first argument of AC_LINK_IFELSE once, and quote the second
argument to AC_LANG_PROGRAM twice, since it is a literal and does not
contain m4 macros.  Like this:

[[      integer*4 FSEEK,I1,I2,I3
      i=FSEEK( I1, I2, I3)
]])], ...)

  info Autoconf "M4 Quotation"
for much more (than you wanted to know) about this topic.

> 2) Getting AC_LIBOBJ to accept a fortran substitution is painful. The only
> method that I've managed to get to work is
>       foo="foo.f"
>       AC_LIBSOURCE(foo.f)
>       AC_LIBOBJ([$foo])
> and ignoring the warning that I should use literals. If you use
> AC_LIBOBJ(foo.f) it looks for foo.f.c! I think AC_LANG "should" define the
> extension so
>       AC_LANG([Fortran 77])
>       AC_LIBOBJ(foo)
> will find foo.f (this might require changes in automake/autoheader..)

I don't know whether there is a "nicer" method available, but I believe
the way you do it is ok.


reply via email to

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