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

Re: Possible library versioning approach -- (evaluation requested)



Junichi Uekawa <dancer@netfort.gr.jp> writes:

>> Doesn't -release actually change the library name, not the soname?
>
> It doesn't change the library name, no, look at libbfd as an example.

Hmm.  It seems to here.  With a Makefile.am entry of

  libgwrap_wct_la_LDFLAGS = -rpath $(libdir) -release 1-0-libfoo2-libbar1

I get

  .libs/libgwrap-wct-1-0-libfoo2-libbar1.so

and so the -l libname is now -lgwrap-wct-1-0-libfoo2-libbar1, not
-lgwrap-wct (what I wanted).

> You may not have yet read the Library packaging manual further enough, but 
> with " -release somethinglib -soname 0:0:0" you should get the following:

Did you mean -version-info rather than -soname above?

(Apologies if I'm overlooking something in the existing docs, but I've
read
http://www.netfort.gr.jp/~dancer/column/libpkg-guide/libpkg-guide.html,
and I didn't see anything about -soname.)

> liblibrary-somethinglib.so.0.0.0  (actual library file)
> liblibrary-somethinglib.so.0      (the symlink matching the soname)
> liblibrary.so                     (the symlink used for library linkage time)

but what I had originally been thinking about was

  liblibrary.so.1-0-libfoo2-libbar3

so that all the sub-lib dependencies were in the soname, not the
library base name.  This would mean that the end users could continue
to use -lfoo, rather than having to keep up with -lfoo-bar2-baz3, etc.

To do this, I'd need an option(s) to libtool that would let me say
"set the soname to 1-0-libbar2-libbar3 and use a library base name of
foo".  AFAIK libtool doesn't allow this...

>> I'd wondered about that too, but in many cases, for example for glib
>> and guile, it's easy to figure it out via glib-config and guile-config
>> respectively.
>
> That is nice.

Yes, though since you're right that it's not easy to detect the
libname in general, an alternate naming strategy for the full lib name
might be

  libfoo-1.so.1-0-libwhatever2-libwhateverelse3...

then you'd always have to link with -lfoo-1, and you'd always know
which version you were using based on the name.  But of course I'm
sure many end-users would fight having to change their makefiles all
the time if there wasn't some common infrastructure for determining at
configure time what the latest available library version/name is.

Thanks again.

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4



Reply to: