user88595
user88595

Reputation: 99

How to build libcurl.so with a different target name?

I am using libcurl for my utility and its working very well till now for all Linux platforms. I downloaded, unzipped and simply followed the instructions given without any changes. My product uses the libcurl.so file and is linked dynamically. The .so file is bundled along with our product. Recently there were issues in Suse wherein we found that Libcurl is bundled by default and there was a conflict in installation.

To avoid this issue we tried renaming the libcurl.so into libother_curl.so but it did not work and my binaries still show libcurl.so as a dependency through ldd. I had since learnt that the ELF format of linux shared objects specifies the file name hardcoded as SO file name in the headers.(I could verify the same with objdump -p).

Now my question is what is the simplest way to go? How do I build a libcurl with a different name? My original process involves running configure with the following switches

./configure --without-ssl --disable-ldap --disable-telnet --disable-POP3 --disable-IMAP --disable-RTSP --disable-SMTP --disable-TFTP  --disable-dict --disable-gopher --disable-debug --enable-nonblocking --enable-thread --disable-cookies --disable-crypto-auth --disable-ipv6 --disable-proxy --enable-hidden-symbols --without-libidn --without-zlib

Make

Then pick the generated files from /lib/.libs

Are there any Configure Switches available wherein I can specify the target file name? Any specific Makefile I could change?

I tried changing in what I thought could be obvious locations but either could not generate the libs or were generated with the same name.

Any help is much appreciated.

Upvotes: 1

Views: 1887

Answers (2)

user88595
user88595

Reputation: 99

I got the answer from the curl forums(Thanks Dan). Basically we have to use the makefile.am as a starting point to go through a list of files and change the library name "libxxx_curl".

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

Upvotes: 1

Paulo Scardine
Paulo Scardine

Reputation: 77339

I lot of commercial applications bundle their particular library versions in a non standard path and then tweak environment variable LD_LIBRARY_PATH in a launch script so to avoid conflict. IMHO it is better than trying to change the target name.

Upvotes: 0

Related Questions