[Top][All Lists]

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

Re: Problem detecting libraries.

From: Bob Friesenhahn
Subject: Re: Problem detecting libraries.
Date: Fri, 26 Jan 2001 08:23:18 -0600 (CST)


You need to ensure that your configure script tests for libraries in
the order of least dependent to most dependent, and appends each
library discovered to the LIBS variable.  Unfortunately Autoconf does
not understand library dependencies so you must determine these by
yourself (use 'ldd' if you are unsure).

The documentation for AC_CHECK_LIB provides a summary description of
this. "This macro is intended to support building of LIBS in a
right-to-left (least-dependent to most-dependent) fashion such that
library dependencies are satisfied as a natural side-effect of
consecutive tests. Some linkers are very sensitive to library ordering
so the order that LIBS is generated in is important to reliable
detection of libraries."

In some situations you may want to use the "other-libraries" argument
to AC_CHECK_LIB to supply libraries that the library you are testing
depends on (in case you want to test them as a group) while in others
you will want to extend LIBS with the required libraries prior to the
test.  I have sometimes found it useful to checkpoint the value of
LIBS so that it may be restored to the checkpointed value if further
tests fail.

Bob Friesenhahn

reply via email to

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