autoconf
[Top][All Lists]
Advanced

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

Re: Check for boost_graph library


From: Ralf Wildenhues
Subject: Re: Check for boost_graph library
Date: Thu, 29 May 2008 19:49:16 +0200
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

* 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.

  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.

> 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.

Hope that helps.

Cheers,
Ralf




reply via email to

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