Re: [PATCH 3/3] Use AC_CHECK_HEADERS_ONCE for the tests done by AC_INCLUDES_DEFAULT.
Eric Blake <[email protected]>
| Newsgroups | gmane.comp.sysutils.autoconf.patches |
|---|---|
| Organization | Red Hat, Inc. |
| Message-ID | <[email protected]> |
On 09/06/2013 08:10 PM, Zack Weinberg wrote: > * lib/autoconf/headers.m4 (AC_CHECK_HEADERS_ONCE): Divide into a public > macro that AC_REQUIREs _AC_INCLUDES_DEFAULT_REQUIREMENTS, and ... > (_AC_CHECK_HEADERS_ONCE): ... a private macro, that doesn't. > (_AC_HEADERS_EXPANSION): Use $ac_includes_default, not AC_INCLUDES_DEFAULT. > (_AC_INCLUDES_DEFAULT_REQUIREMENTS): Use AC_CHECK_HEADERS_ONCE. > (all of the above): Sprinkle dnl's around. > > Signed-off-by: Zack Weinberg <[email protected]> > --- > lib/autoconf/headers.m4 | 24 +++++++++++++++--------- > 1 files changed, 15 insertions(+), 9 deletions(-) > > > m4_define([_AC_HEADERS_EXPANSION], > -[ > - m4_divert_text([DEFAULTS], [ac_header_list=]) > - AC_CHECK_HEADERS([$ac_header_list], [], [], [AC_INCLUDES_DEFAULT]) > - m4_define([_AC_HEADERS_EXPANSION], []) > +[dnl > + m4_divert_text([DEFAULTS], [ac_header_list=])dnl > + AC_CHECK_HEADERS([$ac_header_list], [], [], [$ac_includes_default])dnl > + m4_define([_AC_HEADERS_EXPANSION], [])dnl > ]) Rather than adding expanded dnl's (which cause more m4 processing time every time _AC_HEADERS_EXPANSION is expanded), it's better to avoid the spurious whitespace in the first place. I've lately been using a style: m4_define([_AC_HEADERS_EXPANSION], [m4_divert_text([DEFAULTS], [ac_header_list=])]dnl [AC_CHECK_HEADERS([$ac_header_list], [], [], [$ac_includes_default])]dnl [m4_define([_AC_HEADERS_EXPANSION])]) Note that in my style, the dnl's are processed exactly once, while piecing together the outer m4_define's argument, and the definition has no spurious whitespace to begin with, so overall processing is somewhat faster. > dnl For backward compatibility, provide unconditional AC_DEFINEs of > dnl HAVE_STDLIB_H, HAVE_STRING_H, and STDC_HEADERS. > AC_DEFINE(HAVE_STDLIB_H, 1, > [Always define to 1, for backward compatibility. > - You can assume <stdlib.h> exists.]) > + You can assume <stdlib.h> exists.])dnl Uggh. This was new code in 2/3; you should avoid churn by rebasing this hunk (or even better, using my style of "]dnl [") into that patch. Looks nice. I'd still like to see another spin of this series that adds a new public macro so that users can explicitly does what _AC_INCLUDES_DEFAULT_REQUIREMENTS does now. -- 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/ iQEcBAEBCAAGBQJSMTH2AAoJEKeha0olJ0Nq6eIIAKtJQq0/sRbXaotP5SZKDiyY 9aFHDdnLG8H5tUTtFY5iHYxCytAjUiFJpt2tjtS9K0RzYq6Bn7ZD9Y7A6XdBu6fz zqCyd/RHk3gx1sUE18ZdW1vGEJY/jLTQVfhHM4/qjxChU4zj4K5Cuk3f8QUHeCzG L8p0Qj5Iun9EVBv+fp6lx5qDE19lhCSOAsNzCRrqB3OXQ3ed6alaaLU1qVQLgS9B eoAcurucX1G4vs5Z5ISAripzJnv7QWbnfV9lPvejVErAHSJBJcy2GJnJFTRL1lfh CcqxbxCculzuxp+8Ajo5K2g2q98mzL4Em5A9ZoR4KZqwsx0GWwExjbYyPUv9s5Y= =SyAK -----END PGP SIGNATURE-----