Sorry to come (very) late to this thread, I was just reading back through the archives...

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 using
a raw code snippet? AC_CHECK_LIB(<foo>,functioncall(),...) might have
some use, but I haven't seen it yet.
I 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).

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





Reply via email to