#568520 autoconf: AC_PROG_F77 code executed though in a test that is always false

#568520#5
Date:
2010-02-05 13:14:56 UTC
From:
To:
In MPFR, we had in configure.in:

if test -n "$variable_indefinie" ; then
 AC_PROG_CXX([g++])
 AC_PROG_F77([g77])
 AC_PROG_CXXCPP
fi

This doesn't seem to be forbidden according to the autoconf
documentation. Even though the test

  test -n "$variable_indefinie"

is always false, the configure script checks for the GNU Fortran 77
compiler.

To reproduce the problem:

$ svn checkout svn://scm.gforge.inria.fr/svn/mpfr/trunk@6694 mpfr
$ cd mpfr
$ autoreconf -i
$ ./configure

In the configure output:

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 for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
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 pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no

But if one replaces

 AC_PROG_F77([g77])

by

dnl AC_PROG_F77([g77])

and rerun "autoreconf -i" and ./configure, the above lines are
no longer there. There seems to be a similar problem for:

 AC_PROG_CXX([g++])

#568520#10
Date:
2010-02-05 13:39:36 UTC
From:
To:
Note that this is a regression. On a Debian/stable (lenny) machine
with autoconf 2.61-8, there is no such problem.

#568520#15
Date:
2010-02-05 13:51:25 UTC
From:
To:
I'm forwarding this bug...

I can reproduce it under Mac OS X (with autoconf 2.65).

Note that this is a regression. On a Debian/stable (lenny) machine
with autoconf 2.61-8, there is no such problem.

#568520#18
Date:
2010-02-05 13:51:25 UTC
From:
To:
I'm forwarding this bug...

I can reproduce it under Mac OS X (with autoconf 2.65).

Note that this is a regression. On a Debian/stable (lenny) machine
with autoconf 2.61-8, there is no such problem.

#568520#23
Date:
2010-02-06 13:45:33 UTC
From:
To:
Hello Vincent,

thanks for the report.

* Vincent Lefevre wrote on Fri, Feb 05, 2010 at 02:51:25PM CET:
[...]

Confirmed with Libtool 2.2.6b.  This issue is a bug in Libtool, and
fixed in git Libtool; the fix is this commit:
<http://git.savannah.gnu.org/cgit/libtool.git/commit/?id=57013d8e689ed32f0a4fb8d3b0549ed5e793e2d6>

Cheers,
Ralf

#568520#28
Date:
2010-02-06 18:39:47 UTC
From:
To:
reassign 568520 libtool
thanks

Vincent Lefevre <vincent@vinc17.net> initially reported that with

    if test -n "$variable_indefinie" ; then
     AC_PROG_CXX([g++])
     AC_PROG_F77([g77])
     AC_PROG_CXXCPP
    fi

in configure.ac, Autoconf 2.65-3 always checks for g77 even
though the "if" test is always false.

Autoconf maintainer Ralf Wildenhues confirmed the problem and
pointed to libtool as culprit:

So I'm reassigning this bug to libtool.