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: Mon, 30 Sep 2002 19:35:39 -0700

On Monday 30 September 2002 10:06, Allan Clark (Reply to List Only) wrote:
> Sebastian;
>
> > AC_CXX_CHECK_LIB (LIBRARY, DECLARATION-SECTION,CALL-SECTION,
> >         [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], [OTHER-LIBRARIES])
>
> You've added a "declaration section" to my sample.
>
> Is this a re-statement without further reinforcement or justification
> that you want to have a #include section there, or how else would you
> use it?  Can you provide an example usage?

Sorry, I should use the standard terminology.
In terms of AC_TRY_LINK:
        DECLARATION-SECTION <=> INCLUDES
        CALL-SECTION <=> FUNCTION-BODY

I used DECLARATION because you can place here any include directive or 
declaration and CALL because you can call here constructors and functions.

> Is this a way to avoid something like:
>
>       AC_CXX_CHECK_LIB(foo, [Foo *f = makeMeAFoo();], , , )
>
> ... ie having the declaration (Foo *f) inline with the function call
> itself?
>
> Allan
>
> Sebastian Huber wrote:
> > Hello,
> > I think that AC_CXX_CHECK_LIB fits not very good into the AC_LANG_PUSH
> > ... concept but I suppose there is no chance to avoid a new function. The
> > problem with AC_CHECK_LIB is that it uses C linkage for C++ libraries. I
> > think the interface to a C++ library check should look like:
> >
> > AC_CXX_CHECK_LIB (LIBRARY, DECLARATION-SECTION,CALL-SECTION,
> >         [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], [OTHER-LIBRARIES])
> >
> > If someone uses header files in the DECLARATION-SECTION he is responsible
> > to check them. If header files are not availible, she can write the
> > necessary declarations explicitly.
> >
> > An alternative is to write no new function, but place a hint into the
> > documentation that you cannot use AC_CHECK_LIB for C++ an should use
> > AC_TRY_LINK.
> >
> > Ciao
> >         Sebastian





reply via email to

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