autoconf
[Top][All Lists]
Advanced

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

Re: how to use libraries in /usr/local


From: Steven G. Johnson
Subject: Re: how to use libraries in /usr/local
Date: Fri, 25 May 2001 14:39:55 -0400 (EDT)

Russ Albery writes:
> Steven G Johnson <address@hidden> writes:
> > What's wrong with just doing:
> > ./configure LDFLAGS="-L/usr/local/lib -L/usr/pubsw/lib"
> > CPPFLAGS="-I/usr/local/include -I/usr/pubsw/include"
> 
> See my followup message.  That doesn't take care of shared libraries
> across multiple platforms, for one.  (That's the really major thing that
> it doesn't take care of, but there are others.)

I would argue that if a shared library has been properly installed, the
runtime linker should know where to find it (e.g. via /etc/ld.so.conf or
LD_LIBRARY_PATH, or...).  -rpath should normally only be necessary to use
stuff that has not yet been installed (and in that case is taken care of
by libtool). Autoconf deals with portability problems, not with faulty
software installations (e.g. it dies if gcc is broken, etc.).

(Of course, if you want -rpath, you can always add it to the LDFLAGS as
well.)

> I'd also rather not add in every possible location that software might
> be installed when that software isn't actually needed; I'd rather that
> autoconf only add in the flags that are necessary.

That may be your personal preference, but I don't see a technical reason
for Autoconf to navigate the many potential pitfalls of trying to cull
extraneous -L and -I flags, or alternatively for forcing the user to
specify which directories she wants for each package.  What's the harm of
a few extra -L and -I flags?

(The only time I can see a harm is when you have different versions of a
given package installed, and you want to select one version in some cases
and the other version in other cases.  But Autoconf has no way to make
this decision in general, so you'll have to specify the -L/-I flags for
each package manually in that case anyway.)

I think I can see a relatively reliable way for Autoconf to detect whether
-L/-I work (by creating test header/library files in a subdirectory and
compiling/linking), and I agree that it could be nice to let the user just
supply e.g. a colon-separated list of directories a:b:c and have Autoconf
add a/lib, b/include, etcetera to the library and header paths.  This
would certainly be a convenience, although I don't see it as a major
advance in terms of functionality over the current situation.

Steven






reply via email to

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