autoconf
[Top][All Lists]
Advanced

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

Re: Objections? Re: Checking for CXX libraries -- AC_CXX_CHECK_LIB ?


From: Sebastian Huber
Subject: Re: Objections? Re: Checking for CXX libraries -- AC_CXX_CHECK_LIB ?
Date: Sun, 29 Sep 2002 21:47:16 -0700

Hello!

On Sunday 29 September 2002 12:05, you wrote:
> I'm looking here for objections from the AutoConf list.
>
>
> I could probably have a version tonight or tomorrow that ignores the
> copied LANG(C)->LANG(C+) stuff and looks something like this:
>
> AC_CXX_CHECK_LIB(library, function, params, [action-if-found],
> [action-if-not-found], [other-libraries])

I've done it this way:

LIBS="$LIBS $TACO_LIBS -lTACOExtensions"
AC_MSG_CHECKING([for TACO extensions library])
AC_TRY_LINK([#include <TACOException.h>],[TACO::errorString( 
0)],taco_try=ok,taco_try=failed,)
AC_MSG_RESULT($taco_try)
if test $taco_try = "failed" ; then
        AC_MSG_ERROR([it seems that the TACO extension library is not 
installed])
fi

> ... really adding "params" in there before the optionals.  I could get
> this together, test it myself, and have Sebastian Huber, jlm, and Ossama
> Othman (recent requestors) test it out to see if it works for them.
> Forgive me if I commit syntactical errors; I'm chronically looking
> things up.
>
> The function above would generate a call something like:
>
> AC_CXX_CHECK_LIB(<lib>, pipes::pipeCheck, [(char *) "test", (int) 42])
>
> ... generating:
>
>       (void) pipes::pipeCheck ((char *) "test", (int) 42)

If you don't include the header file with the namespace and function
declaration you will get a syntax error.

> it would have to match against something like (ignoring return type):
>
> namespace pipes {
>
>       int pipeCheck (char *var1, int var2);
>
> };
>
> ...but then do we need to check for objects, too?

Yes, I needed it too, and it works with:
AC_TRY_LINK([#include 
<TACOClient.h>],[TACO::Client()],taco_try=ok,taco_try=failed,)

> I would consider that
> on a second-effort (you know, the infamous second-effort: all-singing,
> all-dancing, bloated excessive creeping feature of code... eek!).
>
> We could work this into a generic sense once it's functional.
[...]




reply via email to

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