[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Proposal to make better use of 5th arg to AC_CHECK_LIB and AC_SEARCH_LIB
From: |
Steven G. Johnson |
Subject: |
Proposal to make better use of 5th arg to AC_CHECK_LIB and AC_SEARCH_LIBS |
Date: |
Tue, 2 Oct 2001 14:14:42 -0400 (EDT) |
Rainer wrote:
> * If this first attempt fails, a second attempt should be made with
> *both* -lhesiod and -lresolv on the link line. If this succeeds, both
> -lhesiod and -lresolv should be added to LIBS.
I think that the 5th argument of AC_CHECK_LIB is intended primarily for
the case where you *don't* want the auxiliary libraries to be added to
LIBS, since they're going in your own private variable (e.g. @X_LIBS@)
that you'll add to the link command separately.
(Usually, in this case, you'll also override ACTION-IF-FOUND to not put
the result in LIBS either.)
> * It always tries to use -lresolv, while it may be necessary (or even
> present) only on some platforms. This may even be harmful in some
> cases:
This kind of pathology is best encapsulated in a separate check, I
think. i.e. you have a check (or a macro) that detects whether -lresolve
is present/working, and sets RESOLVE_LIB appropriately. Then, if you
want, you can either add $RESOLVE_LIB to $LIBS, or use it in the 5th
argument of AC_CHECK_LIB if you don't want it in $LIBS.
Steven