[Top][All Lists]

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

Re: using AC_CHECK_LIB across different libc versions

From: Noah Misch
Subject: Re: using AC_CHECK_LIB across different libc versions
Date: Wed, 13 Oct 2004 15:20:48 -0700
User-agent: Mutt/1.5.6i

On Wed, Oct 13, 2004 at 10:44:21AM -0500, Rob Benton wrote:
> I could be trying this in the wrong way but the only way I've been able 
> to get
> AC_CHECK_LIB to work is by using the symbol of a function from one of my 
> libraries.
> Also I set the AC_LANG to C++.  But across different machines with different
> compilers and versions of C++ libraries the symbols are different.  I've 
> thought
> about just writing my simple 'nm | grep' test but I wanted to get some 
> advice first.
> Am I going about this in the wrong way?

Wow.  Unless we're both out of our gourds, AC_CHECK_LIB simply does not work for
C++ functions.  My cursory testing confirms that.  Thanks for the report.

AC_CHECK_LIB is essentially the same for both AC_LANG(C) and AC_LANG(C++); in
both cases, it looks for a function of the given name with C linkage.  I think
the function argument should be optional for C++; a for a C++
program would still supply that argument when testing for C libraries but omit
it to test for pure C++ libraries.  Accepting a full function prototype so as to
actually test for a C++ function seems too involved.  I'll try to make a patch.

For now, your solution seems reasonable.  That a star Autoconf macro does not
work for C++, despite documentation to the contrary, speaks to the popularity of
libraries of C++ functions among free software developers.

reply via email to

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