[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: checking twice the same library with AC_CHECK_LIB
From: |
Eric Blake |
Subject: |
Re: checking twice the same library with AC_CHECK_LIB |
Date: |
Fri, 18 Mar 2011 08:41:19 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 |
On 03/18/2011 08:29 AM, Vincent Torri wrote:
>
> Hey,
>
> on Windows, with mingw, libbfd may depend on gettext (libintl, more
> precisely). I would like to do something like:
>
> AC_CHECK_LIB([bfd], [bfd_openr],
> [
> have_bfd="yes"
> bfd_libs="-lbfd"
> ],
> [have_bfd="no"])
> if test "x$have_bfd" = "xno" ; then
> AC_CHECK_LIB([bfd], [bfd_openr],
> [bfd_libs="-lbfd -lintl"],
> [AC_MSG_ERROR([the symbol bfd_openr can not be found])],
> [-lintl])
> fi
According to the autoconf manual, you should rearrange the test order,
and test for libintl first prior to bfd, so that $LIBS will already
include -lintl by the time you are ready to test for -bfd. Also,
AC_CHECK_LIB has a fifth argument (other-libraries); you may want to try:
AC_CHECK_LIB([bfd], [bfd_openr], [...], [...], [-lintl])
if you haven't already guaranteed that -lintl is in $LIBS.
http://www.gnu.org/software/autoconf/manual/autoconf.html#Libraries
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature