[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Check for boost_graph library
From: |
Johan Oudinet |
Subject: |
Re: Check for boost_graph library |
Date: |
Thu, 29 May 2008 20:30:44 +0200 |
On Thu, May 29, 2008 at 7:49 PM, Ralf Wildenhues <address@hidden> wrote:
> * Johan Oudinet wrote on Thu, May 29, 2008 at 06:39:02PM CEST:
>> On Wed, May 28, 2008 at 5:34 PM, Johan Oudinet <address@hidden> wrote:
>> > AC_LANG_PUSH(C++)
>> > AC_CHECK_LIB([boost_graph], [read_graphviz], , AC_MSG_ERROR([This package
>> > needs libboost_graph]))
>
> Unrealted side note: this line is underquoted, as the most important
> quotes (those delimiting macro arguments which contain macro calls
> themselves) are missing.
Thanks for the side note.
>
> AC_CHECK_LIB([boost_graph], [read_graphviz], , [AC_MSG_ERROR([This package
> needs libboost_graph])])
>
>> > AC_LANG_POP
>
>> > Unfortunately, the generated code is wrong (since it doesn't use the
>> > right signature for read_graphviz).
>
>> I found a workaround by using a default function (like exit) to check
>> if libboost_graph exists. Now it works with AC_CHECK_LIB but not with
>> AC_SEARCH_LIBS because the exit function doesn't need any library.
>
> Typical workarounds I've seen so far is to use 'main' in the existance
> test, because exit may not be declared.
Actually, I read somewhere in this mailing list that using 'main' is
not a good idea, since a call to the main function is not allowed by
the standard.
>
>> Since I know this library is mandatory for the read_graphviz function,
>> it's OK. But I would know how to check the presence of a function
>> defined in a namespace, or with template parameters ?
>
> This is a problem; C++ tests don't work well with these macros. You
> could write a custom AC_LINK_IFELSE test, or look at the known places
> like the Autoconf Macro Archive, or the source of the package you're
> checking for, for macros already provided by someone else.
Yes that's where I found they use the 'exit' function for a similar purpose.
Thanks for your help.
Regards,
--
Johan