On Thu, Nov 21, 2024 at 12:17:52AM +0100, Patrice Dumas wrote:
> On Wed, Nov 20, 2024 at 09:36:14PM +0000, Gavin Smith wrote:
> > On Wed, Nov 20, 2024 at 08:41:20PM +0000, Gavin Smith wrote:
> > > locating and loading "libtexinfo.so" in texi2any directly
> > > would eliminate any risk of either not finding the file, or finding the
> > > wrong file.
> > 
> > I've committed changes to do this.  I had to override and revert
> > a commit you made before that as it clashed with my changes - I needed
> > the $additional_libraries argument which you had removed.
> 
> Indeed.
> 
> I think that your approach looks good.  One things that it not clear to
> me is whether the dlname or the library_names in .la file should be used
> to determine the file to load for a library.  My feeling would be that
> library_names should be used, but I am not sure since they are
> presumably always loaded by dlopen.

According to the libtool manual, section "Finding the correct name to dlopen"
(Info node '(libtool)Finding the dlname'),

  After a library has been linked with ‘-module’, it can be dlopened.
  Unfortunately, because of the variation in library names, your package
  needs to determine the correct file to dlopen.
  
     The most straightforward and flexible implementation is to determine
  the name at runtime, by finding the installed ‘.la’ file, and searching
  it for the following lines:
  
       # The name that we can dlopen.
       dlname='DLNAME'

Hence it appears to be the most straightforward approach to use dlname.
Using library_names may also be correct, but using dlname is the
recommended usage and therefore it makes the most sense to stick to that
rather than to try to work out whether library_names would make sense
too.

Reply via email to