autoconf
[Top][All Lists]
Advanced

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

Need help inserting AS_TR_CPP functionality in macro


From: Charlie Zender
Subject: Need help inserting AS_TR_CPP functionality in macro
Date: Thu, 05 Aug 2010 09:30:02 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6

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:

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([NEED_]NCO_Func, [1],
     [Define to 1 if compiler needs external `]NCO_Func[' function])]dnl
)])])

Thanks,
Charlie
-- 
Charlie Zender, Department of Earth System Science
University of California, Irvine (949) 891-2429 :)



reply via email to

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