autoconf
[Top][All Lists]
Advanced

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

Re: --prefix and -R path


From: Bob Friesenhahn
Subject: Re: --prefix and -R path
Date: Tue, 21 Oct 2003 14:29:57 -0500 (CDT)

On Tue, 21 Oct 2003, Bill Moseley wrote:

> I'm revisiting an old thread.  I'm using autoconf 2.57.
>
>   http://mail.gnu.org/archive/html/autoconf/2003-06/msg00013.html
>
> If I use AC_CHECK_LIB does configure try to *run* the program?

No.  It only does a link to see if the specified symbol is resolved.

> What's happening is configure and make run fine, but ldd shows "not
> found" for libz's runtime linkage.
>
> I'm linking with zlib which is installed in /usr/local/lib, but it seems
> that on this machine (Solaris 2.6) that /usr/local/lib is not part of
> the default search path.
>
> This causes confusion because configure is saying libz is found and then
> make check fails saying libz is not found.

A correct -R option needs to be specified, or set LD_LIBRARY_PATH

> Another thing that is confusing (and I'm not sure if it's related to why
> configure is not failing the libz check) is that the problem only
> happens when using a --prefix setting.
>
> Without a --prefix the final link link has -R/usr/local/lib added.
> But if --prefix=/foo is used then that -R setting is *replaced* with
> -R/foo.  I understand that, but I'm wondering if configure should also
> be prefix aware.

I don't believe that Autoconf uses or provides -R options at all.  It
sounds like this is coming from elsewhere within the configure script.

> So the result is the program only fails when a --prefix is used, which
> is also confusing for the person trying to install the application.
>
> It would be nice if configure would catch this.  But I'm not sure if
> it's because configure is not actually running the test program for
> zlib, or if configure is using a different -R when linking the test
> program vs. linking the application.
>
> Or maybe it's something completely different.

Autoconf does not establish a linker run path by default since that
would be highly controversial, and would break many package
distribution schemes.

You probably will need to arrange for setting a linker run path within
your portion of the configure script.  If you are not cross-compiling,
then you are free to compile, link, and run, rather than just
compiling and linking.

Bob
======================================
Bob Friesenhahn
address@hidden
http://www.simplesystems.org/users/bfriesen





reply via email to

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