logo       

Re: LD_LIBRARY_PATH does not supersede /usr/lib for AC_CHECK_LIB ?: msg#00051

sysutils.autoconf.general

Subject: Re: LD_LIBRARY_PATH does not supersede /usr/lib for AC_CHECK_LIB ?

Hi,

ok, stop shooting ;). I knew posting here would very soon direct me to
my silly mistakes, thanks for your replies.

Andreas Schwab <schwab@xxxxxxx> writes:

> LD_LIBRARY_PATH has no significance to the linker for finding the
> libraries to be linked in.

Uhm, blush. What we use is of course LIBRARY_PATH for (not run-time)
linking support, not LD_LIBRARY_PATH, which has nothing to do with
that problem.

We however set both of the above env. vars. in a support script so
that developers can just use (compile && run) with the library from
checked out cvs, just "tainting" their environment.

> This has nothing to do with autoconf anyway. If you need to add special
> directories for finding libraries pass "LDFLAGS=-L/your/special/dir" to
> the configure script.

> Bob Friesenhahn <bfriesen@xxxxxxxxxxxxxxxxxxx> writes:
>
> > On Thu, 19 Aug 2004, Andreas Schwab wrote:
(...)
> >> LD_LIBRARY_PATH has no significance to the linker for finding the
> >> libraries to be linked in.
> >
> > This is not a true statement. Some linkers (e.g. apparently Solaris 9s
> > ld') will use LD_LIBRARY_PATH for finding libraries.
>
> GNU ld also uses it, but only for finding implicit dependencies of shared
> libraries, and the Solaris linker may be doing the same. Note that I
> wrote "libraries to be linked in" above, which does not include those
> dependencies.

Yes, yes and yes ;). The obvious mistake here is that the "development
support scripts" in the support libraries use "LIBRARY_PATH" (which
obviously somehow affects at least gcc et.al), and not "LDFLAGS",
which is autoconf supported way.

I patched these scripts up to taint the environment using the
supported env vars. (listed via "configure --help") only (leaving
alone run time support via LD_LIBRARY_PATH), and this actually even
get the AC_CHECK_LIB in question to work fine.

Still the question why LIBRARY_PATH env. var would make g++ try to
explicitly link with -L/usr/lib, but that obviously really isn't an
autoconf question...

Thanks again for your pointers,

Stephan
--
Stephan A Suerken <suerken|absurd@xxxxxxxxxx>

Schlund + Partner AG, Karlsruhe


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise