cannot chain AC_FC_FREEFORM and AC_FC_FUNC

Dima Pasechnik <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
Backgroud: the project checks is Fortran is modern enough, and 
proceeds to configure Fortran interface on success, while
skipping it on failure.
It appears that the following seemingly natural chaining does not work:

 AC_FC_FREEFORM([AC_FC_FUNC([dgeqrf])], [AC_MSG_NOTICE([oops...ok])])

Namely, on failure of AC_FREE_FORM, still AC_FC_FUNC starts executing
and errors out (e.g. if there is no Fortran compiler found).

Here is a small configure.ac example to show this:

AC_PREREQ([2.69])
AC_INIT([foo],[1])
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_CC()
AC_PROG_FC()
AC_FC_FREEFORM([AC_FC_FUNC([dgeqrf])], [AC_MSG_NOTICE([oops...oops])])
AC_OUTPUT()

Is this a bug? Are there any workarounds for this?

Thanks
Dmitrii

PS. here is the output of ./configure generated from the above, if
there is no Fortran available

$ ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgfortran... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking for nagfor... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking whether we are using the GNU Fortran compiler... no
checking whether  accepts -g... no
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to get verbose linking output from ... configure: WARNING: compilation failed

checking for Fortran libraries of ...
checking for dummy main to link with Fortran libraries... none
checking for Fortran name-mangling scheme... configure: error: in `/home/dimpase/tmp/fc':
configure: error: cannot compile a simple Fortran program
See `config.log' for more details
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEJVdDnfI7raAa4RJxoksLHjfJBTEFAl5qUBcACgkQoksLHjfJ
BTEVKwf+MRYGK2xU00yIoWcF2uo3hJ+UqqnmFR0oCboQhrsGbV3GgEM91Flf0PrF
figtpg1iQW7WxKQKq1OY1tc68P/TuuJhvDYeTveGW19dBkcYPylsQupO6moNnNHf
CFvo40IqOe6BneMhx3VsXVrdlRa5Ah5Nv4RsWYNiuV4V4YQjwnpHqvb/3Yl6Pmqj
U08YhFv7kt553sMV+KfsuDRLD88djaUpDE0LN8ok+KM1/iTeS5uFw0FA+0E+Cx/Q
aDY/bQTfAvTTwyyuYw1nN1hnXY5VhfFn0RZMQTe0VhjvMCfPf2eKbZRVJSiOkli0
ioB4gc7OBjnIj9xwhFKi7Q9kCniX7A==
=6wMz
-----END PGP SIGNATURE-----
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.