[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Checking libraries in multiple places -- frusturated by the cache
From: |
Vaclav Haisman |
Subject: |
Re: Checking libraries in multiple places -- frusturated by the cache |
Date: |
Sun, 25 Feb 2001 21:39:16 +0100 (CET) |
Hi,
is there any chance that such machinery will ever be a part of autoconf?
Vaclav Haisman
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d- s+:(+) a-- c++ UB+(++) P++(+++) L+ E W++ N+ o? K? w+ O? M-(--)
V? PS(+) PE++ Y PGP t(+) 5? X R+@ tv+ b++ DI+ D+ G e h! r-(--) !z+
------END GEEK CODE BLOCK------
On Sun, 25 Feb 2001, Lars Hecking wrote:
> Robert A. Knop Jr. writes:
> > I'm fairly new to autoconf, so this may be a clueless question.
> >
> > What I'm trying to do is check a few standard places for a library
> > and then set a variable (*not* LIBS, but my own) based on where this
> > library was found. To this end, I have the following code in
> > configure.in:
> >
> > for i in '' -L$prefix/lib -L$prefix/pgsql/lib; do
> > found=''
> > AC_MSG_RESULT("Looking for Postgres library in $i")
> > AC_CHECK_LIB(pq, PQconnectdb, found=1, found='', $i)
> > if test $found; then
> > pgsql_lib=$i
> > break
> > fi
> > done
> > if test $found; then
> > AC_MSG_RESULT("Postgres library found: $pgsql_lib")
> > else
> > AC_MSG_ERROR("Postgres library not found!")
> > fi
> >
> > The problem I'm having is that after the first test fails, the generated
> > configure script never really tests the other places I'm looking for the
> > library-- because the failure of the first test is cached, so it thinks it
> > doesn't need to do the test again!
> >
> > Is there some way I can tell configure to throw out the previous cached
> > value of this test before tryiing the AC_CHECK_LIB test again? I haven't
> > found anything in the documentation which would indicate how one does
> > this.
> >
> > I don't want to include the result of the test in LIBS, I want to set a
> > different value; this is why I don't just use AC_SEARCH_LIBS. (In any
> > event, AC_SEARCH_LIBS says it sets -lsomething, not -Lsomething.)
>
> I have been doing something very similar for gnuplot: two macros, one
> for headers, one for libs, with a for loop around non-caching and silent
> versions of the resp. autoconf macros. See attached. I think I wrote
> this stuff before AC_SEARCH_LIBS became part of autoconf.
>
>