cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Need to build libcurl(libcurl.so) with a different library name(libxxx_curl.so)

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 2 Nov 2010 16:09:01 -0700

On Tue, Nov 02, 2010 at 02:12:14PM +0530, Parthasarathi Ilangovan wrote:
>   We are trying to package the default libcurl.so library for our organization
> with a different name libxxx_curl.so(to avoid conflict) . There are no changes
> made to the source. 
> Renaming the default libcurl.so.4 into libxxx_curl.so and linking does not work
> because after installation the binaries still show dependency to the orginal
> libcurl.so.
> I am guessing due to the fact that the so name is hardcoded in the library ELF
> format. 
>
> What would be the right way to build libcurl source to libcurl_xxx.so ? This
> library is being delivered along with our application in a single package. Is
> there any configure switches we can use? 
>
> The platform is Linux(Both RH and Suse).

It's libtool that has the smarts to embed the SONAME into the library. The name
is derived from the rules in the automake makefile, so it's not as simple as
adding a configure option to set the name. The most straightforward way is
probably to brute-force it by changing the names in the various makefiles
then doing a buildconf. This command should do it:

find . -name Makefile.am |xargs sed -i 's/libcurl\(.la\)/libxxx_curl\1/g'

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-11-03