Allan Clark wrote:
This almost argues for a change to a generic function in AC_CHECK_LIB. Do we ever have a need for an AC_CHECK_LIB() to check C libraries usingI think there is definitely such a need. What happens is that in some library checks (for example, pthreads), you don't know whether the function you are testing might be a macro. In this case, you need to #include a header file and write an actual code snippet with the correct number (at least) of arguments. Currently, this means using AC_TRY_LINK, which has the disadvantage of requiring manual fiddling with $LIBS (and not being cached).
a raw code snippet? AC_CHECK_LIB(<foo>,functioncall(),...) might have
some use, but I haven't seen it yet.
So, rather than doing something specifically for C++, I would advocate a more generalized version of AC_CHECK_LIB that, like AC_TRY_LINK, takes INCLUDES and FUNCTION-BODY arguments instead of FUNCTION. (And works with whatever the current language is. This could also be useful for Fortran.)
Cordially,
Steven G. Johnson