libtool
[Top][All Lists]
Advanced

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

Re: Validity of "fake" convenience library


From: Peter O'Gorman
Subject: Re: Validity of "fake" convenience library
Date: Mon, 03 Mar 2008 19:37:02 -0600
User-agent: Thunderbird 2.0.0.9 (X11/20071115)

Dan Nicholson wrote:
> I'm trying to use an internal static library from one project as a
> convenience library in another project. The problem is that the first
> project does not use libtool and the second does. So, there's no .la
> file and libtool complains about the portability of linking the static
> archive into another convenience library in the second project. My
> workaround was to create a fake .la file for the static library
> indicating that it's a convenience library. I just altered the names
> from a .la file that libtool had generated. Here's the commit:
> 
> http://cgit.freedesktop.org/~dbn/mesa/diff/?h=xserver-glx&id=6cad64b3
> 
> Is this a valid thing to do? What are the requirements for building a
> valid convenience library? -fPIC? What are the requirements for a
> valid .la file for a convenience library? Is there another option
> (besides libtoolizing the first project) that is more robust?
> 
> I realize this is a pretty insane thing to do, but the chances that
> mesa will become libtoolized are exceedingly low. And the current
> handling of this situation is at least equally fragile.

Hi Dan,

Please make sure that this fake .la file is only used in the build tree
where it is needed (only when building xserver? Why not commit these
bits to xserver then?). I would not like to see such a thing in /usr/lib
(or /usr/X11/lib or whereever).

The requirements for a convenience archive are that its objects be built
pic. Libtool has a pretty good idea how to do this with a large variety
of platforms and compilers. I have not looked at Mesa in quite a while
but I imagine that it also has this information for a number of
platforms and compilers.

Please do not hardcode -fpic/-fPIC, as that would limit the build to
gcc, instead try to ensure that you know the correct pic flag for the
compiler and platform that the user has. You should probably refuse to
build this library for platforms and compiler combinations where you do
not know the compiler flag to generate position independent code (even
though pic may be the default).

It really would be preferable to use libtool itself to generate this. If
it were possible to build it as part of the xserver then, since that
uses libtool, all would be well, wouldn't it?

Peter
-- 
Peter O'Gorman
http://pogma.com




reply via email to

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