AC_CHECK_FUNCS_ONCE: honor current AC_LANG
commit4523f7c32b052e805c4081fa6a55c7414d94d791
authorEric Blake <eblake@redhat.com>
Thu, 3 Nov 2016 15:28:07 +0000 (3 10:28 -0500)
committerEric Blake <eblake@redhat.com>
Tue, 20 Dec 2016 19:34:20 +0000 (20 13:34 -0600)
tree41d30ba5b52857180df5609884d5adf07ad07d87
parenteea950a012e8725da53e0444a43d508d0b645d8f
AC_CHECK_FUNCS_ONCE: honor current AC_LANG

Previously, AC_CHECK_FUNCS_ONCE collected a list of function names
to check, but ran the checks using the AC_LANG that was active
during the first encounter of the macro.  In practice, this is
usually the C language, and we haven't had actual reports of projects
attempting to use AC_CHECK_FUNCS_ONCE across multiple languages,
rather this was discovered by code inspection.

With this patch, the code now tracks a separate per-language list of
names to check.  Note, however, that it is only possible to check for
a given function name in one language; attempting to add a name again
under AC_CHECK_FUNCS_ONCE while a different language is active is a
no-op (this still makes sense because the side-effect of defining
the CPP macro HAVE_FUNC does not include a language prefix).

* lib/autoconf/functions.m4 (_AC_CHECK_FUNC_ONCE)
(_AC_FUNCS_EXPANSION):
* NEWS: Mention it.

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