[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: where should libtool libraries be installed? /usr/lib? /usr/local/li
Re: where should libtool libraries be installed? /usr/lib? /usr/local/lib?
Thu, 12 May 2005 07:15:43 +0200
* Ed Hartnett wrote on Thu, May 12, 2005 at 01:01:17AM CEST:
> I'm converting the library to use libtool, but I have a very basic
> question: where should my library (by default) be installed?
I'd guess whereever the user wants it?
Do you mean where below $prefix or which $prefix to prefer?
> In the good old days, I would have unhesitatingly answered
> /usr/local/lib. But it seems that, when linking, libtool itself does
> not look in /usr/local/lib by default. (Or am I missing something?)
Ah, you talk about $prefix. Leave that to user discretion.
Whether libtool looks in /usr/local/lib by default, *should* depend on
the system in question, and whether it looks there by default for
linking. (Barring any bugs, that is.)
> In any case, my question is: where, in the opinion of the average
> libtool guru, should a general purpose scientific library be
> It is unlikely that users will use libtool to link to this library. I
> would like them (as in the good old days) to just put -lLIBNAME on
> their compiler command and have it find the library.
Sure. But the question of /usr vs. /usr/local is one of distribution
policies mostly, nowadays. It's very convenient if you know that
everything below /usr but not /usr/local is handled by your packaging
tool. Automatic upgrades and package dependency handling might easily
break if users install below /usr without thought.
So if your software gets packaged, it would probably show up under /usr,
else it should not live there.
> There is a school of thought (in this project) that the library should
> ultimately be installed (in default cases) in some subdirectory of the
> source code. Ease of having multiple versions of the library is cited
> as a supporting reason for this school of thought.
I really would not recommend installation *below the source tree*.
If you want to have multiple versions available, you have several
choices: Use proper library versioning (plus maybe versioned dirs
for the other stuff), or install in a package-private tree, like:
/opt/$PACKAGE-$VERSION. All of this should be choosable by the end
user with --prefix.
But please don't install below $top_srcdir! It confuses tools!
(BTW, the other question, whether your lib should be under
libdir='$prefix/lib' or something like pkglibdir='$libdir/$PACKAGE'
depends mostly on whether your users should use the library at all
or whether it's a module to be accessed by whatever else you install as
well. Your comments point to former.)
> Of course, in that case, a -I and -L option also must be provided by
> the user, to allow the compiler to find the include files, and the
> linker to find the library.