autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help inserting AS_TR_CPP functionality in macro


From: Eric Blake
Subject: Re: Need help inserting AS_TR_CPP functionality in macro
Date: Thu, 05 Aug 2010 11:27:07 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100803 Red Hat/3.1.2-1.el6 Mnenhy/0.8.3 Thunderbird/3.1.2

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   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]