Re: [PATCH] doc: mention how to set early defaults

Eric Blake <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches
Organization Red Hat, Inc.
Message-ID <[email protected]>
On 09/05/2013 02:20 PM, Eric Blake wrote:

> * doc/autoconf.texi (Diversion support) <m4_divert_text>: Add
> anchor.
> (External Software) <AC_ARG_WITH>: Demonstrate how to use DEFAULTS
> diversion, for earlier defaults.
> (Package Options) <AC_ARG_ENABLE>: Likewise.

> @@ -22111,7 +22118,7 @@ External Software
>    [AS_HELP_STRING([--with-readline],
>      [support fancy command line editing @@<:@@default=check@@:>@@])],
>    [],
> -  [with_readline=check])
> +  [m4_divert_text([DEFAULTS], [with_readline=check])])

And actually testing this reveals that autoconf generates a syntax error:

# Check whether --with-readline was given.
if test "${with_readline+set}" = set; then :
  withval=$with_readline;
else

fi

Looks like AS_IF doesn't know how to optimize out m4_divert_text as not
needing an else clause, so the example needs to be tweaked to provide an
explicit statement in argument 4 (':' will do), or use the
m4_divert_text outside of AC_ARG_WITH.  Another good reason why I posted
for review first rather than just pushing the patch.

-- 
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/

iQEcBAEBCAAGBQJSKO5UAAoJEKeha0olJ0Nqe2YIAIg+Nj7Mn1eNES57jIacn0SC
iVSaq/Gccfrk2l7kEGq8Ezct778cKmckuFnUdWH2XVHFc2bRM2NeU1UaD1ZHhn16
MtNqYxJqMFJCNPi+mXfBw033nyHF4B8FMMxU2b/jo9fO4ShX5B8QsovHwi7p1nKO
cm0xsSTmz3hbSr5JGJrW7ZJejPJR5Er+kVJ4YWsfjvpJ2OKm7lLfN18iOkRSR7VX
nD1D6bbGtrAWUteqsLzpfOx7t0PWWVOMiRfKH3zSoY9ndFBTvYWzEZGPJ5TTLe1Y
DC+tpSAz6ArzOFZe3S83wIT2YKxE8UveliDGwvEw8wRVOkrqKwoVIXqWerHLQmQ=
=+WxE
-----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.