libtool
[Top][All Lists]
Advanced

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

Re: Alternate SONAME values


From: Ganesan Rajagopal
Subject: Re: Alternate SONAME values
Date: Fri, 08 Jul 2005 09:24:30 +0530
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>>>>> "Keith" == Keith Packard <address@hidden> writes:

> On Thu, 2005-07-07 at 15:53 +0530, Ganesan Rajagopal wrote:
>> >>>>> "Keith" == Keith Packard <address@hidden> writes:
>> 
>> > There is another way to solve the problem; we can change the SONAME in
>> > the versioned filename varients:
>> 
>> > Version 6 Xaw      -> libXaw6.so.6.0.1 SONAME=libXaw.so.6
>> > Version 7 Xaw      -> libXaw7.so.7.0.0 SONAME=libXaw.so.7
>> > Version 8 Xaw      -> libXaw8.so.8.0.0 SONAME=libXaw.so.8
>> 
>> May be I am missing something here. Assuming you used -version-info to
>> generate the libraries, libtool embeds the library SONAME with the major
>> version into the library by default. 

> I want to change the base of the SONAME from libXaw6 to libXaw, and have
> the major version only present after the .so; as far as I can tell, I
> can't get libtool to do this.

But libXaw.so.<major_number> is the default behaviour for libtool.  Are you
using -release instead of -version-info or -version-number? I think
-version-number will give you exactly what you need.

========
`-version-number MAJOR[:MINOR[:REVISION]]'
     If OUTPUT-FILE is a libtool library, compute interface version
     information so that the resulting library uses the specified
     major, minor and revision numbers.  This is designed to permit
     libtool to be used with existing projects where identical version
     numbers are already used across operating systems.  New projects
     should use the `-version-info' flag instead.
========

May be you're explicitly passing libXaw6.la as the library name instead of
libXaw.la. You should pass libXaw.la as the library name instead of
libXaw6.la or libXaw7.la. Let me give an example:

========
$ touch xaw.c
$ libtool  --mode=link gcc -rpath /usr/lib -version-number 6:0:0 -o libXaw.la 
xaw.c
rm -fr  .libs/libXaw.a .libs/libXaw.la .libs/libXaw.lai .libs/libXaw.so 
.libs/libXaw.so.6 .libs/libXaw.so.6.0.1
gcc -shared    -Wl,-soname -Wl,libXaw.so.6 -o .libs/libXaw.so.6.0.0
(cd .libs && rm -f libXaw.so.6 && ln -s libXaw.so.6.0.0 libXaw.so.6)
(cd .libs && rm -f libXaw.so && ln -s libXaw.so.6.0.0 libXaw.so)
ar cru .libs/libXaw.a 
ranlib .libs/libXaw.a
creating libXaw.la
(cd .libs && rm -f libXaw.la && ln -s ../libXaw.la libXaw.la)
$ libtool  --mode=link gcc -rpath /usr/lib -version-number 7:0:1 -o libXaw.la 
xaw.c
rm -fr  .libs/libXaw.a .libs/libXaw.la .libs/libXaw.lai .libs/libXaw.so 
.libs/libXaw.so.6 .libs/libXaw.so.6.0.0
gcc -shared    -Wl,-soname -Wl,libXaw.so.7 -o .libs/libXaw.so.7.0.1
(cd .libs && rm -f libXaw.so.7 && ln -s libXaw.so.7.0.1 libXaw.so.7)
(cd .libs && rm -f libXaw.so && ln -s libXaw.so.7.0.1 libXaw.so)
ar cru .libs/libXaw.a 
ranlib .libs/libXaw.a
creating libXaw.la
(cd .libs && rm -f libXaw.la && ln -s ../libXaw.la libXaw.la)
========

As you can see, The SONAME is libXaw.so.6 or libXaw.so.7 which is exactly
what you want. By the way, I have libtool 1.5.6 on Debian. 

Ganesan

-- 
Ganesan Rajagopal (rganesan at debian.org) | GPG Key: 1024D/5D8C12EA
Web: http://employees.org/~rganesan        | http://rganesan.blogspot.com




reply via email to

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