Re: [PATCH] autoupdate: do not AC_REQUIRE(AC_PROG_CC)

Eric Blake <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches
Organization Red Hat, Inc.
Message-ID <[email protected]>
On 08/30/2013 06:48 AM, Sami Kerola wrote:
> * Autoupdate will convert various AC_PROG_CC_* lines to AC_PROG_CC
> surrounded by AC_REQUIRE macro, which is unexpected.  The AC_PROG_CC is
> never used in AC_DEFUN.  The problem can be seen when running autoreconf
> in verbose mode after autoupdate.
> 
> $ autoupdate -f
> $ autoreconf -f -i -Wall
> [...]
> configure.ac:42: error: AC_REQUIRE(): cannot be used outside of an AC_DEFUN'd macro

Thanks for the patch.  I'm still thinking about what is right to do;
there are many people that did:

AC_DEFUN([mymacro], [
AC_PROG_CC_C89
...
])

where the correct conversion is indeed:

AC_DEFUN([mymacro], [
AC_REQUIRE([AC_PROG_CC])
...
])

but when used at the top level instead of inside a user macro, you are
right that the AC_REQUIRE is annoying.  Autoupdate doesn't get much use
these days.  I'm wondering if there is a way to detect within autoupdate
whether a replacement is occurring at the top level or inside a macro,
and conditionally emit the AC_REQUIRE based on that determination.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc (application/pgp-signature, 621 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJSJdrpAAoJEKeha0olJ0NqpbwH/R/l+fNQqLueRTAukOnbHzeN
4lpC/y7hBf+AmHJoBCwD/QZgQvcewshtUmINhFyxhG6Gh8b/NbM4jpKF1VekiZ1k
4vBtX5kbF4ZUMCrazRAA+p1yKLQkN8IV9wqoXuTNPZmAcJTVoQ/lDT1hrgRBUghU
sy1ImvwCMyDEDiheTUbg11a0wweGLQws5JiXogD4GWXY3Z4tceCr5UFYSXljWNUg
SLlaECXfy9GeUDfhooGuHnHDopGjUNsfhM1pKgEuHe4UCcDSufepNZpA6LHsIohB
ybAmF+dskr1z4GUJyCB/8M8Qnca7HLCDKRGGVaR9eKxuzNaEJ7SIH1Ax0mA+4G8=
=H3aW
-----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.