autoconf
[Top][All Lists]
Advanced

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

Re: AC_CHECK_LIB: Library is found on build host but is not on a target


From: Eric Blake
Subject: Re: AC_CHECK_LIB: Library is found on build host but is not on a target host
Date: Mon, 23 Aug 2010 12:20:10 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.2

On 08/23/2010 11:56 AM, Sergio Belkin wrote:
Hi,

I've autoconfiscated an open source project. I don't using still
automake, only I am using autoconf. So I've created an confugure.ac as
follows:

AC_PREREQ([2.65])
AC_INIT([UpTools],[8.4],address@hidden)
AM_INIT_AUTOMAKE([foreign -Wall -Werror dist-bzip2])

Umm - this line says you're using automake.

AC_CONFIG_SRCDIR([UpConf.cc])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CXX
AC_PROG_CC
AC_LANG([C++])
AC_PROG_RANLIB


AC_CHECK_LIB([ssl], [main],[SSL=-lssl],echo "Error: Required library
ssl not found. Install openssl development package and try again"&&
exit 1 )

Get in the habit of using proper m4 quoting. Also, use AC_MSG_ERROR instead of hand-rolling your own version (since your version forgot to document anything in config.log):

AC_CHECK_LIB([ssl], [main],[SSL=-lssl],
[AC_MSG_ERROR(["Error: Required library ssl not found. Install openssl development package and try again"])])

Another thing - these days, it is generally better to use AC_SEARCH_LIBS than AC_CHECK_LIB, since there are some platforms that provide functions in libc and thus don't require any external libraries to be linked in.


if test -e /usr/lib64/libresolv.a

Ouch - that is doomed to failure. It is better to check whether linking with -lresolv can succeed, than it is to assume that existence of a hard-coded location implies that the library is available.

I've build that on Mandriva 2010.1 and it worked fine. It compiles
with no problems. But it's failing to find mysql libraries on a Fedora
9 system even those libraries are installed:

I didn't see any mention of mysql in your sample configure.ac, nor any macro call that would explain why you are getting this message:

checking for mysql_get_parameters in -lmysqlclient... no
Error: Required library mysqlclient not found. Install it and try again

Are you sure you pasted the right file?

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

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