AC_CHECK_HEADERS_ONCE: hoist cache name computation to m4 time
commit0848232967ea70448d3767f22ff2f7d359e67580
authorEric Blake <eblake@redhat.com>
Wed, 21 Dec 2016 14:32:43 +0000 (21 08:32 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 21 Dec 2016 14:32:43 +0000 (21 08:32 -0600)
tree21e33a9e19ef52f4b2901790f1ecc016f0891d18
parentd068c0a5ac8ef095fe39b17fefe576b17fc3ab4a
AC_CHECK_HEADERS_ONCE: hoist cache name computation to m4 time

Rather than perform a sed script on each element of the
$ac_header_c_list to compute the corresponding cache name, we
can inline enough of AC_CHECK_HEADER to bypass the normal
polymorphic code, and instead directly use the literal
header and cache name that we are consuming from the list.

The resulting configure script is roughly unchanged in size,
but performs slightly faster.

* lib/autoconf/headers.m4 (AC_CHECK_HEADER_COMPILE): Split out shell
function registration...
(_AC_CHECK_HEADER_COMPILE_FN): ...to here.
(_AC_HEADERS_EXPANSION): Use it to inline enough of AC_CHECK_HEADER
to operate on a literal rather than a shell variable, for fewer sed
calls.

Signed-off-by: Eric Blake <eblake@redhat.com>
lib/autoconf/headers.m4