On 08/05/2010 10:30 AM, Charlie Zender wrote: > I need a macro, NCO_CHECK_FUNCS(func1, func2, ....), to define CPP > tokens HAVE_FUNC1, HAVE_FUNC2, .... when func1() and func2() are > found, or to defined NEED_FUNC1, NEED_FUNC2, .... when func1() and > func2() are not found. > > The current definition of this macro fails because it does not > transform (usually lowercase) function names (e.g., acos()) into > uppercase CPP-ish tokens---it produces NEED_acos instead of > NEED_ACOS. Hence it probably needs to call AS_TR_CPP somehow. > Yet my autoconf skills are poor and no matter where I insert a > call to AS_TR_CPP, it breaks. > > Would greatly appreciate it if someone would show how to modify > the following to generate results like HAVE_ACOS and NEED_ACOS > instead of HAVE_acos and NEED_acos: Untested, but try: > > AC_DEFUN([NCO_CHECK_FUNCS], > [AC_FOREACH([NCO_Func],[$1], > [AC_CHECK_FUNC(NCO_Func, > [AC_DEFINE_UNQUOTED([HAVE_]NCO_Func, [1], > [Define to 1 if compiler finds external `]NCO_Func[' function])], [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]NCO_Func), [1], ... > [AC_DEFINE_UNQUOTED([NEED_]NCO_Func, [1], > [Define to 1 if compiler needs external `]NCO_Func[' function])]dnl Likewise. -- Eric Blake eblake@xxxxxxxxxx +1-801-349-2682 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf