[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/3] AC_CHECK_HEADER/AC_CHECK_HEADERS: complete transition to
From: |
Eric Blake |
Subject: |
Re: [PATCH 1/3] AC_CHECK_HEADER/AC_CHECK_HEADERS: complete transition to compile tests. |
Date: |
Wed, 11 Sep 2013 20:43:55 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 |
On 03/16/2013 10:37 AM, Zack Weinberg wrote:
> * lib/autoconf/headers.m4 (AC_CHECK_HEADER): Use _AC_CHECK_HEADER_COMPILE
> by default. Continue to use _AC_CHECK_HEADER_PREPROC if fourth arg is '-'.
> (_AC_CHECK_HEADER_PREPROC): Issue a deprecation warning.
> (_AC_CHECK_HEADER_MONGREL, _AC_CHECK_HEADER_MONGREL_BODY): Remove.
>
> * tests/local.at (AT_CHECK_M4): Support 'stderr' as fourth argument.
> * tests/c.at, tests/semantics.at: Update uses of AC_CHECK_HEADER(S).
> * doc/autoconf.texi, NEWS: Document change.
>
> Signed-off-by: Zack Weinberg <address@hidden>
> ---
> # The m4_indir allows for fewer expansions of address@hidden
> AC_DEFUN([AC_CHECK_HEADER],
> [m4_indir(m4_case([$4],
> - [], [[_AC_CHECK_HEADER_MONGREL]],
> [-], [[_AC_CHECK_HEADER_PREPROC]],
> [[_AC_CHECK_HEADER_COMPILE]]), $@)
Micro-optimization: when we had a ternary condition, m4_case was indeed
fastest, but now that we have a binary condition, write this:
[m4_indir(m4_if([$4], [-], [[_AC_CHECK_HEADER_PREPROC]],
[[_AC_CHECK_HEADER_COMIPLE]]), $@)
> +++ b/tests/local.at
> @@ -113,13 +113,14 @@ m4_define([AT_CHECK_M4],
> [AT_CHECK([$1], [$2], [$3],
> m4_case([$4], [], [], [ignore], [ignore], [stderr]))
> m4_case([$4], [], [], [ignore], [],
> -[AT_CHECK([[sed 's/^[^:]*m4[-.ex0-9]*: *\([^:]*:\) *\([0-9][0-9]*:
> \)/m4:\1\2/
> +[AT_CHECK([[mv stderr stderr-raw &&
> + sed 's/^[^:]*m4[-.ex0-9]*: *\([^:]*:\) *\([0-9][0-9]*: \)/m4:\1\2/
> s/^\([^:]*:\) *\([0-9][0-9]*:\)[^:]*m4[-.ex0-9]*: /m4:\1\2 /
> s/: C\(annot open \)\([^`:]*\):/: c\1`\2'\'':/
> s/: include:\( cannot open\)/:\1/
> s/^autom4te: [^ ]*m4[.ex]* /autom4te: m4 /
> s/ (E[A-Z]*)$//
> - ' stderr >&2]], [0], [], [$4])])
> + ' stderr-raw >&2]], [0], [], [$4])])
This might be worth splitting into a separate patch, as it's a useful
cleanup whether or not you change AC_CHECK_HEADER.
Looks good with those changes.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [PATCH 0/3] Modernize header checks, v2, Zack Weinberg, 2013/09/07
- [PATCH 3/3] Use AC_CHECK_HEADERS_ONCE for the tests done by AC_INCLUDES_DEFAULT., Zack Weinberg, 2013/09/07
- [PATCH 1/3] AC_CHECK_HEADER/AC_CHECK_HEADERS: complete transition to compile tests., Zack Weinberg, 2013/09/07
- Re: [PATCH 1/3] AC_CHECK_HEADER/AC_CHECK_HEADERS: complete transition to compile tests.,
Eric Blake <=
- [PATCH 2/3] Modernize AC_INCLUDES_DEFAULT and friends., Zack Weinberg, 2013/09/07
- Re: [PATCH 0/3] Modernize header checks, v2, Paul Eggert, 2013/09/07