[opensuse-packaging] .la files, shlib-policy, autotools
The shared library policy says: - Avoid packaging libtool config files (.la files). In general they are not needed if you do not package a static library. If in doubt, ask. I would like more clarification on when they are needed and not but more importantly: Can anyone tell me what is the correct autotools way to control if these files get installed alongside the .so? It seems they generally get created and installed even if you are not building a static library and using rm in the %install section seems hackish. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Dnia 2008-08-06, śro o godzinie 12:45 -0600, Andrew Jorgensen pisze:
The shared library policy says:
- Avoid packaging libtool config files (.la files). In general they are not needed if you do not package a static library. If in doubt, ask.
Most KDE packages need them if made by libtool. -- Jakub 'Livio' Rusinek http://liviopl.jogger.pl/
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jakub 'Livio' Rusinek wrote:
Dnia 2008-08-06, [ro o godzinie 12:45 -0600, Andrew Jorgensen pisze:
The shared library policy says:
- Avoid packaging libtool config files (.la files). In general they are not needed if you do not package a static library. If in doubt, ask.
Most KDE packages need them if made by libtool.
Another issue is that there are several projects out there that use
libtool at runtime (libltdl) to load libraries and plugins (shlibs).
Those need the .la files as they contain the metadata used by libltdl to
do the dlopen (dynamic shlib loading).
A solid indication that a package requires the .la files at runtime is
when the binaries (shlibs, executables) have been linked against libltdl.so
One can trace that down using ldd, or my ldd2rpm script [1] (just make
sure to run it against all relevant files: *.so, *.so.*, bin/*)
Note that rpmbuild also collects that sort of information, so doing a
"rpm --qp --requires foo-1.0.0-1.x86_64.rpm|grep libltdl" would work
too, but only post-mort^Wbuild.
[1]http://linux01.gwdg.de/~pbleser/files/rpm/ldd2rpm
But, to get back to your original question: no, there is no way (I'm
aware of) to avoid installing the .la files.
Removing them with %__rm in the %install section after %makeinstall is
the appropriate way to handle this, e.g.:
%install
%makeinstall
%__rm "%{buildroot}%{_libdir}"/*.{a,la}
(although building+installing the static libs can usually be suppressed
by passing --disable-static to %configure, but why bother, you have to
remove the .la files anyway, it would just save you an "ar" run, which
is very fast)
cheers
- --
-o) Pascal Bleser
Pascal Bleser wrote:
(although building+installing the static libs can usually be suppressed by passing --disable-static to %configure, but why bother, you have to remove the .la files anyway, it would just save you an "ar" run, which is very fast)
Not just an 'ar' run - when building both static and dynamic libraries, libtool compiles every object file twice, with and without -fPIC (and it seems to compile twice also on x86_64 where it builds both object files with-fPIC...). Michal --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hi, On Wed, 6 Aug 2008, Jakub 'Livio' Rusinek wrote:
Dnia 2008-08-06, śro o godzinie 12:45 -0600, Andrew Jorgensen pisze:
The shared library policy says:
- Avoid packaging libtool config files (.la files). In general they are not needed if you do not package a static library. If in doubt, ask.
Most KDE packages need them if made by libtool.
You always have to differentiate between modules and libraries. On an ELF system .la files for shared libraries are always useless (an exception would be if you use libtool for linking and explicitely place a file like "/usr/lib/foo.la" in the link command, but that's usually not the case, so just don't do that). The situation is similar with modules (i.e. those opened via (lt)dlopen). Often applications using ltdlopen will name the .la file directly, and hence it would be required at runtime. If they wouldn't it all will still work even without the .la file, no matter if ltdlopen is used or not. Again, for an ELF system. Hence the general policy of _not_ to package the .la files. Of course you have to check the package if it indeed still works. Chances are very high if it doesn't use plugins or the like. Ciao, Michael.
Michael Matz escribió:
an exception would be if you use libtool for linking and explicitely place a file like "/usr/lib/foo.la" in the link command, but that's usually not the case, so just don't do that).
I have found in the past some apps that did that :-D they abuse "foobar-config" scripts with flags similar to "--libs-la" or some other non-sense
Often applications using ltdlopen will name the .la file directly, and hence it would be required at runtime.
Yep, in that case, people should try to fix the software in question, if possible. -- "A computer is like an Old Testament god, with a lot of rules and no mercy. " Cristian Rodríguez R. Platform/OpenSUSE - Core Services SUSE LINUX Products GmbH Research & Development http://www.opensuse.org/
participants (6)
-
Andrew Jorgensen
-
Cristian Rodríguez
-
Jakub 'Livio' Rusinek
-
Michael Matz
-
Michal Marek
-
Pascal Bleser