[Top][All Lists]

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

Re: Using autoconf-lib-link outside gettext

From: Bruno Haible
Subject: Re: Using autoconf-lib-link outside gettext
Date: Mon, 23 May 2005 11:29:50 +0200
User-agent: KMail/1.5

Hrvoje Niksic wrote:
> Is there a canonical location for the M4 files and for `config.rpath'?

They are currently distributed as part of GNU gettext. In your package,
the M4 files usually go under m4/ and the config.rpath goes into the directory
declared with AC_CONFIG_AUX_DIR, usually called build-aux/.

> Is it possible to provide custom locations for certain libraries?  For
> example, Wget's configure script looks for OpenSSL in the
> system-default location, then in /usr/local/ssl (the location used by
> OpenSSL's `make install'), then in /usr/local, then in /opt.  If the
> user specifies a root directory, that one is used instead.  Is it
> possible to similarly influence AC_LIB_LINKFLAGS?

The user can specify a --with-libssl-prefix=... option. The macro will then
look there. Additional search locations are not implemented currently - it
is assumed that the installing person knows where to find the appropriate
versions of the libraries - but it would be easy to add a third argument to
AC_LIB_LINKFLAGS, consisting of extra prefix directories.

> It is sometimes also important to check for headers at the same time
> when checking for the library.  How does AC_LIB_LINKFLAGS deal with
> the issue of finding the correct -I invocation to go along with the
> -L/-R invocations?

AC_LIB_LINKFLAGS assumes that if the library is under $PREFIX/lib/, the
include files are under $PREFIX/include/. Any other heuristics would risk
combining library and include files that don't fit together.

> Another thing that doesn't seem to be covered is the relation between
> this macro, and AC_CHECK_LIB.  Am I supposed to use both or does
> AC_LIB_LINKFLAGS include everything one would expect AC_CHECK_LIB to
> do?

No, AC_LIB_LINKFLAGS should be used when you assume the library exists.

If you want to test for the presence of the library at the same time as
you locate it, use the macro
  AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
It searches for libname and the libraries corresponding to explicit and
implicit dependencies, together with the specified include files and
the ability to compile and link the specified testcode. If found, it
sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
LTLIB${NAME} variables and augments the CPPFLAGS variable, and
#defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.


reply via email to

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