autoconf
[Top][All Lists]
Advanced

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

Checking libraries in multiple places -- frusturated by the cache


From: Robert A. Knop Jr.
Subject: Checking libraries in multiple places -- frusturated by the cache
Date: Sun, 25 Feb 2001 11:09:09 -0800 (PST)

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.)

Thanks for any help anyone can provide,

-Rob





reply via email to

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