AC_CHECK_FUNCS_ONCE: hoist cache name computation to m4 time
commitd068c0a5ac8ef095fe39b17fefe576b17fc3ab4a
authorEric Blake <eblake@redhat.com>
Fri, 4 Nov 2016 01:03:06 +0000 (3 20:03 -0500)
committerEric Blake <eblake@redhat.com>
Wed, 21 Dec 2016 14:32:41 +0000 (21 08:32 -0600)
tree5da1d9032c11e62575d05f65dc3ceb599022d45e
parent76183791a41bf8777cbce94e1b899529dc98e124
AC_CHECK_FUNCS_ONCE: hoist cache name computation to m4 time

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

While at it, we can use echo instead of cat to append to
confdefs.h, for another process shaved.

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

* lib/autoconf/functions.m4 (AC_CHECK_FUNC): Split out shell
function registration...
(_AC_CHECK_FUNC_FN): ...to here.
(_AC_FUNCS_EXPANSION): Use it to inline enough of AC_CHECK_FUNC to
operate on a literal rather than a shell variable, for fewer sed
calls.

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